0x0acb799a01e250a6a46bc361f07ccca41d9c512168cf48e6613272ed1e427be5
This file contains 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
//SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.0 <0.9.0; | |
// Useful for debugging. Remove when deploying to a live network. | |
//import "hardhat/console.sol"; | |
// Use openzeppelin to inherit battle-tested implementations (ERC20, ERC721, etc) | |
// import "@openzeppelin/contracts/access/Ownable.sol"; | |
/** | |
* A smart contract that allows changing a state variable of the contract and tracking the changes |
This file contains 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 contributed to the clr.fund Trusted Setup Multi-Party Ceremony. | |
The following are my contribution signatures: | |
Circuit: qvt32 | |
Contributor # 117 | |
Hash: 4706209d 798aa8d9 b307094d 815740b3 | |
50e3800a c6b77c35 537cf6a6 a6c84282 | |
c3931d3c 1a11b335 e7a853fe 815122e2 | |
d2a91f3a d998b83e fa524202 aebcf307 | |
This file contains 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
0. (Probably already done right?) Install MetaMask in chrome and fund your wallet with ETH. | |
deliverable) post your address in the channel or screenshot | |
1. Swap ETH to DAI using uniswap.io and your MetaMask | |
deliverable) etherscan.io transaction link to the token transfer | |
bonus) can you explain the difference between ETH and DAI? |
This file contains 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
const fs = require('fs'); | |
const chalk = require('chalk'); | |
async function main() { | |
let contractList = fs.readdirSync("./artifacts") | |
for(let c in contractList){ | |
if(contractList[c].indexOf(".json")>=0){ | |
const name = contractList[c].replace(".json","") | |
const contractArtifacts = artifacts.require(name); | |
const contract = await contractArtifacts.new() | |
console.log(chalk.cyan(name),"deployed to:", chalk.magenta(contract.address)); |
This file contains 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
const { usePlugin } = require('@nomiclabs/buidler/config') | |
usePlugin("@nomiclabs/buidler-truffle5"); | |
const DEBUG = true | |
task("accounts", "Prints the list of accounts", async () => { | |
const accounts = await web3.eth.getAccounts(); | |
for (const account of accounts) { | |
console.log(account); | |
} |
This file contains 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
const fs = require('fs'); | |
const Web3 = require('web3'); | |
const web3 = new Web3("http://localhost:8545"); | |
const filename = "account.json" | |
if (fs.existsSync(filename)) { | |
console.log(filename+" already exists (delete it to create a new account)") | |
}else{ | |
let account = web3.eth.accounts.create(); | |
console.log(filename,account) |
This file contains 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
#!/bin/bash | |
sudo apt install golang-go -y | |
chmod 0777 /home/nuc/*.log | |
sudo apt-get install -y build-essential | |
cd /home/nuc/go-ethereum; git pull > /home/nuc/pull.log; make geth > /home/nuc/make.log | |
/home/nuc/go-ethereum/build/bin/geth version > /home/nuc/geth.log 2>&1 | |
/home/nuc/go-ethereum/build/bin/geth --allow-insecure-unlock --cache=4096 --maxpeers=50 --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --rpcapi="db,eth,net,web3,personal,admin,debug,miner,txpool" >> /home/nuc/geth.log 2>&1 & | |
bash <(curl https://get.parity.io -Lk) | |
cd /home/nuc/;su - nuc -c 'parity --chain poa-chain-spec/spec.json --reserved-peers poa-chain-spec/bootnodes.txt --ports-shift=10 --jsonrpc-hosts=all --jsonrpc-interface=all --jsonrpc-cors=all --no-warp' >> /home/nuc/parity-xdai.log 2>&1 & |
This file contains 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
let messageBuffer = {} | |
module.exports = (web3)=>{ | |
let burnerWeb3 = web3 | |
var iframe = document.createElement('iframe') | |
iframe.style.opacity = 0.9 | |
iframe.style.position = "absolute" | |
iframe.style.width = "300px" |
This file contains 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
var ethers = require('ethers'); | |
var fs = require('fs'); | |
var Wallet = ethers.Wallet; | |
//usage: node craft.js ABI_FILE BYTECODE_FILE GAS_LIMIT GAS_PRICE [...CONSTRUCTOR ARGUMENTS] | |
//node craft.js "../Sweeper/Sweeper.abi" "../Sweeper/Sweeper.bytecode" 250000 100000000000 (cat ../Loan/Loan.address) (cat ../SomeCoin/SomeCoin.address) 1 | |
const wallet = ethers.Wallet.createRandom(); | |
let httpProvider = new ethers.providers.JsonRpcProvider(); | |
let abi = fs.readFileSync(process.argv[2]).toString() | |
let bytecode = fs.readFileSync(process.argv[3]).toString() | |
let factory = new ethers.ContractFactory(abi, bytecode, wallet); |
NewerOlder