Skip to content

GOATNetwork/solis-contracts

Repository files navigation

Solis Smart Contracts

This repository contains the Hardhat 3 implementation of the Solis v1.3 on-chain escrow contracts.

The system uses two production contracts:

  • SolisRegistry: non-proxy version discovery for escrow deployments.
  • SolisEscrow: multi-matter escrow execution where the Payor funds on-chain, the Recipient confirms or rejects on-chain, and confirmed funds are released immediately.

The contracts intentionally do not store legal text, names, emails, identity data, attachments, salts, or raw settlement packages. The on-chain commitment is settlementDigest, generated and stored by the platform off-chain.

Install

npm install

Build

npm run build

The Solidity profile uses compiler 0.8.35, optimizer, viaIR, and the osaka EVM target.

Solidity Formatting

Install Foundry before formatting Solidity code:

curl -L https://foundry.paradigm.xyz | bash
foundryup
forge --version

Format Solidity files with Forge:

forge fmt contracts

Format TypeScript files with Prettier:

npm run format:ts

Check formatting without modifying files:

npm run format:sol:check
npm run format:ts:check

Test

npm test

Run the full local verification suite:

npm run verify

The TypeScript tests cover:

  • Registry registration, metadata consistency, deprecation, reactivation, and latest escrow discovery.
  • PlatformSigner EIP-712 approval over matterId, settlementDigest, addresses, amounts, token, deadlines, and registry version.
  • Payor-only funding through payAndSubmitMatter using USDC receiveWithAuthorization.
  • Exact grossAmount balance-increase checks, including short-transfer token rejection.
  • Recipient confirmation with immediate fund release.
  • Recipient rejection and full Payor refund.
  • Confirmation deadline refunds by Payor or platform operator.
  • Global pause and Matter pause behavior.
  • Accounted balance protection for sweepExcessToken.
  • PlatformSigner rotation and EIP-1271 smart contract platform signer validation.

Deployment

The Ignition module is ignition/modules/SolisCore.ts.

npx hardhat ignition deploy ignition/modules/SolisCore.ts

Default parameters:

  • owner: deployer account.
  • platformSigner: account index 1.
  • pauser: account index 2.
  • settlementToken: Ethereum mainnet USDC (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48).
  • registryVersion: 1.
  • semver: 1.3.0.

Override parameters with an Ignition deployment parameters file for non-local deployments.

EIP-712 Domain

SolisEscrow signs with:

name: SolisEscrow
version: 1
chainId: block.chainid
verifyingContract: address(this)

This binds PlatformSigner approvals to a specific chain and escrow version contract. registryVersion is also included in the typed data.

Escrow Flow

Wallet and frontend teams should use docs/integration.md for typed data, transaction, event indexing, and diagram examples.

The platform creates the off-chain Matter, locks the agreement document, computes settlementDigest, and signs MatterParams with an active PlatformSigner.

Payor funding:

payAndSubmitMatter(params, platformSig, auth)

The Payor must be msg.sender, the payment deadline must still be valid, and the supplied USDC authorization must move exactly grossAmount into escrow.

Recipient confirmation:

confirmAndRelease(params)

The Recipient must be msg.sender, the params must match the stored Matter snapshot, and the confirmation deadline must still be valid. Confirmation immediately splits funds to the Recipient, platform fee recipient, and Mediator.

Recipient rejection:

rejectAndRefund(params)

The Recipient must be msg.sender. Rejection refunds the full gross amount to the Payor.

Confirmation timeout:

refundAfterConfirmationDeadline(matterId)

After confirmationDeadline, the Payor or a platform operator can trigger a full refund to the Payor. The caller cannot choose another refund recipient.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors