/sysethereum-contracts

Syscoin <=> Ethereum bridge smart contracts

Primary LanguageJavaMIT LicenseMIT

Sysethereum contracts

Build Status

Ethereum contracts for the Syscoin <=> Ethereum bridge.

If you are new to the Syscoin <=> Ethereum bridge, please check the docs repository first.

Core components

  • SyscoinSuperblocks contract
    • Keeps a copy of the Syscoin Superblockchain
    • Informs SyscoinToken contract when a Syscoin transaction locked or unlocked funds.
    • It's kind of a Syscoin version of BtcRelay but using Superblocks instead of blocks.
  • SyscoinToken contract
    • An ERC20 contract where 1 token is worth 1 Syscoin.
    • Tokens are minted when coins are locked on the Syscoin blockchain.
    • Tokens are destroyed when coins should go back to the Syscoin blockchain.
  • SyscoinClaimManager contract
    • Manages the interactive (challenge/response) validation of Superblocks.
  • SyscoinMessageLibrary
    • Library for parsing/working with Syscoin blocks, txs and merkle trees

Running the Tests

  • Install prerequisites

      npm install -g truffle@5.0.24
    
      npm install -g ganache-cli
    
  • Clone this repo.

  • Install npm dependencies.

    • cd to the directory where the repo is cloned.
      npm install
    
  • Compile contracts

      # compile contracts
      truffle compile --all
    
  • Run tests:

      # first start ganache-cli - and do this again once your gas ran out
      ganache-cli --gasLimit 4000000000000
    
      # run tests
      truffle test
    

Deployment

To deploy the contracts

Requirements

  • A Rinkeby/Mainnet client running with rpc enabled

Deployment

  • Run ./scripts/exportAndInit.sh

License

MIT License
Copyright (c) 2019 Blockchain Foundry Inc
License