modified Lockdrop.sol with the changes shown in this commit https://github.com/DataHighway-DHX/mining/commit/18c59a2c646633d1687fcba7adc637e7931f8572
so that the Lock contract that it generates is deployed first, and then we deposit or withdraw from it only after providing approval from the ERC20 token by running its approve function (like what Test.sol did)
instead of constructing the contract and performing a deposit before it was possible to grant it permission.
so i deployed Lockdrop.sol to 0x5d030d3f45362f6ccc1f3c29c8cdeb617602d814
i deployed MXCToken (that imports StandardToken) on Rinkeby here: 0x6d8fc9e069f8fbab67a0a93d9cb19d3d16e21ccc
(the same code that MXC used to deploy it to mainnet)
then loaded MXCToken using AtAddress 0x6d8fc9e069f8fbab67a0a93d9cb19d3d16e21ccc
Ran the "lock" function in Lockdrop.sol with arguments: `"0x1f7ace08af5c49a5d69fbb98fb9339a729b27161","3","100","0x46765939697a514462737a7a46556b437a65643435547039785062754b4e516e4d563150676b385959444b43573476","0x6d8fc9e069f8fbab67a0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| i deployed a duplicate of Weenus from my account 0x1f... to 0x2d2c5fdfcc44fb2c9cdaebc468d6cb23a809d5cd | |
| then (using a separate Remix window since different .sol files use different solc versions) | |
| i compiled and deployed Test.sol passing my Weenus contract address as param `0x2d2c5fdfcc44fb2c9cdaebc468d6cb23a809d5cd` | |
| it was deployed to 0x6ccadfd4e2233656e77b41d6c55bc8deb9753497 | |
| then loaded WeenusToken using `AtAddress` 0x2d2c5fdfcc44fb2c9cdaebc468d6cb23a809d5cd | |
| and clicked `approve` using argument "0x6ccadfd4e2233656e77b41d6c55bc8deb9753497, 100", and it's mined successfully | |
| and clicked `balanceOf` using argument of my address "0x1f7ace08af5c49a5d69fbb98fb9339a729b27161" and it showed i had 1000 WEENUS | |
| then loaded Test using `AtAddress` 0x6ccadfd4e2233656e77b41d6c55bc8deb9753497 | |
| clicked `depositTokens` using argument `1` | |
| and it transfers 1 WEENUS from my account to the Weenus contract. It works in this tx https://rinkeby.etherscan.io/tx/0x27e5d5cf2d5dea6fda463fd378726dbb51a891ed96d69399569783a72cd87921 |
- 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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.5.16; | |
| contract EncodeAndDecode { | |
| function encode() public view returns(bytes memory hash) { | |
| return abi.encode(msg.sender, bytes("0xF785DaB2Cd075dC0a8011249357f2332972319fd")); | |
| } | |
| function decode(bytes memory hash) public view returns(address a, bytes memory b) { | |
| (a,b) = abi.decode(hash, (address, bytes)); | |
| } | |
| } |
Terminal Window 1: Install Node Version Manager (NVM) and run the following:
nvm install v10.16.0 &&
nvm use v10.16.0 &&
yarn install &&
yarn run generate:typedefs &&
yarn run check:code &&
yarn run premigrate &&
npm install -g truffle ganache-cli
https://flutter.dev/docs/get-started/install/macos
-
Download Flutter for macOS
-
Extract
cd ~/development
unzip ~/Downloads/flutter_macos_v1.12.13+hotfix.9-stable.zip
mkdir -p $HOME/development
mv ./flutter $HOME/development/
Different ways to decode/encode a Substrate public keys (i.e. using bs58 li8brary, and using Polkadot.js util-crypto library)
$ node
const bs58 = require('bs58');
const keyring = require('@polkadot/keyring');
const { decodeAddress, encodeAddress } = require('@polkadot/util-crypto');
Automate screen recording on macOS
- https://forums.macrumors.com/threads/automated-screen-recording-at-a-certain-time.1642238/
- https://apple.stackexchange.com/questions/63056/can-applescript-be-used-to-automate-a-screen-recording-session-on-os-x
- https://gist.githubusercontent.com/neerajcse/4989886/raw/49b603d4bd3d3db9dc15f296b2a528cb7a1740ed/record_screen.sh
- https://smallbusiness.chron.com/schedule-automator-tasks-mac-os-x-39132.html
http://tug.org/mactex/mactex-download.html
brew cask install tex-live-utility
brew cask install basictex
brew install pandoc pandoc-citeproc
Restart terminal