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 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7888698
feat: SafeErc20.rs match the solidity version
simon0x1800 May 2, 2025
06565ee
refactor: Update force_approve method in ISafeErc20 trait to include …
simon0x1800 May 2, 2025
c193733
feat: Update SafeErc20 to match the new Solidity version of the Contract
simon0x1800 May 2, 2025
8d99290
refactor: Simplify force_approve method and improve code readability …
simon0x1800 May 2, 2025
2457829
refactor: Rename 'to' parameter to 'spender' in approve_and_call_rela…
simon0x1800 May 2, 2025
84bd984
refactor: Remove SafeErc20 trait and related tests to streamline the …
simon0x1800 May 5, 2025
b96f2e5
Update contracts/src/token/erc20/utils/safe_erc20.rs
simon0x1800 May 5, 2025
b81ad53
Update contracts/src/token/erc20/utils/safe_erc20.rs
simon0x1800 May 5, 2025
6765b4d
Update contracts/src/token/erc20/utils/safe_erc20.rs
simon0x1800 May 5, 2025
342d74c
refactor: Update safe_erc20.rs to improve method calls and code clarity
simon0x1800 May 5, 2025
174b634
Merge branch 'feature/620-update-safe-erc20' of https://github.com/si…
simon0x1800 May 5, 2025
10840e1
Update contracts/src/token/erc20/utils/safe_erc20.rs
simon0x1800 May 5, 2025
46ea88f
Update contracts/src/token/erc20/utils/safe_erc20.rs
simon0x1800 May 5, 2025
e88951a
refactor: Enhance SafeErc20 method calls by replacing RawCall encodin…
simon0x1800 May 6, 2025
d19173a
Merge branch 'feature/620-update-safe-erc20' of https://github.com/si…
simon0x1800 May 6, 2025
49f9b00
refactor: Update SafeErc20 method calls to use data conversion for im…
simon0x1800 May 8, 2025
aa2a535
feat: Update SafeERC20 to match latest Solidity version
simon0x1800 May 8, 2025
b918696
Merge branch 'main' into feature/620-update-safe-erc20
simon0x1800 Jun 19, 2025
bbcff79
review implementation
simon0x1800 Jun 19, 2025
6ae9cc3
Merge branch 'feature/620-update-safe-erc20' of https://github.com/si…
simon0x1800 Jun 19, 2025
155e686
Merge branch 'main' into feature/620-update-safe-erc20
bidzyyys Jun 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ impl IErc20 for MyContract {
*/

#![allow(
clippy::module_name_repetitions,
clippy::used_underscore_items,
deprecated
clippy::module_name_repetitions,
clippy::used_underscore_items,
deprecated
)]
#![cfg_attr(not(any(test, feature = "export-abi")), no_std, no_main)]
#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
Expand All @@ -95,4 +95,4 @@ extern crate alloc;
pub mod access;
pub mod finance;
pub mod token;
pub mod utils;
pub mod utils;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format all code with cargo +nightly fmt --all

9 changes: 2 additions & 7 deletions contracts/src/token/erc20/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ mod sol {
#[derive(Debug)]
#[allow(missing_docs)]
error ERC20InvalidReceiver(address receiver);
/// Indicates a failure with the `spender`s `allowance`. Used in
/// Indicates a failure with the `spender`'s `allowance`. Used in
/// transfers.
///
/// * `spender` - Address that may be allowed to operate on tokens without
Expand Down Expand Up @@ -109,7 +109,7 @@ pub enum Error {
InvalidSender(ERC20InvalidSender),
/// Indicates a failure with the token `receiver`. Used in transfers.
InvalidReceiver(ERC20InvalidReceiver),
/// Indicates a failure with the `spender`s `allowance`. Used in
/// Indicates a failure with the `spender`'s `allowance`. Used in
/// transfers.
InsufficientAllowance(ERC20InsufficientAllowance),
/// Indicates a failure with the `spender` to be approved. Used in
Expand Down Expand Up @@ -272,11 +272,6 @@ pub trait IErc20 {
) -> Result<bool, Self::Error>;
}

#[public]
#[implements(IErc20<Error = Error>)]
impl Erc20 {}

#[public]
Comment on lines -275 to -279
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this

impl IErc20 for Erc20 {
type Error = Error;

Expand Down
Loading