Create a deal
UI Step: Buyer fills in seller address, amount, token, and agreement hash (terms), then clicks "Create Deal".
Technical Behavior:
Function:
createDeal(address seller, uint256 amount, address tokenAddress, bytes32 termsHash)The buyer must approve the token transfer beforehand.
The contract calculates a 3% fee, deducts it, and locks the remaining funds in escrow.
The deal is stored with a unique
dealId.The
DealCreatedevent is emitted.
Notes:
Deal funds are stored in
bankroll[address(this)][tokenAddress].Terms are stored off-chain and referenced by their
termsHash.
2
3

Last updated