Skip to content

vrolland/cryptotreasure

Repository files navigation

CryptoTreasures

Bug bounty program on immunefi.com is closed for now.

CryptoTreasure.sol

CryptoTreasure is an ERC721 token with additional features. It has the capacity of a box and is able to store other tokens (ETH, ERC20, ERC721 & ERC1155). The box has an access management system (lock and restrictions). It also has a "type" which manages an ERC20 locking system to mint a crypto treasure. A type defines:

  • how many tokens of this type can be minted
  • the erc token and amount to be locked
  • the timestamp from which you can mint it

The locked erc20 tokens can be released by "destroying" the crypto treasure.

Box contracts

BoxStorage.sol

Abstract contract declaring events and storage to handle boxes. Used by BoxBase.sol and BoxBase.sol.

BoxExternal.sol

Box with public functions to store, withdraw, transferBetweenBoxes and destroy. This contract delegateCall the contract BoxBase. This contract forbid reception of ERC115 and ERC721 except if the operator is this contact. Don't directly send ERC20 to this contract!

BoxBase.sol

Box with functions to store, withdraw, transferBetweenBoxes and destroy. This contract is meant to be delegateCalled by a contract inheriting from BoxExternal. This contract forbid reception of ERC115 and ERC721. Don't directly send ERC20 to this contract!

BoxWithTimeLock.sol

Box with a time lock. A locked box prevent withdrawing, storing or destroying until the end of the lock.

ERC721 contracts

ERC721Typed.sol

Abstract contract to type ERC721. Every token has a type with optional data.

ERC721TypedMintByLockingERC20.sol

Allow the ERC721 to be minted from locking erc20s. Every type requires a specific amount of a specific erc20. To unlock the erc20 tokens locked after minting, the internal function _unlockMint() must be called.

Utils

Bytes.sol

Internal library to extract data from Bytes.

Developers

npm i
npm run forge-install
npm run build
npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published