Harden token transfers and dispute-initiator lifecycle #520
+43
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
transfer/transferFromcalls with amount0revert on some tokens, and ensure dispute state is not left misleadingly set after settlement while preserving storage layout and public interfaces.Description
function _t(address to, uint256 amount)so that outbound transfers never call tokentransferwith0(safe-guarding token compatibility).safeTransferFromExact(..., 0)in the agent bond intake by making the agent bondtransferFromconditional while still accounting forlockedAgentBondsand storingjob.agentBondAmountunchanged.job.disputeInitiator = msg.senderwhen a dispute bond is posted and clearingjob.disputeInitiatorwhen the dispute bond is settled in_settleDisputeBond, keeping dispute lifecycle state consistent without changing storage layout.DeprecatedParametererror and makesetAdditionalAgentPayoutPercentagerevert withInvalidParameters, and rely on the hardenedTransferUtilshelper for skipping zero-value reward-pool contributions to keep diffs minimal and conserve bytecode.Testing
npx truffle compileand compilation completed successfully.node scripts/check-bytecode-size.jsand theAGIJobManagerruntime bytecode was 24569 bytes which is within the24575-byte EIP-170 safety margin.Codex Task