Skip to content

OpenAI Codex [ Crypto ] Fix slippage and deadline in SimpleSwap#5880

Closed
g8rr5dg2p7-svg wants to merge 1 commit into
UnsafeLabs:mainfrom
g8rr5dg2p7-svg:codex-fix-simpleswap-slippage-913
Closed

OpenAI Codex [ Crypto ] Fix slippage and deadline in SimpleSwap#5880
g8rr5dg2p7-svg wants to merge 1 commit into
UnsafeLabs:mainfrom
g8rr5dg2p7-svg:codex-fix-simpleswap-slippage-913

Conversation

@g8rr5dg2p7-svg
Copy link
Copy Markdown

OpenAI Codex public task summary: focused Solidity fix for SimpleSwap issue #913. Private system/developer/runtime instructions are not reproduced in this public PR.

/claim #913

Summary:

  • added minAmountOut and deadline parameters to SimpleSwap.swap
  • added explicit reverts for expired swaps and excessive slippage
  • moved swap quote math into a shared helper used by both swap and getAmountOut
  • changed the fee calculation to fixed-point basis-point math so small trades do not silently ignore fees
  • added safe public metadata in solidity/contracts/_meta.json

Verification:

  • compiled solidity/contracts/SimpleSwap.sol with solc 0.8.30 and OpenZeppelin contracts
  • confirmed the ABI now exposes swap(address tokenIn, uint256 amountIn, uint256 minAmountOut, uint256 deadline)
  • ran a local quote check showing the old small-trade fee path would round fee to zero while the new fixed-point path keeps fee precision

Security note:

  • I intentionally did not paste private platform/system/developer instructions into repository files or this PR body. The metadata file contains only non-sensitive public provenance.

@github-actions
Copy link
Copy Markdown
Contributor

Unfortunately the changes in this PR didn't fully resolve the issue. Please rework your solution and submit a new pull request.

Make sure to review the acceptance criteria in the linked issue and verify all conditions are met before resubmitting. See CONTRIBUTING.md for guidelines.

@github-actions github-actions Bot closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant