Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Anderson Chen Ankarrr

🎯
Focusing
View GitHub Profile
View alchemy-web3-setprovider.js
// Create web3 instance
export const alchemyWeb3 = createAlchemyWeb3(currentHttpProvider, {
maxRetries: 5,
retryJitter: 250,
});
// Do something
// Reset the provider
// alchemyWeb3.setProvider(newProvider);
View gonsis-safe-abi.json
[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"AddedOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"approvedHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"ApproveHash","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"masterCopy","type":"address"}],"name":"ChangedMasterCopy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"threshold","type":"uint256"}],"name":"ChangedThreshold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract Module","name":"module","type":"address"}],"name":"DisabledModule","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract Module","name":"module","type":"address"}],"name"
View usdc-abi.json
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_account","type":"address"}],"name":"unBlacklist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"minter","type":"address"}],"name":"removeMinter"
View uToken-test-abi.json
[
{
"inputs": [],
"name": "accrueInterest",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
View DTokenInterface.json
{
"contractName": "DTokenInterface",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "minter",
View deploy_proxy_contract_execute_erc20.js
/**
* Goal
* - Deploy a proxy contract and exexute a tx to send erc20 token from proxy contract
* - Proxy contract doesn't need to pay gas fee
*
* Ehereum node
* - Using Rinkeby testnet
*/
const ethers = require('ethers');
View delegateExecute.js
import { ethers } from 'ethers';
const priKey = '';
// Contract info
const personalWalletAddress = '0x4378Faec5cCfCC6B9E1A8174435eB4354398EDdd';
// eslint-disable-next-line object-curly-newline
const personalWalletAbi = [{ constant: false, inputs: [ { name: '_to', type: 'address[]' }, { name: '_value', type: 'uint256[]' }, { name: '_idx', type: 'uint256[]' }, { name: '_data', type: 'bytes' }, { name: '_nonce', type: 'uint256' }, { name: '_v', type: 'uint8' }, { name: '_r', type: 'bytes32' }, { name: '_s', type: 'bytes32' } ], name: 'batchDelegateExecute', outputs: [], payable: false, stateMutability: 'nonpayable', type: 'function' }, { constant: false, inputs: [ { name: '_to', type: 'address[]' }, { name: '_value', type: 'uint256[]' }, { name: '_idx', type: 'uint256[]' }, { name: '_data', type: 'bytes' } ], name: 'batchExecute', outputs: [], payable: false, stateMutability: 'nonpayable', type: 'function' }, { constant: false, inputs: [ { name: '_to', type: 'address' }, { name: '_value', type: 'uint256' }, {
View personlWallet-test.js
import { ethers } from 'ethers';
import web3 from 'web3-utils';
const priKey = 'xxxxx';
const personalWalletAddress = '0xC1Ad71338509982d1E5738CfC09F5975B5c7d9fd';
// eslint-disable-next-line object-curly-newline
const personalWalletAbi = [{ constant: false, inputs: [ { name: '_to', type: 'address[]' }, { name: '_value', type: 'uint256[]' }, { name: '_idx', type: 'uint256[]' }, { name: '_data', type: 'bytes' }, { name: '_nonce', type: 'uint256' }, { name: '_v', type: 'uint8' }, { name: '_r', type: 'bytes32' }, { name: '_s', type: 'bytes32' } ], name: 'batchDelegateExecute', outputs: [], payable: false, stateMutability: 'nonpayable', type: 'function' }, { constant: false, inputs: [ { name: '_to', type: 'address[]' }, { name: '_value', type: 'uint256[]' }, { name: '_idx', type: 'uint256[]' }, { name: '_data', type: 'bytes' } ], name: 'batchExecute', outputs: [], payable: false, stateMutability: 'nonpayable', type: 'function' }, { constant: false, inputs: [ { name: '_to', type: 'address' }, { name: '_value', ty
View EIP712Dapp-4.sol
pragma experimental ABIEncoderV2;
pragma solidity ^0.5.0;
contract Verifier {
mapping (address => uint) public smiles;
mapping (address => uint) public nods;
function nod(address nodder, uint nodNum, uint nodMultiplier) public {
nods[nodder] = nods[nodder]*nodMultiplier + nodNum;
}
You can’t perform that action at this time.