Skip to content

Conversation

@portuu3
Copy link
Collaborator

@portuu3 portuu3 commented Oct 29, 2025

Issue tracking

Closes #3639

Context behind the change

Update escrow factory contract to create, fund and setup escrow in 1 transaction

How has this been tested?

Locally and unit tests

Release plan

  • Deploy contracts

Potential risks; What to monitor; Rollback plan

Possible upgrade incompatibilities

@vercel
Copy link

vercel bot commented Oct 29, 2025

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

Project Deployment Preview Comments Updated (UTC)
human-app Ready Ready Preview Comment Oct 30, 2025 1:20pm
human-dashboard-frontend Ready Ready Preview Comment Oct 30, 2025 1:20pm
staking-dashboard Ready Ready Preview Comment Oct 30, 2025 1:20pm
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
faucet-frontend Ignored Ignored Preview Oct 30, 2025 1:20pm
faucet-server Ignored Ignored Preview Oct 30, 2025 1:20pm

@dnechay
Copy link
Collaborator

dnechay commented Oct 29, 2025

@portuu3 could you please remove docs changes from this PR? It will be easier to review and also I suppose that we will have to re-generate them before actual release anyway

@portuu3
Copy link
Collaborator Author

portuu3 commented Oct 29, 2025

@portuu3 could you please remove docs changes from this PR? It will be easier to review and also I suppose that we will have to re-generate them before actual release anyway

@dnechay done

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 overall, have a question though

If my understanding is correct, in place where we want to launch escrow in 1 tx we will have to do something like:

const token = IERC20__factory.connect(tokenAddress, signer);
await token.approve(escrowClient.escrowFactoryContract.target, amount);
const escrowAddress = await escrowClient.createFundAndSetupEscrow(
   tokenAddress,
   amount,
   jobRequesterId,
   escrowConfig
);

which means that it will show two pop-ups from the wallet (e.g. Metamask) to the user:

  1. to approve ERC20 transfer from escrow-factory contract
  2. to actually create an escrow

I suppose it should be fine for improved UX, because the whole escrow creation process is still once tx that either succeeds or fails. However I'm curious if we could use approach with ERC20Permit or we have limitations/it might be an overhead? So user approves just one tx

@portuu3
Copy link
Collaborator Author

portuu3 commented Oct 29, 2025

LGTM overall, have a question though

If my understanding is correct, in place where we want to launch escrow in 1 tx we will have to do something like:

const token = IERC20__factory.connect(tokenAddress, signer);
await token.approve(escrowClient.escrowFactoryContract.target, amount);
const escrowAddress = await escrowClient.createFundAndSetupEscrow(
   tokenAddress,
   amount,
   jobRequesterId,
   escrowConfig
);

which means that it will show two pop-ups from the wallet (e.g. Metamask) to the user:

  1. to approve ERC20 transfer from escrow-factory contract
  2. to actually create an escrow

I suppose it should be fine for improved UX, because the whole escrow creation process is still once tx that either succeeds or fails. However I'm curious if we could use approach with ERC20Permit or we have limitations/it might be an overhead? So user approves just one tx

@dnechay not all tokens include permit that's why I used this approach. HMT for example doesn't have it

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
Please double-check why CVAT tests are failing (not sure if it's related to this branch or contacts-v2 in general

@portuu3
Copy link
Collaborator Author

portuu3 commented Oct 30, 2025

LGTM Please double-check why CVAT tests are failing (not sure if it's related to this branch or contacts-v2 in general

It is related to contracts-v2

@portuu3 portuu3 merged commit df5bec0 into contracts-v2 Oct 30, 2025
19 of 20 checks passed
@portuu3 portuu3 deleted the contracts-v2-2 branch October 30, 2025 13:20
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.

3 participants