This smart contract implements a token staking service. Two types of tokens are involved in the staking service: (1) Contribution Token and (2) Reward Token. When a user deposits his or her Contribution Tokens to our smart contract, the user can earn Reward Tokens relative to the deposited amount and the length of deposit. Both the Contribution Tokens and Reward Tokens are ERC-20 tokens.
npm install truffle -g
truffle compile
contracts
├── DistributionModelV3.sol
├── ERC20.sol
└── module
├── eventModule.sol
├── externalModule.sol
├── internalModule.sol
├── safeMath.sol
├── storageModule.sol
└── viewModule.sol
docs
├── distribution-model-contract.pdf
├── reward-distribution-model-ver-1.0.pdf
├── theori-audit-rev-1.0.pdf
└── theori-audit-rev-2.0.pdf
contracts
: solidity contractscontracts/DistributionModelV3
: Model wrapper contractcontracts/ERC20.sol
: ERC20 mockupcontracts/module/eventModule.sol
: Define eventscontracts/module/externalModule.sol
: Implements external function for users action and admincontracts/module/internalModule.sol
: Implements interanl function for model logicscontracts/module/safeMath.sol
: Implements safe-math for uint256 and fixed point calculationcontracts/module/storageModule.sol
: Define contract storagecontracts/module/viewModule.sol
: Implements view function for support front-enddocs
: Documentdocs/distribution-model-contract.pdf
: Documents for contract implementationsdocs/reward-distribution-model-ver-1.0.pdf
: Document for rewarding algorithmsdocs/theori-audit-rev-1.0.pdf
: Audit review of Theoridocs/theori-audit-rev-2.0.pdf
: Audit revision of Theori