Skip to content

Conversation

@MontrealAI
Copy link
Owner

Motivation

  • Avoid ERC20 corner cases where transfer/transferFrom calls with amount 0 revert on some tokens, and ensure dispute state is not left misleadingly set after settlement while preserving storage layout and public interfaces.
  • Keep telemetry/ops visibility and bytecode within the existing EIP-170 guard without refactoring unrelated logic.

Description

  • Add a zero-amount short-circuit in the internal helper function _t(address to, uint256 amount) so that outbound transfers never call token transfer with 0 (safe-guarding token compatibility).
  • Prevent a safeTransferFromExact(..., 0) in the agent bond intake by making the agent bond transferFrom conditional while still accounting for lockedAgentBonds and storing job.agentBondAmount unchanged.
  • Ensure dispute initiator hygiene by setting job.disputeInitiator = msg.sender when a dispute bond is posted and clearing job.disputeInitiator when the dispute bond is settled in _settleDisputeBond, keeping dispute lifecycle state consistent without changing storage layout.
  • Minor housekeeping: removed the unused DeprecatedParameter error and make setAdditionalAgentPayoutPercentage revert with InvalidParameters, and rely on the hardened TransferUtils helper for skipping zero-value reward-pool contributions to keep diffs minimal and conserve bytecode.

Testing

  • Ran npx truffle compile and compilation completed successfully.
  • Ran the repository bytecode guard node scripts/check-bytecode-size.js and the AGIJobManager runtime bytecode was 24569 bytes which is within the 24575-byte EIP-170 safety margin.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant