Skip to content

Instantly share code, notes, and snippets.

View e00dan's full-sized avatar

e00dan

View GitHub Profile
@e00dan
e00dan / gist:d6c519838ea2a53cc47798cc2dda548c
Created August 11, 2022 10:59
Godwoken Mainnet v1 Gnosis Safe v1.3.0 deployment
➜ safe-contracts git:(main) ✗ yarn deploy-custom
yarn run v1.22.19
$ rm -rf deployments/custom && yarn deploy-all custom
$ hardhat deploy-contracts --network custom
Nothing to compile
deploying "SimulateTxAccessor" (tx: 0x869e31990790ab2788f1db4441c9e0cf90f799837d56a935c17cbbd602883954)...: deployed at 0x4d71a6c0D22F7626e5fD84afe755dcf487402521 with 67871 gas
deploying "GnosisSafeProxyFactory" (tx: 0xa5947a2e6b3180056ebcd9dd6acca1a67a7a3d40793edf287ad1a86793105e80)...: deployed at 0x4Df7456E32E367C490EF5Bf5fd86Bde7c3eD352B with 112782 gas
deploying "DefaultCallbackHandler" (tx: 0x39f4da9f530afac9ea9a6c6ca41902683da095b67dd1ff6e70ef71bc7f7b2370)...: deployed at 0x644107bE6DBB9061AB6B4eb4922dbb6821186D45 with 88673 gas
deploying "CompatibilityFallbackHandler" (tx: 0x3174674f8d61f117d7ea5e9612365737a5bf307f7892360dc952eb88dbeeaf6e)...: deployed at 0x1f1Eb32F9C89D06C92cCAf8A612e45f1019A851a with 139695 gas
deploying "CreateCall" (tx: 0xc67a0a527e84b5d5e84d18720ee1a5a453654dd7dc9e462f354545219eae22f5)...: deploy
{
"language": "Solidity",
"sources": {
"contracts/ERC20.sol": {
"content": "pragma solidity ^0.5.2;\n\nimport \"./IERC20.sol\";\nimport \"./SafeMath.sol\";\n\n/**\n * @title Standard ERC20 token\n *\n * @dev Implementation of the basic standard token.\n * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md\n * Originally based on code by FirstBlood:\n * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol\n *\n * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for\n * all accounts just by listening to said events. Note that this isn't required by the specification, and other\n * compliant implementations may not do it.\n */\ncontract ERC20 is IERC20 {\n using SafeMath for uint256;\n\n mapping (address => uint256) private _balances;\n\n mapping (address => mapping (address => uint256)) private _allowed;\n\n uint256 private _totalSupply;\n\n /**\n * @dev Total number o
import BigNumber from 'bignumber.js/bignumber';
import abiLibrary from 'lib/abi';
const daoAddress = process.env.DAO_ADDRESS || '';
const tributeToken = process.env.TRIBUTE_TOKEN_ADDRESS;
const paymentToken = process.env.TRIBUTE_TOKEN_ADDRESS;
const getDao = async (address: string) => {
const dao = await new web3.eth.Contract(abiLibrary.moloch2, address);
➜ nervos-testing git:(fix/eip155) npx truffle migrate --network ckb_testnet
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'ckb_testnet'
{
"name": "Godwoken Testnet",
"logoURI": "https://raw.githubusercontent.com/compound-finance/token-list/master/assets/compound-interface.svg",
"keywords": [
"defi"
],
"timestamp": "2021-05-27T20:37:00.000+00:00",
"tokens": [
{
"chainId": 868455272153094,
{
"name": "Godwoken Testnet",
"logoURI": "https://raw.githubusercontent.com/compound-finance/token-list/master/assets/compound-interface.svg",
"keywords": [
"defi"
],
"timestamp": "2021-05-27T20:37:00.000+00:00",
"tokens": [
{
"chainId": 868455272153094,
{"jsonrpc":"2.0","id":3164057,"method":"send_transaction","params":[{"version":"0x0","cell_deps":[{"out_point":{"tx_hash":"0xb4b07dcd1571ac18683b515ada40e13b99bd0622197b6817047adc9f407f4828","index":"0x0"},"dep_type":"code"},{"out_point":{"tx_hash":"0x8542d5c3db8ec8657dd9f84bcb34fb02b8fe7bf6d3f04bda9d24946d15212620","index":"0x0"},"dep_type":"code"},{"out_point":{"tx_hash":"0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37","index":"0x0"},"dep_type":"dep_group"},{"out_point":{"tx_hash":"0x9154df4f7336402114d04495175b37390ce86a4906d2d4001cf02c3e6d97f39c","index":"0x0"},"dep_type":"code"}],"header_deps":[],"inputs":[{"since":"0x0","previous_output":{"tx_hash":"0xe0459eefbee135ac23194a094c2cf84665f3eb6ae4ddf2ef0cf3c0c9f5f392b3","index":"0x3"}},{"since":"0x0","previous_output":{"tx_hash":"0xcb3c0bb20ae840ff96612553dc842f0cfbf67afe2d95569f5d59362e6d545ea9","index":"0x0"}}],"outputs":[{"capacity":"0x9502f9000","lock":{"code_hash":"0x79f90bb5e892d80dd213439eeab551120eb417678824f282b4ffb5f21bad2e1e",
import Web3 from "web3";
import { PolyjuiceHttpProvider } from "@polyjuice-provider/web3";
import { AddressTranslator } from "nervos-godwoken-integration";
import { Address, AddressType, default as PWCoreDefault, IndexerCollector, RawProvider, SUDT } from "@lay2/pw-core";
const PWCore = PWCoreDefault.default;
const ETHEREUM_ADDRESS = '0xD173313A51f8fc37BcF67569b463abd89d81844f';
const layer1Address = new Address('ckt1qyq9u5vzgtklnqrr6cevra7w2utrsxmjgefs72sfju', AddressType.ckb);
const { existsSync } = require('fs');
const Web3 = require('web3');
const { PolyjuiceHttpProvider, PolyjuiceAccounts } = require("@polyjuice-provider/web3");
const polyjuiceConfig = {
web3Url: 'https://godwoken-testnet-web3-rpc.ckbapp.dev'
};
const provider = new PolyjuiceHttpProvider(
####[mode]
MANUAL_BUILD_GODWOKEN=false
MANUAL_BUILD_WEB3=false
MANUAL_BUILD_SCRIPTS=false
MANUAL_BUILD_POLYJUICE=false
MANUAL_BUILD_CLERKB=false
MANUAL_BUILD_POLYMAN=false
####[images]
DOCKER_PREBUILD_IMAGE_NAME=nervos/godwoken-prebuilds