Skip to content

Conversation

@MontrealAI
Copy link
Owner

Motivation

  • Prevent ERC20 edge-case reverts by avoiding zero-amount transfer and transferFrom calls in payout/bond paths.
  • Ensure dispute initiator state is not misleading while preserving storage layout and mainnet bytecode budget.
  • Improve operational telemetry for critical config setters with minimal, bytecode-conscious logging.

Description

  • Added zero-amount guards for outbound transfers and introduced a small helper _tFrom to centralize safeTransferFromExact usage and skip 0-amount calls, and changed _t to skip 0 transfers in contracts/AGIJobManager.sol.
  • Hardened bond intake flows so agent and validator bond paths do not call token transferFrom with amount == 0 (uses _tFrom and preserves locked*Bonds accounting).
  • Marked Job.disputeInitiator as deprecated in-place (kept storage layout) and removed active setting/clearing to avoid misleading non-zero values while keeping the slot reserved.
  • Added a compact ConfigUpdated(bytes32,bytes32) telemetry event (emitted via a tiny assembly log helper) for a small set of numeric setters (setPremiumReputationThreshold, setMaxJobPayout, setJobDurationLimit) to improve ops visibility while preserving bytecode headroom.
  • Confirmed delistJob already uses nonReentrant so no change was needed there, and left ENSJobPages unchanged because it already emits owner setter events.

Testing

  • Ran npm run build which compiled the contracts successfully with solc (no config changes to truffle-config.js and solcViaIR=false).
  • Ran the repo bytecode guard (npm run size) and the AGIJobManager runtime bytecode is within the guard (artifact reports 24575 bytes), so size gating passes.
  • No new unit tests were added to keep the diff minimal; compilation and bytecode-size checks succeeded.

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