5 A simple deposit and profit bytom dapp demo, Bytom-Chrome-Extension needed before it can be used.
9 Make sure you have the NodeJs installed before you started.
10 start the webpack dev server:
15 Your server should now be running at http://127.0.0.1:8080
17 ### Contract configuration
18 Network and smart contract control program's constants configurations are stored under the `contracts/configure.json.js` file.
19 You may edit the configure after an new control program is launched.
21 *Note: Currently we are manually deploy the contract using the [equity compiler tool](https://github.com/Bytom/equity), and configure the constants accordingly.
23 ### Input and Output Object
24 Since the contract type and logic are different, building the unlock action may be different.
27 if amountDeposited < billAmount {
28 lock amountDeposited of assetDeposited with FixedLimitProfit(billAsset, totalAmountBill, totalAmountCapital, expireBlockHeight, additionalBlockHeight, banker, bankerKey)
29 lock amountDeposited of billAsset with saver
30 lock billAmount-amountDeposited of billAsset with FixedLimitCollect(assetDeposited, totalAmountBill, totalAmountCapital, dueBlockHeight, expireBlockHeight, additionalBlockHeight, banker, bankerKey)
32 lock amountDeposited of assetDeposited with FixedLimitProfit(billAsset, totalAmountBill, totalAmountCapital, expireBlockHeight, additionalBlockHeight, banker, bankerKey)
33 lock billAmount of billAsset with saver
36 Will need to be converted into
38 if(amount < billAmount){
39 output.push(controlProgramAction(amount, GetContractArgs().assetDeposited, GetContractArgs().profitProgram))
40 output.push(controlAddressAction(amount, billAsset, address))
41 output.push(controlProgramAction((BigNumber(billAmount).minus(BigNumber(amount))).toNumber(), billAsset, GetContractArgs().depositProgram))
43 output.push(controlProgramAction(amount, GetContractArgs().assetDeposited, GetContractArgs().profitProgram))
44 output.push(controlAddressAction(billAmount, billAsset, address))
48 ## Building the Project