OpenZeppelin / rust-contracts-stylus

A library for secure smart contract development written in Rust
MIT License
84 stars 22 forks source link

[Feature]: SafeERC20 utility #279

Closed ggonzalez94 closed 1 week ago

ggonzalez94 commented 2 months ago

What is the feature you would like to see?

Wrappers around ERC-20 operations that throw on failure. Reference implementation: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol

Contribution Guidelines

vking45 commented 2 months ago

I would like to take up this issue

bidzyyys commented 2 months ago

@vking45 thanks for wanting to contribute to the library 🚀 Of course you can work on this issue!
It would be great if you can submit a draft PR with your initial design/implementation, that way our team can give you feedback early on.

0xNeshi commented 2 months ago

@bidzyyys created a draft PR with just safe_transfer implemented to show what is the idea for the utility's design, let me know if you have any feedback and if you think I can continue working on this.

Note that the documentation within the PR is copy/pasted from the Solidity version, it's low priority atm and is still wip