Skip to content

Latest commit

 

History

History

cryptoxmas-contracts

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Crypto Xmas Contracts

Contracts for the cryptoxmas.xyz. Includes:

  • Escrow contract with buy and claim logic
  • NFT token (ERC721 Enumerable + Mintable)

Non-custodian escrow

Buying gift flow

Send

  1. Sender buys Christmas Card (NFT) by sending ETH to an escrow Smart Contract. (Optionally sender can add more ETH for receiver)
  2. Escrow Smart Contract mints NFT and keeps it in the escrow
  3. Smart Contract sends small amount (0.01 eth) to ephemeral account, rest of NFT price to Giveth campaign as a donation and leaves ETH above the NFT price for receiver to claim in escrow.
  4. Sender shares claim link, which contains private key for ephemeral account, with receiver

Receiving gift flow

Receive

  1. Receiver submits claim transaction from the address generated by the private key in the claim link.
  2. The escrow Smart Contract transfers the Christmas Card (NFT) and optional ether to the receiver’s address

Building contracts

Requirements

  • NodeJS v10.12.0
  • Yarn 1.10.1

Building and testing contracts

Install libs:

yarn

Waffle is used to build and test contracts - https://github.com/EthWorks/Waffle
To build contracts run:

yarn waffle 

To test:

yarn test

Deploying new Escrow contract guide and NFT tokens

WIP

License

GPL-3 Liscense