Skip to content

Read fee values from kvstore in the escrow contract#3812

Open
portuu3 wants to merge 3 commits intodevelopfrom
escrow-fee-kvstore
Open

Read fee values from kvstore in the escrow contract#3812
portuu3 wants to merge 3 commits intodevelopfrom
escrow-fee-kvstore

Conversation

@portuu3
Copy link
Collaborator

@portuu3 portuu3 commented Mar 4, 2026

Issue tracking

Closes #3811

Context behind the change

  • Core contracts:

    • Update Escrow.setup(...) to remove fee arguments and fetch per-oracle fee from KVStore.get(oracle, "fee").
    • Add/keep parsing and validation in escrow for KVStore fee values:
      • non-empty numeric string required
      • per-oracle max fee enforcement (<= 25)
      • total fees still bounded (<= 100)
    • Add kvstore dependency to escrow deployment path:
      • pass KVStore address to Escrow constructor
      • store KVStore address in EscrowFactory
      • update EscrowFactory.initialize(...) to accept _kvstore
      • add setKVStoreAddress(...) admin method for upgrades.
    • Update interfaces/signatures:
      • IEscrow.setup(...) without fee params
      • EscrowFactory.createFundAndSetupEscrow(...) without fee params.
    • Ensure upgrade compatibility:
      • append storage vars only
      • adjust storage gap accordingly.
    • Update deployment scripts to provide KVStore address when deploying factory.
  • TypeScript SDK:

    • Remove fee argument passing from EscrowClient.setup(...) and createFundAndSetupEscrow(...).
    • Remove client-side fee validation for these methods (fees now validated on-chain via KVStore).
    • Keep config fee fields optional for backward compatibility.
    • Update tests and docs/examples to new signatures.
  • Python SDK:

    • Remove fee argument passing from escrow setup and create_fund_and_setup_escrow.
    • Keep fee fields optional/deprecated in EscrowConfig for compatibility, but ignore them in calls.
    • Update unit tests and docs/examples to reflect new API.

How has this been tested?

  • Deploy on Amoy testnet
  • Run core compile/tests for escrow/factory/staking.
  • Run TS SDK escrow tests + build.
  • Run Python static checks/tests in available environment.
  • Run repo lint and resolve any new lint config dependency gaps.

Release plan

  • Upgrade proxy in all networks and set kvstore address

Potential risks; What to monitor; Rollback plan

  • Contracts incompatibility

@portuu3 portuu3 self-assigned this Mar 4, 2026
@vercel
Copy link

vercel bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

5 Skipped Deployments
Project Deployment Actions Updated (UTC)
faucet-frontend Ignored Ignored Preview Mar 5, 2026 0:22am
faucet-server Ignored Ignored Preview Mar 5, 2026 0:22am
human-app Skipped Skipped Mar 5, 2026 0:22am
human-dashboard-frontend Skipped Skipped Mar 5, 2026 0:22am
staking-dashboard Skipped Skipped Mar 5, 2026 0:22am

Request Review

@portuu3 portuu3 requested review from Dzeranov and dnechay March 4, 2026 13:02
Copy link
Collaborator

@dnechay dnechay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to add changesets

…ow contract

- rename manifestUrl to manifest
@vercel vercel bot temporarily deployed to Preview – human-dashboard-frontend March 5, 2026 12:21 Inactive
@vercel vercel bot temporarily deployed to Preview – human-app March 5, 2026 12:21 Inactive
@vercel vercel bot temporarily deployed to Preview – staking-dashboard March 5, 2026 12:21 Inactive
Copy link
Collaborator

@dnechay dnechay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm in general, some minor questions

# Restore full workspace dependencies after local runs to avoid breaking
# top-level commands like `yarn lint`.
if [[ -z "${CI:-}" ]]; then
yarn --cwd "$REPO_ROOT" install --mode=skip-build
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why skip-build? It might leave some top-level packages in a partial state after installation

Comment on lines +1305 to +1310

try {
return await readManifestField('manifest');
} catch {
return await readManifestField('manifestUrl');
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
try {
return await readManifestField('manifest');
} catch {
return await readManifestField('manifestUrl');
}
if (typeof this.contract.manifest === 'function') {
return await this.contract.manifest();
} else if (typeof this.contract.manifestUrl === 'function') {
return await this.contract.manifestUrl();
} else {
throw new Error('No known manifest prop');
}

Is something like the above possible to simplify the code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the new ABI this if (typeof this.contract.manifestUrl === 'function') will never be true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Core] Read fee values from kvstore in the escrow contract

3 participants