Skip to content

bcExpt1123/presale-contract-truffle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Presale contract

Contracts (deployed in mainnet)

TON

SEED SALE

PRIVATE SALE

STRATEGIC SALE

Marketing TON

Other tokens

ETC

Contracts (deployed in rinkeby)

token:
    "VestingTokenAddress1":"0xe7416e9286188AC82E8bc0987fFc639D95437Eb9", swap rate : 1
    "VestingTokenAddress2":"0xBc7bE5d4E4fFa69AFC560C02F1C62213d7401013", swap rate : 2
    "VestingTokenAddress3":"0xB291b498127Bcc4DA5521F942e4a3960c3Cf09Fd", swap rate : 3
    "VestingTokenAddress4":"0x67378C8Cd3EB79d73E3301079cfc5569bB41eE10", swap rate : 4
    "VestingTokenAddress5":"0x90b976D0e896d7A71ab41014b916126966118d5f", swap rate : 5
    "VestingTokenAddress6":"0x585C5C25d22695323DC976990D3c6d2c252c9112", swap rate : 6
    "TON":"0xE21cd01Eef5fa0347301b7F9299c6dba5A990519",
    "Swapper":"0x0B54E043c847a900f7bA8a945AAe95C26E9998E2"

address: 
    "owner": "0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39",
    "holder1": "0x6704Fbfcd5Ef766B287262fA2281C105d57246a6",
    "holder2": "0x9E1Ef1eC212F5DFfB41d35d9E5c14054F26c6560",
    "holder3": "0xce42bdB34189a93c55De250E011c68FaeE374Dd3",
    "holder4": "0x97A3FC5Ee46852C1Cf92A97B7BaD42F2622267cC",
    "holder5": "0xB9dcBf8A52Edc0C8DD9983fCc1d97b1F5d975Ed7",
    "holder6": "0x26064a2E2b568D9A6D01B93D039D1da9Cf2A58CD",
    "holder7": "0xe84Da28128a48Dd5585d1aBB1ba67276FdD70776",
    "holder8": "0xCc036143C68A7A9a41558Eae739B428eCDe5EF66",
    "holder9": "0xE2b3204F29Ab45d5fd074Ff02aDE098FbC381D42"

address: private-key
    "0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501200"
    "0x6704Fbfcd5Ef766B287262fA2281C105d57246a6": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501201"
    "0x9E1Ef1eC212F5DFfB41d35d9E5c14054F26c6560": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501202"
    "0xce42bdB34189a93c55De250E011c68FaeE374Dd3": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501203"
    "0x97A3FC5Ee46852C1Cf92A97B7BaD42F2622267cC": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501204"
    "0xB9dcBf8A52Edc0C8DD9983fCc1d97b1F5d975Ed7": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501205"
    "0x26064a2E2b568D9A6D01B93D039D1da9Cf2A58CD": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501206"
    "0xe84Da28128a48Dd5585d1aBB1ba67276FdD70776": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501207"
    "0xCc036143C68A7A9a41558Eae739B428eCDe5EF66": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501208"
    "0xE2b3204F29Ab45d5fd074Ff02aDE098FbC381D42": "0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501209"

Period

start cliff_duration duration
0xe7416e9286188AC82E8bc0987fFc639D95437Eb9 o x x
0xBc7bE5d4E4fFa69AFC560C02F1C62213d7401013 o o x
0xB291b498127Bcc4DA5521F942e4a3960c3Cf09Fd o o o
0x67378C8Cd3EB79d73E3301079cfc5569bB41eE10 o z o
0x90b976D0e896d7A71ab41014b916126966118d5f o z x
0x585C5C25d22695323DC976990D3c6d2c252c9112 x x x

column info(see also the below period information part) :

  • "o" means that the time has passed already.
  • "z" in cliff_duration means the cliff duration of the token is zero.
  • "x" means that the time has not passed yet.

