HTTPS SSH

Sweetbridge Smart Contracts

The repository contains Smart Contracts code, tests and dev envrionment.

License

The code and all related work is protected. Please refer to the LICENSE file for details.

User Wallets

You can setup the wallet using one of the two popular clients: MyEtherWallet and MetaMask.

Localhost parameters

Please refer to truffle.js for more information. chainID must be the same as networkID.

MyEtherWallet

  1. Install chrome extension. Or: download latest release and open the index.html in your browser.
  2. In the top right corner - click on the Network menu and Add Custom Node
  3. Use above parameters for network address. Select Custom. Tick Supports EIP-155 and put Chain id as specified above.
  4. Generate private key or use existing one and in the main panel, add new wallet to easily manage transfers.

MetaMask

  1. Install Firefox or Chrome extension
  2. In the top left corner use localhost (if you are running geth locally) or Custom RPC and use parameters form above.

NOTE: Latest Metamask has problem. with with private chains. There is an error with Nonce computation.

Development

Dependencies:

  • make
  • git
  • node
  • yarn / npm
  • truffle

Run the following command to setup the environment

make setup-dev

running tests

  • launch ganache-cli with make run-testrpc
  • run the tests with npx truffle test

process

While development lint your code. If you editor doesn't support the solium linter then run:

make watch-linter

Or if you want to lint only before commit:

make lint

Make sure that you commit only tested and linted code:

make lint test

Code verification

Etherscan

We use etherscan to verify the contracts on the mainnet and testnet.

Note: There is an issue with contract deployed using truffle. You have to use verifyContract 2 instead of v1!

Verification