- Open MetaMask, connect to Ropsten, and import an account with some Testnet ETH to pay for gas costs
- Go to https://remix.ethereum.org/#appVersion=0.7.7&optimize=false&version=soljson-v0.5.16+commit.9c3226ce.js
- Open the directory and choose all relevant Lockdrop related smart contracts (the ones in this PR https://github.com/DataHighway-DHX/mining/pull/11/files)
- Change all the imports so they are importing from the same browser-based directory:
- i.e. change
import "./lib/ERC20.sol";
toimport "./ERC20.sol";
- i.e. change
- Go to "Compile" > "Start Compile". Fix any compiler errors
- Go to "Run"
- choose Environment "Injected Web3 Ropsten"
- choose Account ""
- choose Gas Limit "3000000"
- choose Value "20" Gwei
- Choose:
- Lockdrop
- Enter for
startTime
:1592493571
(get current Epoch time from https://www.epochconverter.com/) - Click "Transact" button
- Alternatively:
- Paste the address where the Lockdrop contract was deployed to on Ropsten into "At Address"
- Click the "At Address" text button
- Paste the address where the Lockdrop contract was deployed to on Ropsten into "At Address"
- In the MetaMask popup, click to "Edit" the "Gas Price", then click "Advanced", and
enter Gas Price:
42
, and Gas Limit:3339875
- In the "Deployed Contracts" section, click to expand "Lockdrop at 0x...."
Convert the DataHighway Address to Hex and then to Bytes
truffle console --network ropsten --verbose-rpc
const res = web3.utils.utf8ToHex("<DATAHIGHWAY_PUBLIC_KEY")
Note: It doesn't appear necessary to then run web3.utils.hexToBytes(res)
-
In Remix, paste that hex value in value for key
dataHighwayPublicKey
when calling the smart contract. 0x2768fdab1c89b4cfcabd9aff80d87ece0d496a39 -
Transact "signal" function:
- Paste value:
"3","100","0x46765939697a514462737a7a46556b437a65643435547039785062754b4e516e4d563150676b385959444b43573476","0x2768fdab1c89b4cfcabd9aff80d87ece0d496a39"
- OR "signalFromContract":
"0x1f7ace08af5c49a5d69fbb98fb9339a729b27161","1","3","100","0x46765939697a514462737a7a46556b437a65643435547039785062754b4e516e4d563150676b385959444b43573476","0x2768fdab1c89b4cfcabd9aff80d87ece0d496a39"
- Click "transact" button
- Choose 30 Gwei and 75000 Gas Limit
- Successfully works!
- Paste value:
-
Call "signalWalletStructs":
- Paste value:
"0x1f7ace08af5c49a5d69fbb98fb9339a729b27161","0x2768fdab1c89b4cfcabd9aff80d87ece0d496a39"
- Click "call" button
- Success - it returns (if it failed it'd return
0: address[]:
)0: uint8: claimStatus 0 1: uint256: approvedTokenERC20Amount 0 2: uint8: term 3 3: uint256: tokenERC20Amount 100 4: bytes: dataHighwayPublicKey 0x46765939697a514462737a7a46556b437a65643435547039785062754b4e516e4d563150676b385959444b43573476 5: address: contractAddr 0x0000000000000000000000000000000000000000 6: uint32: nonce 0 7: uint256: createdAt 1592554374
- Paste value:
-
transact "setClaimStatus", to Approve it (i.e. "1")
- Paste value:
"0x1f7ace08af5c49a5d69fbb98fb9339a729b27161","1","0x2768fdab1c89b4cfcabd9aff80d87ece0d496a39","1","100"
- Click "transact" button
- SOLVED - it works if replace using
StandardToken token = StandardToken ...
withERC20 token = ERC20 ...
for some reason.
- Paste value:
-
Call "signalWalletStructs" again to check it's Approved with correct amount
- Paste value:
"0x1f7ace08af5c49a5d69fbb98fb9339a729b27161","0x2768fdab1c89b4cfcabd9aff80d87ece0d496a39"
- Click "call" button
- Success - it returns (if it failed it'd return
0: address[]:
)0: uint8: claimStatus 1 1: uint256: approvedTokenERC20Amount 100 ...
- IMPORTANT: Ensure that you have deployed the MXCToken to the
tokenContractAddress
and on the network that you're using (i.e. Ropsten, or Rinkeby). If you try to run the above and enter the wrong ERC20 token (e.g. MXCToken), then the transaction will fail with unknown error
- Paste value:
-
Transact "lock" function:
- Paste value:
"0x1f7ace08af5c49a5d69fbb98fb9339a729b27161","3","100","0x46765939697a514462737a7a46556b437a65643435547039785062754b4e516e4d563150676b385959444b43573476","0x2768fdab1c89b4cfcabd9aff80d87ece0d496a39",false
- Click button "lock" (use at least 600,000 Gas)
- FAILS - when it runs
token.transfer( ...
it crashes in Remix e.g. https://rinkeby.etherscan.io/tx/0x5dce9e2adb20316171d4fc7634c933fd5adebf8cbb04952b02daef0f5244a1cd
- Paste value: