/hashi-ethereum

Ethereum smart contracts of the Hashi protocol

Primary LanguageSolidityMIT LicenseMIT

🛠️ EXPERIMENTAL VERSION 🛠️

Ethereum smart contracts of the Hashi protocol. The oracle part has not been implemented yet. Therefore, this code is a Proof of Concept but is far from final protocol.

BurnableERC721 (Wrapper) Contract

This contract is the Tezos wrapper contract of the protocol. Basically, it is a FA2 Contract with a burn entrypoint, and a isBurned view.

  • mint: Mint a wrapped NFT on Ethereum. Takes a recipient (address) and a tokenURI (string) as parameters.
  • burn: Burns the wrapped token. Take a tokenId (uint256) as parameter.

Locker Contract

This contract implements the locking protocol of Hashi.

  • lockToken : Deposits and locks a token in the contract. Parameters: token, the NFT (externalTokenId, tokenContractAddress, depositor) that we want to lock.

  • unlockToken: Deletes the NFT from lockedTokenByID, and add it to releasedIds. Requisite to withdraw. Take an internalTokenId (uint256) as parameter.

  • withdraw: Sends back on Ethereum a token that has been bridged on Tezos, after unlocking it. Take a internalTokenId (uint256) as parameter.