Building testing environment

Run test script to build testing environment. Features include:

  • Run ganache-cli

  • Setup test addresses to use

  • Deploy necessory contracts All token is deployed by owner(0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39).

    • 5 pre-sale *TON tokens. Each address has each token as shown below.

    owner 0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39

    1 2 3 4 5 6
    holder1 0x6704Fbfcd5Ef766B287262fA2281C105d57246a6 o o o o o o
    holder2 0x9E1Ef1eC212F5DFfB41d35d9E5c14054F26c6560 o o o o o
    holder3 0xce42bdB34189a93c55De250E011c68FaeE374Dd3 o o o o
    holder4 0x97A3FC5Ee46852C1Cf92A97B7BaD42F2622267cC o o o
    holder5 0xB9dcBf8A52Edc0C8DD9983fCc1d97b1F5d975Ed7 o o
    holder6 0x26064a2E2b568D9A6D01B93D039D1da9Cf2A58CD o o o o
    holder7 0xe84Da28128a48Dd5585d1aBB1ba67276FdD70776 o o o
    holder8 0xCc036143C68A7A9a41558Eae739B428eCDe5EF66 o o
    holder9 0xE2b3204F29Ab45d5fd074Ff02aDE098FbC381D42 o
    • TON token.
    • Swapper token. It has 10,000 TON.

Requirements

Setup

$ npm install

External repository

  • Compiled TON token file in plasma-evm-contracts
$ cd plasma-evm-contracts && truffle compile && cd -

Testing

$ npm run-script test_daemon

Ethereum network information

development_daemon: {
  host: 'localhost',
  port: 8545,
  network_id: '*',
  from: '0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39',
}

Files

test_accounts.json : address information.

{
    "owner": "0xDf08F82De32B8d460adbE8D72043E3a7e25A3B39",
    "holder1": "0x6704Fbfcd5Ef766B287262fA2281C105d57246a6",
    "holder2": "0x9E1Ef1eC212F5DFfB41d35d9E5c14054F26c6560",
    "holder3": "0xce42bdB34189a93c55De250E011c68FaeE374Dd3",
    "holder4": "0x97A3FC5Ee46852C1Cf92A97B7BaD42F2622267cC",
    "holder5": "0xB9dcBf8A52Edc0C8DD9983fCc1d97b1F5d975Ed7",
    "holder6": "0x26064a2E2b568D9A6D01B93D039D1da9Cf2A58CD",
    "holder7": "0xe84Da28128a48Dd5585d1aBB1ba67276FdD70776",
    "holder8": "0xCc036143C68A7A9a41558Eae739B428eCDe5EF66",
    "holder9": "0xE2b3204F29Ab45d5fd074Ff02aDE098FbC381D42"
}

deployed.json : Deployed contract address information. This is generated after token deployment.
ex)

{"VestingTokenAddress1":"0x0f5Ea0A652E851678Ebf77B69484bFcD31F9459B","VestingTokenAddress2":"0x6732c278C58FC90542cce498981844A073D693d7","VestingTokenAddress3":"0x5baB00b1582B170DBAE7557586A29BA9EeA6f55b","VestingTokenAddress5":"0x3d627fE11843eF6b3D5EC6683D53BD9822696Ef6","TON":"0x254C1eAE847823B664D1Acb1BdfE5e19172D8336","Swapper":"0x7DCC8D20Ff08A8cd50464544139aF34abC1384fB"}

Information

releasableAmount result

  • before initiate(before a) : 0
  • after initiate, before start(a~b) : 0
  • after start, before cliff(b~c) : 0
  • after start, zero cliff, before duration(before d, b~c period is zero) : vested_amount * (block_timestamp - start_timestamp) / duration - released_amount
  • after cliff, before duration(c~d) : vested_amount * (block_timestamp - start_timestamp) / duration - released_amount
  • after duration(after d) : vested_amount - released_amount

alt text