tuler / deroll

TypeScript framework for Cartesi applications
https://deroll.vercel.app
MIT License
18 stars 13 forks source link

ERC721 and ERC1155 support #63

Closed tuler closed 7 months ago

tuler commented 7 months ago

Add support for ERC721 and ERC1155. Breaking change: change balanceOf to explicit etherBalanceOf and erc20BalanceOf

This implementation follows the same design pattern of the support of ether and ERC20.

Test has 100% coverage now.

To run tests, there is an issue with vitest not supporting import assertion. So the best I could do for now was to comment out the assert { type: "json" } from packages/wallet/wagmi.config.ts so pnpm run test works.

changeset-bot[bot] commented 7 months ago

🦋 Changeset detected

Latest commit: d9dbcb83d2674cc72b4c6604f01fa92650b9d1d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | -------------- | ----- | | @deroll/wallet | Minor | | wallet | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

tuler commented 7 months ago

Still missing batch transfer of ERC1155 and batch withdraw of ERC1155. Will work on that

tuler commented 7 months ago

Batch operations of ERC1155 implemented.

tuler commented 7 months ago

Problem of running test fixed

fabiooshiro commented 7 months ago

I prefer balanceOfEther. Not a big deal

tuler commented 7 months ago

I prefer balanceOfEther.

I agree it's a little strange, but the context is:

The name of the method was a reflection of the name of the ERC20 method, balanceOf(account) So it's of account, not of erc20

To be fair ERC71 also has a balanceOf(owner) which we don't have.