Skip to content

feat: update SafeErc20 to newer Solidity version #652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

simon0x1800
Copy link

This PR updates the SafeERC20 implementation to match the latest Solidity version, adding support for new features and improving error handling. The changes include:

  • Addition of try_safe_transfer and try_safe_transfer_from functions that return bool instead of reverting
  • Implementation of force_approve function for handling tokens requiring zero-reset approval
  • Addition of ERC1363 support with transfer_and_call_relaxed, transfer_from_and_call_relaxed, and approve_and_call_relaxed functions
  • Implementation of safe_increase_allowance and safe_decrease_allowance functions
  • Enhanced error handling with detailed Error enum types
  • Added Rust-specific safety improvements and idiomatic error handling

Resolves #620

PR Checklist

  • Tests
  • Documentation
  • Changelog

simon0x1800 and others added 17 commits May 2, 2025 14:05
…xed method for clarity and consistency in ISafeErc20 trait
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…g with calldata for improved error handling and clarity
Copy link

netlify bot commented May 8, 2025

Deploy Preview for contracts-stylus canceled.

Name Link
🔨 Latest commit aa2a535
🔍 Latest deploy log https://app.netlify.com/sites/contracts-stylus/deploys/681ce283abd3d3000888c6d9

@bidzyyys bidzyyys changed the title Feature/620 update safe erc20 feat: update SafeErc20 to newer Solidity version May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Update SafeErc20 to match the new Solidity version of the Contract
1 participant