The steps below use various variables. In the latest deployments, these were set to:
export PRIVATE_KEY=<private-key-of-0x09Af4E864b84706fbCFE8679BF696e8c0B472201>
export ENTRYPOINT_ADDRESS=0x8b57d6ec08e09078Db50F265729440713E024C6a
export RELAY_ADDRESS=0x7B72bA8c9f3Ba4A94E6d8fA07c822228034d2e61
export ERC_ADDRESS=0x2868d708e442A6a940670d26100036d426F1e16b # wbtc
export ORACLE_ADDRESS=0x9AfBdFF0434acD4F325e3c35b739a62365099BCE # wbtc oracle
export ERC_DECIMALS=8
export FORWARDER_ADDRESS=0xFd0042D3d05c82acb937aC86F23247a2D77785f2
export RPC_URL=https://l2-puff-bob-jznbxtoq7h.t.conduit.xyz
export VERIFIER_URL='https://explorerl2new-puff-bob-jznbxtoq7h.t.conduit.xyz/api?'
export OWNER_ADDRESS='0x09Af4E864b84706fbCFE8679BF696e8c0B472201'
export BITCOIN_PRICE=3761500000000
Use the gsn
tool to deploy the standard gsn infrasturcture. I believe the beta.10 version was used for the most recent deployment.
npx gsn deploy --network https://l2-puff-bob-jznbxtoq7h.t.conduit.xyz --privateKeyHex $PRIVATE_KEY --testToken --burnAddress 0x09Af4E864b84706fbCFE8679BF696e8c0B472201 --devAddress 0x09Af4E864b84706fbCFE8679BF696e8c0B472201
# Output:
#
# info: Setting minimum stake of 1 TestWeth on Hub
# info: Setting minimum stake of 0.000000000000000001 wnTok (0x14d8...446)
# Deployed GSN to network: https://l2-puff-bob-jznbxtoq7h.t.conduit.xyz
#
# RelayHub: 0x7B72bA8c9f3Ba4A94E6d8fA07c822228034d2e61
# RelayRegistrar: 0x6Ff484e7530C4ab20aEa1B19E5b33FE7415dB9Fd
# StakeManager: 0xE5a27E68bE43A69dfd3A26be7DaE9Feac236C826
# Penalizer: 0x1C36129916E3EA2ACcD516Ae92C8f91deF7c4146
# Forwarder: 0xFd0042D3d05c82acb937aC86F23247a2D77785f2
# TestToken (test only): 0x14d8b98c9f685FB3e13F5BB24B8016BD709A5446
# Paymaster (Default): 0x0000000000000000000000000000000000000000
# wbtc oracle: 0x9AfBdFF0434acD4F325e3c35b739a62365099BCE
# wbtc: 0x2868d708e442A6a940670d26100036d426F1e16b
export ERC_PRICE=$BITCOIN_PRICE && forge script script/TestingWbtc.sol --rpc-url=$RPC_URL --broadcast --verify --verifier=blockscout --verifier-url=$VERIFIER_URL
# btc marketplace: 0x0cfd830a59e94b6957609fFd85CcDD742C521F34
# marketplace: 0x69F14d077Fcc88e70F4737a48fE09C0FD32506FB
# dummy relay: 0x077c5ed60fABb260784891786c6573373fDa8A3E
forge script script/Marketplace.sol --rpc-url=$RPC_URL --broadcast --verify --verifier blockscout --verifier-url=$VERIFIER_URL
# paymaster: 0x25Aa86d188E37A47dd2011535534E53Cf994559d
forge script script/OracleTokenPaymaster.sol --rpc-url=$RPC_URL --broadcast --verify --verifier=blockscout --verifier-url=$VERIFIER_URL
Clone our fork of the account-abstraction repo, set the PRIVATE_KEY
environment variable, and deploy:
yarn hardhat deploy --network sepoliaBob
The command above will output an address. Specify that address to verify the contract:
yarn hardhat verify --network sepoliaBob 0x8b57d6ec08e09078Db50F265729440713E024C6a
Clone our fork of deterministic-deployment-proxy. This contract is used by the account abstraction wallets to deploy wallets to deterministic addresses. Edit the chainIdNum
in the scripts/compile.ts
file and then run ts-node scripts/compile.ts
. Check the output as follows:
❯ cat output/deployment.json
{
"gasPrice": 100000000000,
"gasLimit": 100000,
"signerAddress": "3760847f009a294e07309e80514ac0a7ee194269",
"transaction": "f8a78085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3820101a02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222",
"address": "250f60877f1397002ae79528b218be925b6b4c79"
}
Then, in the front-end code, update DeterministicDeployer.ts
using the values from above. See bob-collective/demo-account-abstraction-transfer#4 for an example.