Skip to content

Instantly share code, notes, and snippets.

// ---------------------------------------------------------------------------- //
// GNOSIS SAFE DEPLOYMENT SCRIPT //
// ---------------------------------------------------------------------------- //
import { ethers } from 'ethers'
import EthersAdapter from '@gnosis.pm/safe-ethers-lib'
import SafeServiceClient from '@gnosis.pm/safe-service-client'
import Safe, { SafeFactory, EthSignSignature } from '@gnosis.pm/safe-core-sdk'
import * as dotenv from 'dotenv'
@hrkrshnn
hrkrshnn / generic.org
Last active April 21, 2024 01:51
Some generic writeup about common gas optimizations, etc.

Upgrade to at least 0.8.4

Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!

The advantages of versions 0.8.* over <0.8.0 are:

  • Safemath by default from 0.8.0 (can be more gas efficient than some library based safemath).
  • Low level inliner from 0.8.2, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
@0age
0age / rewardFunction.js
Created September 26, 2018 01:01
Calculate the reward for creating an upgradeable proxy contract with a given efficient address.
#!/usr/bin/env node
var Decimal = require('decimal.js') // $ yarn add decimal.js
// pulling out the big guns (maybe a tad excessive...)
Decimal.config(
{
precision: 500,
toExpNeg: -500
}
)