Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cygaar/ERC721Stylus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERC721 Stylus

Implementation of ERC721 in Rust for Arbitrum's Stylus. Most of the code is based off of the example here, however there are several differences:

  • Fixed balances bug in the transfer function
  • Fixed receiver check for safeMint and safeTransfer
  • Optimized mint function to be more gas efficient
  • Optimized safeMint function to be more gas efficient
  • mint(address) has been changed to mint(address, tokenId). Same goes for safeMint.
  • totalSupply was removed from the base implementation
  • supportsInterface returns true for IERC721Metadata
  • tokenUri() has been renamed to tokenUR() to match the ERC721 spec
  • Changed internal burn() function to only require a tokenId
  • Refactored code to match the latest Stylus SDK

Running the code

To get the contract abi, you can run:

cargo stylus export-abi

To deploy the code you can run (this will use the default Stylus RPC):

cargo stylus deploy --private-key=<PRIVATE_KEY>

You can interact with Stylus contracts as you would any other contract using the exported ABI.

More info on Stylus can be found here.

About

Implementation of ERC721 in Rust for Stylus

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages