carbonable-labs / cairo-erc-7496

NFT Dynamic Traits
Apache License 2.0
9 stars 6 forks source link

Implement starknet foundry integration tests along with EIP7496 #4

Closed saimeunt closed 5 months ago

saimeunt commented 6 months ago

This PR implements the starknet foundry integration tests replicated from the reference Solidity implementation. I went along and implemented ERC7496 as a component to pass the tests accordingly. I had an issue with the correct design pattern to implement overrides in Cairo. If I add a method in the component interface eg. 'set_trait', I'm unable to override it in the preset, I'm getting the following error:

Failed to generate ABI: Duplicate entry point: 'set_trait'. This is not currently supported.

I ended up declaring the overrides as internal methods and declaring the proper interface on the preset instead but it doesn't feel quite right.

Fixes #3 Fixes #1

saimeunt commented 5 months ago

@TAdev0 Wow thank you very much for this extensive review, very good insights 👍 @tekkac I will continue my work on a separate PR to account for TAdev0 review 👌