Skip to content

Restore DeprecatedParameter, guard zero reward contributions, and harden transfers/dispute lifecycle#524

Open
MontrealAI wants to merge 1 commit intomainfrom
codex/apply-final-hardening-for-mainnet-readiness-exazbl
Open

Restore DeprecatedParameter, guard zero reward contributions, and harden transfers/dispute lifecycle#524
MontrealAI wants to merge 1 commit intomainfrom
codex/apply-final-hardening-for-mainnet-readiness-exazbl

Conversation

@MontrealAI
Copy link
Owner

Motivation

  • Fix failing tests and ABI mismatch by restoring the deprecated custom error and re-exporting the ABI.
  • Prevent ERC20 compatibility/edge-cases by skipping zero-value transfers and guarding reward-pool contributions.
  • Keep dispute lifecycle and escape-hatch invariants correct while trimming bytecode to remain under the EIP-170 runtime size limit.

Description

  • Restore the DeprecatedParameter custom error and make setAdditionalAgentPayoutPercentage revert with DeprecatedParameter instead of InvalidParameters.
  • Add a zero-amount short-circuit to the internal transfer helper function _t(address to, uint256 amount) to avoid calling transfer with 0.
  • Make agent bond intake conditional so TransferUtils.safeTransferFromExact and lockedAgentBonds are only updated when bond > 0 while still storing job.agentBondAmount.
  • Ensure dispute initiator hygiene by setting job.disputeInitiator = msg.sender on disputeJob and clearing it to address(0) in _settleDisputeBond.
  • Re-introduce a zero-amount guard on contributeToRewardPool and remove nonReentrant from contributeToRewardPool and requestJobCompletion to reduce bytecode; sum locked balances in withdrawableAGI inside an unchecked block for gas/size efficiency.
  • Export and commit the refreshed UI ABI at docs/ui/abi/AGIJobManager.json to match the updated interface.

Testing

  • Ran npm run ui:abi and the ABI exported to docs/ui/abi/AGIJobManager.json successfully.
  • Ran the full test suite with npm run test (which runs truffle compile --all and the Truffle/Mocha tests) and all tests passed (236 passing).
  • Verified runtime bytecode size with node scripts/check-bytecode-size.js, reporting 24568 bytes which is within the 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