Skip to content

Instantly share code, notes, and snippets.

@ltfschoen
ltfschoen / acala.md
Last active July 30, 2020 10:12
Acala
@ltfschoen
ltfschoen / dash-core-macos.md
Last active June 30, 2020 22:22
dash-core-macos

download latest dashcore-0.15.0.0-osx.dmg and SHA256SUMS.asc from https://github.com/dashpay/dash/releases

verify checksums match

cat SHA256SUMS.asc
shasum -a 256 dashcore-0.15.0.0-osx.dmg

installed to:

@ltfschoen
ltfschoen / litecoin-core-macos.md
Last active June 30, 2020 22:22
litecoin-core-macos
@ltfschoen
ltfschoen / update-lockdrop-like-test-and-use-mxctoken-and-weenus.md
Last active June 22, 2020 11:15
update-lockdrop-like-test-and-use-mxctoken-and-weenus

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

@ltfschoen
ltfschoen / debug-weenus
Created June 21, 2020 14:22
debug-weenus
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
@ltfschoen
ltfschoen / lockdrop-setup.md
Last active June 21, 2020 03:40
lockdrop-setup

Test in Remix

@ltfschoen
ltfschoen / encode_decode_solidity.sol
Last active June 20, 2020 12:47
EncodeAndDecode
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));
}
}
@ltfschoen
ltfschoen / mxc-axs-wallet.md
Last active June 17, 2020 10:22
MXC AXS Wallet

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
@ltfschoen
ltfschoen / flutter.md
Last active August 3, 2020 01:54
flutter-notes.md

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');