Skip to content

m10io/tokeninc-smart-contracts

Repository files navigation

Token, Inc. Smart Money -- Solidity Smart Contracts Documentation

Token Smart Money

Solidity Smart Contract Architecture

Overview

The Token Smart Money (TSM) System allows for integration with several payment services and platforms. This document covers the Ethereum smart contracts architecture, provides a discussion of TSM services and fees, and discusses associated Ethereum transaction costs.

The purpose of the TSM smart contracts are to provide depository tokens that can be backed 1:1 with fiat currency held by a currency issuer, bank, or other authorized financial institution.

Token fiat currency tokens are ERC20 compliant and have an extensible storage contract to allow for future interoperability with third party systems, and to provide various financial services (e.g. currency exchange, escrow, etc.) through smart contract interfaces.

The TSM system is designed to be peer-to-peer (p2p) and business-to-business (b2b), with limited involvement of third party intermediaries.

The TSM Ethereum contracts will be deployed on the Ethereum main network. Consequentially, to interact with the TSM system on Ethereum, there is a cost that is paid to the network maintainers (i.e. transaction miners). This cost can either be paid directly by the participants in the system (institutions and end-users alike) or the cost can be paid through a proxied signing service that Token will charge a fee for.


Developer Guide

Contract Deployment Process

The deployment process is different for the development and production releases of the smart contracts.

When developing the smart contracts, this repository uses truffle develop (npm run dev) local network to deploy, test, and interact with smart contracts.

Truffle has a migration process, truffle migrate, which deploys contract sequences using a migration script, located in the /migrations folder in the root of this repository.

The default script, /migrations/1_initial_migration.js, is used internally by Truffle to keep track of the contracts deployed to the network using a Migrations.sol contract. By default, this file should not be altered.

The remaining scripts in the /migrations folder are used to deploy the smart contracts in a sequence. The deployment sequence of these contracts is important!

Running the command: (console)> migrate --reset will deploy the scripts in the sequence corresponding to the pre-fixed number. However, if you need to deploy a specific smart contract, (console)> migrate -f # is available1 where # is the number of the script to be deployed.

(E.g. (console)> migrate -f 2 is to deploy 2_deploy_contracts.js)

Unit Tests

In the Truffle console, run all tests:

(console)> test

Alternatively, run a single test:

(console)> test ./test/<name_of_contract>.js


Deployed Contract Addresses

The following contracts have been deployed at the associated addresses corresponding to the Ethereum network deployed on.

Ethereum Main Network:


Interacting with TokenIO Contracts

TokenIO provides mobile and web client applications to interact with smart contracts.

Alternatively, if you're a software developer, TokenIO contracts can be interacted with using the TokenIO JS Smart Contract SDK.


Links To Smart Contract NatSpec Documentation


Links to Smart Contract Source Code


Smart Contract Use Cases


Audit Report


Footnotes

1 trufflesuite/truffle#886


VERSION: v0.1.3 DISCLOSURE: This document is intended for notes, documentation, and discussion for how the source code is written at a certain software version. Token, Inc. do not guarantee the correctness of this software or the accuracy of this documentation and is not held liable for any misinterpretation, unintentional use or misuse of the software. Token, Inc. will actively identify and resolve to the best ability, within reasonable limit, any known software limitations, bugs, or other vulnerabilities that might impact this software.

COPYRIGHT 2018 Token, Inc.

About

Ethereum Solidity Smart Contracts for Token, Inc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published