I hereby claim:
- I am qd-qd on github.
- I am qdqd (https://keybase.io/qdqd) on keybase.
- I have a public key whose fingerprint is 4028 6901 E0CC 8408 4D0C CB48 FF52 7DD6 9A95 D50E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
This RPC call works great when using a bundler not managed by Alchemy. However, an error is triggered when using your bundler.
cast rpc eth_estimateUserOperationGas "{\"sender\":\"0x80b86933313237be38B9E87dDbe99865A12c8ddd\",\"nonce\":\"0x0\",\"initCode\":\"0x29e69af6083f790d31804ed9adad40ccc32accc9af09872500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000120728da5b63228c33d0f2e2797ee87fda099a2795a31831d5e8f406a4a8be80ad4000000000000000000000000000000000000000000000000000000000000009849960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97635d00000000fbfc3007154e4ecc8c0b6e020557d7bd0014f4da2a72a853013e7a71eab983e798c0d3e190c6a5010203262001215820551be8f48a4b2d77a8cf8fe565fd8644c77f44aef04099b6764acf668a5dea0f225820e92de8f6a8d71246b08f68a8cfc10de82ee97f51b4cd585d978a1097931fc7720000000000000000000000000000000000000000000000000000000000000000000000000000004200f7aabdbddb526bb02fc3a1138ae375236d229c571509109d5ba7d5dd1591c6c058c
contract Deployer { | |
event Deployed(address); | |
// This is the runtime code of the contract we would like to deploy | |
// Example: `contract DummyContract { uint256 public nonce; }` | |
bytes CONTRACT_RUNTIME_CODE = | |
hex"6080604052348015600e575f80fd5b50600436106026575f3560e01c8063affed0e014602a575b5f80fd5b60315f5481565b60405190815260200160405180910390f3"; | |
// This handmade creation code is responsible of returning the creation code of dynamic length | |
// ⚠️ It assumes the contract we would like to deploy doesn't have a constructor (!!) |
import { expect } from "chai"; | |
import { ethers } from "hardhat"; | |
describe("off-chain arbitrary code deployment", function () { | |
it("test everything goes well", async function () { | |
// get the signer available in the test environment | |
const [deployer] = await ethers.getSigners(); | |
// define the bytecode I wanna deploy. After the construction step, only | |
// this bytecode will be stored as the contract's code |
pragma solidity >=0.8.19; | |
contract Test { | |
// This function raise a "Stack too deep" error | |
// The explanation for this is due to the constraints of referencing | |
// variables in the EVM stack. Despite the possibility of having over | |
// 16 variables in the stack, any attempt to reference a variable beyond slot | |
// 16 will result in failure. Hence, it can be difficult to identify the exact | |
// reason for a code's failure, and sometimes making random alterations may appear | |
// to resolve the issues |
{ | |
"abi": [ | |
{ | |
"members": [ | |
{ | |
"name": "to", | |
"offset": 0, | |
"type": "felt" | |
}, | |
{ |
In this workshop we'll build a subgraph for querying NTF data from the Metroverse City Block smart contract, implementing queries for fetching NFTs as well as their owners, building relationships between them, full text search, sorting, and filtering.
The codebase for this project is located here
To be successful in this tutorial, you should have Node.js installed on your machine. These days, I recommend using either nvm.
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:
0.8.0
(can be more gas efficient than some
library based safemath.)0.8.2
, leads to cheaper runtime gas.
Especially relevant when the contract has small functions. For