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
# Lists all contracts that return stack too deep | |
while IFS= read -r -d '' file; do | |
solc $(forge re) "$file" --bin 2>&1 | grep -q "Stack too deep" | |
if [ $? -eq 0 ]; then | |
echo "Stack too deep error found in $file" | |
fi | |
done < <(find . -type f -name "*.sol" -print0) |
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
$ forge test -vvv | |
[⠢] Compiling... | |
[⠒] Compiling 1 files with 0.8.19 | |
[⠆] Solc 0.8.19 finished in 887.23ms | |
Compiler run successful! | |
Running 1 test for test/Counter.t.sol:TestShort_EncodePacked | |
[PASS] test1() (gas: 4373) | |
Logs: | |
462 |
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 Semaphore Trusted Setup Multi-Party Ceremony. | |
The following are my contribution signatures: | |
Circuit: semaphore16 | |
Contributor # 213 | |
Hash: e151caa0 f68c45c9 521936ac 72ea45fa | |
d5f81a81 5635dbc8 0aadb257 b497cdc2 | |
7aca4e2f 41a80f82 0d6166dc 05c855be | |
71f22e19 5f8f7b91 af9fde2e cbe91833 | |
This file has been truncated, but you can view the full file.
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
{ | |
"gas": 122835, | |
"failed": false, | |
"returnValue": "", | |
"structLogs": [ | |
{ "pc": 0, "op": "PUSH1", "gas": 170816, "gasCost": 3, "depth": 1, "stack": [], "memory": [], "storage": {} }, | |
{ | |
"pc": 2, | |
"op": "PUSH1", | |
"gas": 170813, |
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
import { defaultAbiCoder } from '@ethersproject/abi'; | |
import { hexZeroPad, hexStripZeros } from '@ethersproject/bytes'; | |
import { keccak256 } from '@ethersproject/keccak256'; | |
// `defaultAbiCoder.encode` is equivalent to Solidity's `abi.encode()`, and we strip leading zeros from the hashed | |
// value to conform to the JSON-RPC spec: https://ethereum.org/en/developers/docs/apis/json-rpc/#hex-value-encoding | |
// Returns the storage slot for a Solidity mapping from an `address` to a value, given the slot of the mapping itself, | |
// `mappingSlot`. Read more at https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html#mappings-and-dynamic-arrays | |
const getSolidityStorageSlot = (mappingSlot: string, address: string) => { |
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 # 20 | |
Hash: undefined | |
Circuit: batchUst 32 | |
Contributor # 18 | |
Hash: 95e28af0 665f15ed 58d9b69c bece457e | |
a6d318a4 8227d43c 3757a7e1 6a6a77ca |
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
# Ethereum helper methods | |
# source this in your .bashrc or .zshrc file with `. ~/.ethrc` | |
# --- Solidity sandbox --- | |
# https://github.com/maurelian/solidity-sandbox | |
scratch() { | |
dir=$(pwd) | |
cd ~/Documents/projects/solidity-sandbox || exit | |
bash newTest.sh $1 | |
cd "$dir" || exit |
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 ethers = require('ethers'); | |
const { BigNumber } = ethers; | |
(async function () { | |
const provider = ethers.providers.getDefaultProvider(); | |
const multicallAbi = [ { constant: false, inputs: [ { components: [ { internalType: 'address', name: 'target', type: 'address' }, { internalType: 'bytes', name: 'callData', type: 'bytes' }, ], internalType: 'struct Multicall.Call[]', name: 'calls', type: 'tuple[]', }, ], name: 'aggregate', outputs: [ { internalType: 'uint256', name: 'blockNumber', type: 'uint256' }, { internalType: 'bytes[]', name: 'returnData', type: 'bytes[]' }, ], payable: false, stateMutability: 'nonpayable', type: 'function', }, { constant: true, inputs: [{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' }], name: 'getBlockHash', outputs: [{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' }], payable: false, stateMutability: 'view', type: 'function', }, { constant: true, inputs: [], name: 'getCurrentBlockCoinbase', outputs: [{ internalType: 'address', name: 'coinbase', |
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
// Get current block from ganache-cli | |
let block = await web3.eth.getBlock('latest'); | |
// Log initial timestamp -- logs 1535296387 | |
console.log(block.timestamp); | |
// Increase time by a huge amount simply to make it easier to distinguish | |
// between the logged 10-digit numbers (this changes leading digit from a | |
// 1 to a 2) | |
await increaseTime(533868440); |
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
/** | |
* Increase EVM time in ganache-cli to simulate calls in the future | |
* @param integer Number of seconds to increase time by | |
*/ | |
async function increaseTime(integer) { | |
// First we increase the time | |
await web3.currentProvider.send({ | |
jsonrpc: '2.0', | |
method: 'evm_increaseTime', | |
params: [integer], |
NewerOlder