0x112591b44eb497c090906f7ce9364b7e87032361d3c87c1c3859dbcd6d6199fb
Hey, I'm fvictorio-417134 and I have contributed to the MACI v2 Trusted Setup Ceremony. | |
The following are my contribution signatures: | |
Circuit # 1 (processmessages_14-9-2-3) | |
Contributor # 178 | |
Contribution Hash: | |
bcc7f1a5 b5132d09 973ff9b8 fd07132c | |
1fb25864 8ae380ed 4a5ab17a e90a2fbc | |
cd00f6a8 042d8a8f ce5807ab 1ef7e02b | |
cadafe50 0f62a0a1 4cf0b40c 4cfec9e5 |
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony. | |
The following are my contribution signatures: | |
Circuit: semaphore21 | |
Contributor # 276 | |
Hash: d34ba9f2 cf5e71d9 1d45de28 be8e7e2c | |
735b0eb5 78856068 d7c98ff6 250b0105 | |
646ef731 4395f2dd 79791bd1 ad97d3f1 | |
08cc6ac7 cff6e9e9 1047456f f8401dfa | |
I contributed to the clr.fund Trusted Setup Multi-Party Ceremony. | |
The following are my contribution signatures: | |
Circuit: qvt32 | |
Contributor # 824 | |
Hash: 0cdf0d0c b6a60a34 3a4c53f5 cd2180b5 | |
d68db68c b42057be ca2cba53 60258e2d | |
e4552fea a0418a5b f1d1635e e7622835 | |
bba9a0a5 14d54529 77ba64c1 36333bfa | |
tl;dr You are not using an archive node. Explanation below.
When you fork a Network with Hardhat, you are forking it from a given block number. If you don't specify one, the latest block will be used (minus N, where N is chosen to prevent reorgs messing with the fork).
Hardhat will use the node to fetch the data it needs. When you ask for data in a node, you are asking about the data at some specific block. If you are forking from the latest block, then you'll be able to get this data even if the node you are using is not an archive node. But after some minutes, this block you forked will become old enough for the node to stop having historical information about it, and you'll start getting the "Missing trie node".
To fix this, use an archive node or a provider like Alchemy.
{ | |
"gas": 66333, | |
"failed": false, | |
"returnValue": "00000000000000000000000000000000000000775c9b2954b075692132e652e2d2f143e850f67d00000000000000000000000000000000000000000000000000", | |
"structLogs": [ | |
{ | |
"pc": 0, | |
"op": "ADDRESS", | |
"gas": 96632, | |
"gasCost": 2, |
If you want to fund your accounts with some token (for example DAI) after forking mainnet, there are two things you can try.
One is to impersonate an account that has that token, and either use that address or send tokens from it to one of your test accounts. For example:
const [signer] = await ethers.getSigners()
// impersonate account; replace with an address that actually has your token
const addressWithTokens = "0x49a77c5703e877759307175756E6EFDb3669ed77"
await network.provider.send("hardhat_impersonateAccount", [addressWithTokens])
If you want to test a contract that depends on other contract, but you don't own the latter contract (or you do but you want to test the first contract in isolation), you need to either stub or mock that dependency.
If you are not sure about the difference between a stub and a mock, check this StackOverflow question
If the contract you are testing receives its dependency in some way, you can write a stub contract and use that in your tests. It would be something like this:
contract ContractToTest {
const cbor = require('cbor') | |
const bytecode = '70656e6420696e707574206e6f7465415a54454320617272617920696e646578206973206f7574206f6620626f756e6473a265627a7a7231582011639b922cf661bed862dc70ef7a0a62211ae58261383916450efb20b2fd6a4164736f6c63430005100032' | |
// last two bytes are 0032, interpreted in hex is 50, so length in hex is 100 | |
// the metadata bytes are the last 100 chars, excluding the last 4 which are the size | |
const metadata = bytecode.slice(bytecode.length - 104, bytecode.length - 4) | |
const { solc } = cbor.decode(metadata) |