cairo-contracts icon indicating copy to clipboard operation
cairo-contracts copied to clipboard

Cairo implementation of EIP-4626

Open FilipLaurentiu opened this issue 3 years ago • 5 comments

Full details of the standard OpenZeppelin has always offered the best implementations for different standards in Ethereum and now in Starknet. EIP-4626 it's the new popular standard for tokenized vaults and many projects already use it for their Vaults on Ethereum.

Starknet is becoming more and more popular and many projects need an implementation of this standard on which to rely. OZ has always provided well tested tools with no security issues.

An implementation from OZ would save a lot of development time and money

There are already two implementation for this standard in Cairo https://github.com/koloz193/ERC4626 https://github.com/milancermak/cairo-4626

FilipLaurentiu avatar Apr 16 '22 19:04 FilipLaurentiu

A few thoughts on this:

  • This implementation is more respectful of the standard
  • What do we think of using namespaces ? Sounds like a good thing to change everywhere tbh
  • Adding safemath would be great
  • We should use from starkware.cairo.common.bool import TRUE, FALSE if I'm looking correctly at latest changes
  • The storage_var should be called ERC4626_asset_ to fit OZ guidelines

EvolveArt avatar Apr 17 '22 21:04 EvolveArt

These implementations are awesome. Let me throw one more in the hat: https://github.com/auditless/cairo-erc4626

  • We follow the solmate impl.
  • Use TRUE, FALSE
  • Use ERC4626_ naming conventions

Like the idea of namespaces / safemath.

Pet3ris avatar May 05 '22 09:05 Pet3ris

@EvolveArt added your wishlist of safemath and namespaces:

https://github.com/auditless/cairo-erc4626

Pet3ris avatar May 24 '22 14:05 Pet3ris

a reference implementation for Cairo 1: https://github.com/0xEniotna/ERC4626

martriay avatar Jan 30 '24 02:01 martriay