Skip to content

Use TSTORE in contracts deployed to multiple chains with varying opcode support

License

Notifications You must be signed in to change notification settings

ProjectOpenSea/tstorish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tstorish

A simple utility for working with the TSTORE opcode when available, but falling back to SSTORE when unavailable.

Inherit Tstorish on a contract, then it will:

  • activate TSTORE on contract deployment if supported on the respective chain
  • allow for post-deployment activation by calling __activateTstore()
  • fall back to SSTORE if TSTORE is not initially available and has not been activated

Usage:

  • _setTstorish(uint256 storageSlot, uint256 value) internal
  • _getTstorish(uint256 storageSlot) internal view returns (uint256 value)
  • _clearTstorish(uint256 storageSlot) internal

About

Use TSTORE in contracts deployed to multiple chains with varying opcode support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published