feat: nft vault (#1)

* feat: add NFT Vault

* feat: add ts script to update config address

* feat: update readme

* add nodejs

* chore: remove unused files;

* deploy vault to dev

* deploy vault to staging

* deploy vault to prod
This commit is contained in:
Zitao Xiong
2024-08-24 13:19:22 +08:00
committed by GitHub
parent 976d9d7217
commit d2c659a583
36 changed files with 3840 additions and 180 deletions

2
.envrc
View File

@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
PATH_add tools/bin
PATH_add node_modules/.bin
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
export NX_WORKSPACE_ROOT=$DIR
# export FOUNDRY_ETH_KEYSTORE=$DIR/keystores

2
.gitignore vendored
View File

@@ -17,3 +17,5 @@ docs/
env/env.**.override
keystores/passwords/**
!keystores/passwords/local
node_modules/

View File

@@ -1 +1,3 @@
foundry nightly-5902a6fa87600cf0cbe44e689c97479c16fd474e
foundry nightly-5902a6fa87600cf0cbe44e689c97479c16fd474e
pnpm 9.8.0
nodejs 22.7.0

183
README.md
View File

@@ -28,183 +28,12 @@ zora is using routescan for contract verification. official blockscout using ins
forge script script/deploy.sepolia.s.sol -vvvv --rpc-url zora_sepolia --broadcast --verify --slow
```
## Addresses - Dev
## Addresses
### [Sepolia - Dev](https://sepolia.etherscan.io/)
The contract addresses for different environments and networks are defined in the following JSON configuration files:
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| UnifiedStore | 0xA436364dAFb5388f4756Cd334E41948a3F8BfF1d |
| GiftedAccountGuardian | 0x88b4388b261B31F858A5AC5B707c4F857A9792E4 |
| GiftedAccount(IMPL) | 0x6ac2fe2DB1aDF6Be4fE129CFB1EE17511aBf097B |
| GiftedAccount(GiftedAccountProxy) | 0x2493fFeE55B3262616461E9E72C354073dAeCDED |
| GiftedBox(IMPL) | 0xf28a59cB5576D404D74E779CB9CDe233cf5871B7 |
| GiftedBox | 0x5bf1AD25950bED502F56f61c2Fd4369c59D919A0 |
| ERC6551Registry | 0x20A63B1532649FE80c9Df43fb827c155447fD75E |
| Vault | 0xA00D0F5074e7565D5a71893396e19D19aa1f4629 |
| GasSponsorBook | 0x11d0E669D24F682F7690fDf5407B20287050a74A |
- Development: [`config/dev_addresses.json`](./config/dev_addresses.json)
- Staging: [`config/staging_addresses.json`](./config/staging_addresses.json)
- Production: [`config/prod_addresses.json`](./config/prod_addresses.json)
### [Base Sepolia - Dev](https://sepolia.basescan.org/)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| UnifiedStore | 0x49BB830d9FD2E877Be6b4C5564bBf245F2179fD9 |
| GiftedAccountGuardian | 0x06218F2deD0AA802001D8C93765a37Fc054eb62E |
| GiftedAccount(IMPL) | 0x20cb3200762ddDE5c502065dF805538D707DA76c |
| GiftedAccount(GiftedAccountProxy) | 0xaC81a402efE13A12Da7421cff57c639054222126 |
| ERC6551Registry | 0x60f1D5BC00E85ad6bf3899A244aefe71f56a0796 |
| GiftedBox(IMPL) | 0x58D532e4CD220b1e5ae6f78F37731cf4632f6960 |
| GiftedBox | 0x3425f33402D2f5E4d276a8E8653866c8afa0B9Af |
| Vault | 0x91E5503C2924F0536353343f455628A18CceDC16 |
| GasSponsorBook | 0x5C9d46832e29b1ec5972f144773Ef13afc93eA76 |
### [Arbitrum Sepolia - Dev](https://sepolia.arbiscan.io/)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| UnifiedStore | 0xd62Df558426c7A37DCdA006B83362B610423484b |
| GiftedAccountGuardian | 0x7C9612ed0716CC48474AcB908B4766239709d6A0 |
| GiftedAccount(IMPL) | 0x709c1743aaDa8657eb1928955D48684AbC1337FA |
| GiftedAccount(GiftedAccountProxy) | 0xB765c1801dB3712d0330b83585496D27Fac01420 |
| ERC6551Registry | 0xF0401c57Ff0Cb78Af5340dA8ABf79f7B1D9b4A50 |
| GiftedBox(IMPL) | 0x8431483c91C856DCe2D8e07aD5B1b587Ad5df44D |
| GiftedBox | 0x890f8F066b6C6946D220623d6cb36b2930B80c44 |
| Vault | 0xF9aE127989ec2C8d683a0605a6dEc973f4B57d9b |
| GasSponsorBook | 0x75260D56366fBa5933CB56efd5F671331fF9B6C5 |
### [Zora Sepolia - Dev](https://999999999.testnet.routescan.io/)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| GiftedAccountGuardian | 0xaa4A0c44d58ACf831D99C1C5e8d407F98C548e6e |
| GiftedAccount(IMPL) | 0x19EdAB3b08151a061Ecf3865Cb60d5266Cc6472f |
| GiftedAccount(GiftedAccountProxy) | 0x8F8cBd26bCAFbC78456961093c37f83bD9da960E |
| ERC6551Registry | 0x95013a339594a96b93cD02f22658fa512BDE43bD |
| GiftedBox(IMPL) | 0x6313943aba3666F3f39b78eD9f6943D697bE0901 |
| GiftedBox | 0x942a986ACC1f72F70e2208dc1aF8444E4863b7C0 |
| Vault | 0xf3D392E3A16e8bdCE0195b4C18F3FAeDFc7adE1a |
| GasSponsorBook | 0x27720bF7cFc25390067b6A7469aF84F37FC8c589 |
| UnifiedStore | 0xE781924639Fc91CA1a27076947a49dE447Dd95AF |
| MockERC721 | 0xA57E7bDc9721Fb9Faa9a40cb6c0c139c1F7FA256 |
| MockERC1155 | 0x1C5c6e32CBc5F608045a1781D6E9329E1B009257 |
## Address - Staging
### [Sepolia - Staging](https://sepolia.etherscan.io/)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| MockERC721 | 0x9C8Ceb75b4657DAa931fb1b0D8EC9800155C5f7f |
| MockERC1155 | 0x60f33F5C9A0E02491aA7b5b35E0ffdeE073D1e6A |
| GiftedAccountGuardian | 0xfe4BCdbDC3fd3Db643c4acB2b9d4A4d34354f623 |
| GiftedAccount(IMPL) | 0xD685C8d9D48e65311Af1c2cAE6d40367b834a94E |
| GiftedAccount(GiftedAccountProxy) | 0xB34927f8EF1C2E70aAE0b59477cBc9C52c3f959A |
| ERC6551Registry | 0xcE59CEedFa2F96069F46e7cE1A0652C9268fB24a |
| GiftedBox(IMPL) | 0x42575CA286C036A32B378ee80F186dFE4b8f63af |
| GiftedBox | 0xeaAE38B765c5509132c9B3c4a757bBd857fe3536 |
| Vault | 0xe6121F29A58f235c1c12837fACE0f9419411F402 |
| GasSponsorBook | 0x01b793FDf3d21d8C9cD52De3aD5B50c5c95009A3 |
| UnifiedStore | 0x09748F6411a4D1A84a87645A3E406dCb3c31Fc73 |
### [Arbitrum Sepolia - Staging](https://sepolia.arbiscan.io/)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| MockERC721 | 0x0CBaFa7D94f7b7DB447BBD45E23eC12e177F14e9 |
| MockERC1155 | 0x6b5AB9FfC094EC74121424Ca3d9bE848cC8d4Eb0 |
| GiftedAccountGuardian | 0xB4Bb45Fe7595105fdB425A9e024CfDEADF321EF6 |
| GiftedAccount(IMPL) | 0x01342877506d721765E918dc25DfC7201AF02001 |
| GiftedAccount(GiftedAccountProxy) | 0xFD52a038021976e84564C78EB5d2b0B8a4509333 |
| GiftedBox(IMPL) | 0x23Fd4D02E3e0b3cDFb2e851aE42Fd8bebE2EB7E9 |
| GiftedBox | 0x8f0ad7Db5be7ad0ab5A4F9BC08Fc8FBAa4952773 |
| Vault | 0xEdc199d7a4de25511C44aA85f6E5B794A21c1704 |
| GasSponsorBook | 0xfaA1e72f8609A86F7cEbbaDa0719FaC617D67e18 |
| ERC6551Registry | 0xF54930B90b5844fD976eE6EFE1cc3640c0742863 |
| UnifiedStore | 0x9Ce09649451616733844b77a5d67FF2E467d2A14 |
### [Base Sepolia - Staging](https://sepolia.basescan.org)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| MockERC721 | 0x44d0600DA8f30716001cb2233d39B01a346Cc6Ea |
| MockERC1155 | 0xBA10494cF2d2293774603bfD882c30A12E5c0511 |
| GiftedAccountGuardian | 0x40Dba44E7d95affF4BC8afa349393f26c8f61da6 |
| GiftedAccount(IMPL) | 0xE9E578157dD683B0A2C0De91A1DBCcb792F8E82E |
| GiftedAccount(GiftedAccountProxy) | 0xeDc1452817e8bDAe482D6D026c07C77f2053b693 |
| ERC6551Registry | 0x1ffdaf9a2561c0CbCC13F3fca6381A0E060Af66E |
| GiftedBox(IMPL) | 0xC3fe2527373f42cB089CCB4Bb3a3B20ad6dBD6a7 |
| GiftedBox | 0x384C26db13269BB3215482F9B932371e4803B29f |
| Vault | 0x95c566AB7A776314424364D1e2476399167b916c |
| GasSponsorBook | 0xa80F5B8d1126D7A2eB1cE271483cF70bBb4e6e0A |
| UnifiedStore | 0x6ac2fe2DB1aDF6Be4fE129CFB1EE17511aBf097B |
### [Zora Sepolia - Staging](https://999999999.testnet.routescan.io/)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| GiftedAccountGuardian | 0xF7027703193eFc66DcAA18Cc34eb95e7a535c82D |
| GiftedAccount(IMPL) | 0xE5f66DE16cE5a1bBCE31574029dF7cF2a987221A |
| GiftedAccount(GiftedAccountProxy) | 0x7488F264b2B6FEDa37B18af0080C4dBC12bC3F95 |
| ERC6551Registry | 0xB0CddfF980D3589E22D4714e24dB40C8ee693a38 |
| GiftedBox(IMPL) | 0xdC5e0000ea45bAeaDD5911627949568107626573 |
| GiftedBox | 0x549dF4BabA9F7E887996fB6EA776D501E95FA99A |
| Vault | 0x23162150013b06700a8b4523176e948E1D2E4ef5 |
| GasSponsorBook | 0x496c4f369566b265DfbA3df9Ac6C6Aca96A13792 |
| UnifiedStore | 0x10B3fEAF1012E82D8ad0beA45857fc35F72E165e |
| MockERC721 | 0x61a39Fac05841AaEB9D8148F75ada446C6534Bc0 |
| MockERC1155 | 0xA3eF3eA05eF4cD9858046E4b87015285d2f5359e |
## Address - Prod
### [Base](https://basescan.org)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| UnifiedStore | 0xc45f19217e064EcE272e55EE7aAD36cc91e7ADA3 |
| GiftedAccountGuardian | 0x1fee122930BB09D400FeF0f0Fb9d1BDBbce14268 |
| GiftedAccount(GiftedAccountProxy) | 0x07Ed52c878BaBDC959DcbADa1731925fE0b55Af6 |
| GiftedBox(ERC1967Proxy) | 0xe52a9CeCdCE5e66e283D355491c12166c3aD6d7d |
| Vault | 0xA473098eD8d7f94A18E0B7A0d0C15b6750b4dbDe |
| GasSponsorBook | 0xbec73A3ed80216efbc5203DC014F183F582E97c0 |
| ERC6551Registry | 0x44E106e4860DFA345D4D45997124019696fDA44f |
### [Arbitrum](https://arbiscan.io)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| UnifiedStore | 0x6A9AB4532a1AD2441238125A966033e4Aa859b0A |
| GiftedAccountGuardian | 0xd2de85036007c33ff38976e521a33CCD3F207fb7 |
| GiftedAccount(GiftedAccountProxy) | 0xA320659b35DAaD71910c39C0fcB5D2D3f76E90F9 |
| GiftedBox(ERC1967Proxy) | 0xbEE09DA671f7cD0B66d948eDda94Ef367697CC55 |
| Vault | 0x3474a7Ca5eC6eE70f6DAF58aEf5FD5F528c9438e |
| GasSponsorBook | 0x36F7edeBdb8E926649aE88E2Be4a204b7e8a172b |
| ERC6551Registry | 0x3d1d6fAC357FaF74dd4FF46bb8A4C6abf7f362Ea |
### [Ethereum](https://etherscan.io)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| UnifiedStore | 0xb1B46db99b18F00c15605Bb2BA15da26E7Db22bB |
| GiftedAccountGuardian | 0x5Fa3E1e212622bE1236fF7FfE75a0377E5E46608 |
| GiftedAccount(GiftedAccountProxy) | 0x4E05321775716F6A7781D4E358da03A998dcd87c |
| GiftedBox(ERC1967Proxy) | 0x6A9EAAE37a99784faF276934DE9371544030F329 |
| Vault | 0xF74d7124909f634B38799d871fD9f633b223b2C6 |
| GasSponsorBook | 0x6eb220A1c1d1cC65cd0568eCA810b5022d0D6f4e |
| ERC6551Registry | 0x40976bDCE57e5017E6a84909b06aBec0Ebd9F9fd |
### [Zora](https://zora.superscan.network/)
| ContractName | Address |
| --------------------------------- | ------------------------------------------ |
| UnifiedStore | 0xc45f19217e064EcE272e55EE7aAD36cc91e7ADA3 |
| GiftedAccountGuardian | 0x1fee122930BB09D400FeF0f0Fb9d1BDBbce14268 |
| GiftedAccount(GiftedAccountProxy) | 0x07Ed52c878BaBDC959DcbADa1731925fE0b55Af6 |
| GiftedBox(ERC1967Proxy) | 0xe52a9CeCdCE5e66e283D355491c12166c3aD6d7d |
| Vault | 0xA473098eD8d7f94A18E0B7A0d0C15b6750b4dbDe |
| GasSponsorBook | 0xbec73A3ed80216efbc5203DC014F183F582E97c0 |
| ERC6551Registry | 0x44E106e4860DFA345D4D45997124019696fDA44f |
| MockERC721 | 0xbA44e28707c4b8CBE9c22Da381E8b89c5F320511 |
| MockERC1155 | 0x2543A97126fF0131D427134dC572c17bcF7087D8 |
Please refer to these files for the most up-to-date contract addresses for each network.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

50
config/dev_addresses.json Normal file
View File

@@ -0,0 +1,50 @@
{
"84532": {
"UnifiedStore": "0x49BB830d9FD2E877Be6b4C5564bBf245F2179fD9",
"deployer": "0xB7d030F7c6406446e703E73B3d1dd8611A2D87b6",
"manager": "0x08E3dBFCF164Df355E36B65B4e71D9E66483e083",
"GiftedAccountGuardian": "0x06218F2deD0AA802001D8C93765a37Fc054eb62E",
"GiftedAccount": "0xaC81a402efE13A12Da7421cff57c639054222126",
"ERC6551Registry": "0x60f1D5BC00E85ad6bf3899A244aefe71f56a0796",
"GiftedBox": "0x3425f33402D2f5E4d276a8E8653866c8afa0B9Af",
"Vault": "0x91E5503C2924F0536353343f455628A18CceDC16",
"GasSponsorBook": "0x5C9d46832e29b1ec5972f144773Ef13afc93eA76",
"NFTVault": "0xD320547261f6a98a33469c02691f295fb39fc265"
},
"421614": {
"UnifiedStore": "0xd62Df558426c7A37DCdA006B83362B610423484b",
"deployer": "0xB7d030F7c6406446e703E73B3d1dd8611A2D87b6",
"manager": "0x08E3dBFCF164Df355E36B65B4e71D9E66483e083",
"GiftedAccountGuardian": "0x7C9612ed0716CC48474AcB908B4766239709d6A0",
"GiftedAccount": "0xB765c1801dB3712d0330b83585496D27Fac01420",
"ERC6551Registry": "0xF0401c57Ff0Cb78Af5340dA8ABf79f7B1D9b4A50",
"GiftedBox": "0x890f8F066b6C6946D220623d6cb36b2930B80c44",
"Vault": "0xF9aE127989ec2C8d683a0605a6dEc973f4B57d9b",
"GasSponsorBook": "0x75260D56366fBa5933CB56efd5F671331fF9B6C5",
"NFTVault": "0x1170472b0179aAfF645E75d65b23eB6911dD362F"
},
"11155111": {
"UnifiedStore": "0xA436364dAFb5388f4756Cd334E41948a3F8BfF1d",
"deployer": "0xB7d030F7c6406446e703E73B3d1dd8611A2D87b6",
"manager": "0x08E3dBFCF164Df355E36B65B4e71D9E66483e083",
"GiftedAccountGuardian": "0x88b4388b261B31F858A5AC5B707c4F857A9792E4",
"GiftedAccount": "0x2493fFeE55B3262616461E9E72C354073dAeCDED",
"ERC6551Registry": "0x20A63B1532649FE80c9Df43fb827c155447fD75E",
"GiftedBox": "0x5bf1AD25950bED502F56f61c2Fd4369c59D919A0",
"Vault": "0xA00D0F5074e7565D5a71893396e19D19aa1f4629",
"GasSponsorBook": "0x11d0E669D24F682F7690fDf5407B20287050a74A",
"NFTVault": "0x41878675E191A82190baeB5483744189Ca7a7cF9"
},
"999999999": {
"UnifiedStore": "0xE781924639Fc91CA1a27076947a49dE447Dd95AF",
"deployer": "0xB7d030F7c6406446e703E73B3d1dd8611A2D87b6",
"manager": "0x08E3dBFCF164Df355E36B65B4e71D9E66483e083",
"GiftedAccountGuardian": "0xaa4A0c44d58ACf831D99C1C5e8d407F98C548e6e",
"GiftedAccount": "0x8F8cBd26bCAFbC78456961093c37f83bD9da960E",
"ERC6551Registry": "0x95013a339594a96b93cD02f22658fa512BDE43bD",
"GiftedBox": "0x942a986ACC1f72F70e2208dc1aF8444E4863b7C0",
"Vault": "0xf3D392E3A16e8bdCE0195b4C18F3FAeDFc7adE1a",
"GasSponsorBook": "0x27720bF7cFc25390067b6A7469aF84F37FC8c589",
"NFTVault": "0x0000000000000000000000000000000000000000"
}
}

View File

@@ -0,0 +1,50 @@
{
"1": {
"UnifiedStore": "0xb1B46db99b18F00c15605Bb2BA15da26E7Db22bB",
"manager": "0xe335Cf211aA52f3a84257F61dde34C3BDFced560",
"deployer": "0xf53f105E90b3e9Ea928926A5A78E921D8168e213",
"GiftedAccountGuardian": "0x5Fa3E1e212622bE1236fF7FfE75a0377E5E46608",
"GiftedAccount": "0x4E05321775716F6A7781D4E358da03A998dcd87c",
"ERC6551Registry": "0x40976bDCE57e5017E6a84909b06aBec0Ebd9F9fd",
"GiftedBox": "0x6A9EAAE37a99784faF276934DE9371544030F329",
"Vault": "0xF74d7124909f634B38799d871fD9f633b223b2C6",
"GasSponsorBook": "0x6eb220A1c1d1cC65cd0568eCA810b5022d0D6f4e",
"NFTVault": "0x0000000000000000000000000000000000000000"
},
"8453": {
"UnifiedStore": "0xc45f19217e064EcE272e55EE7aAD36cc91e7ADA3",
"manager": "0xe335Cf211aA52f3a84257F61dde34C3BDFced560",
"deployer": "0xf53f105E90b3e9Ea928926A5A78E921D8168e213",
"GiftedAccountGuardian": "0x1fee122930BB09D400FeF0f0Fb9d1BDBbce14268",
"GiftedAccount": "0x07Ed52c878BaBDC959DcbADa1731925fE0b55Af6",
"ERC6551Registry": "0x44E106e4860DFA345D4D45997124019696fDA44f",
"GiftedBox": "0xe52a9CeCdCE5e66e283D355491c12166c3aD6d7d",
"Vault": "0xA473098eD8d7f94A18E0B7A0d0C15b6750b4dbDe",
"GasSponsorBook": "0xbec73A3ed80216efbc5203DC014F183F582E97c0",
"NFTVault": "0xF99E6913b949D6e3da3E217D0F5E09b7f7B7d2B1"
},
"42161": {
"UnifiedStore": "0x6A9AB4532a1AD2441238125A966033e4Aa859b0A",
"manager": "0xe335Cf211aA52f3a84257F61dde34C3BDFced560",
"deployer": "0xf53f105E90b3e9Ea928926A5A78E921D8168e213",
"GiftedAccountGuardian": "0xd2de85036007c33ff38976e521a33CCD3F207fb7",
"GiftedAccount": "0xA320659b35DAaD71910c39C0fcB5D2D3f76E90F9",
"ERC6551Registry": "0x3d1d6fAC357FaF74dd4FF46bb8A4C6abf7f362Ea",
"GiftedBox": "0xbEE09DA671f7cD0B66d948eDda94Ef367697CC55",
"Vault": "0x3474a7Ca5eC6eE70f6DAF58aEf5FD5F528c9438e",
"GasSponsorBook": "0x36F7edeBdb8E926649aE88E2Be4a204b7e8a172b",
"NFTVault": "0x0000000000000000000000000000000000000000"
},
"7777777": {
"UnifiedStore": "0xc45f19217e064EcE272e55EE7aAD36cc91e7ADA3",
"manager": "0xe335Cf211aA52f3a84257F61dde34C3BDFced560",
"deployer": "0xf53f105E90b3e9Ea928926A5A78E921D8168e213",
"GiftedAccountGuardian": "0x1fee122930BB09D400FeF0f0Fb9d1BDBbce14268",
"GiftedAccount": "0x07Ed52c878BaBDC959DcbADa1731925fE0b55Af6",
"ERC6551Registry": "0x44E106e4860DFA345D4D45997124019696fDA44f",
"GiftedBox": "0xe52a9CeCdCE5e66e283D355491c12166c3aD6d7d",
"Vault": "0xA473098eD8d7f94A18E0B7A0d0C15b6750b4dbDe",
"GasSponsorBook": "0xbec73A3ed80216efbc5203DC014F183F582E97c0",
"NFTVault": "0x0000000000000000000000000000000000000000"
}
}

View File

@@ -0,0 +1,50 @@
{
"84532": {
"UnifiedStore": "0x6ac2fe2DB1aDF6Be4fE129CFB1EE17511aBf097B",
"manager": "0x08E3dBFCF164Df355E36B65B4e71D9E66483e083",
"deployer": "0xB7d030F7c6406446e703E73B3d1dd8611A2D87b6",
"GiftedAccountGuardian": "0x40Dba44E7d95affF4BC8afa349393f26c8f61da6",
"GiftedAccount": "0xeDc1452817e8bDAe482D6D026c07C77f2053b693",
"ERC6551Registry": "0x1ffdaf9a2561c0CbCC13F3fca6381A0E060Af66E",
"GiftedBox": "0x384C26db13269BB3215482F9B932371e4803B29f",
"Vault": "0x95c566AB7A776314424364D1e2476399167b916c",
"GasSponsorBook": "0xa80F5B8d1126D7A2eB1cE271483cF70bBb4e6e0A",
"NFTVault": "0x642A0D79bc1842290ee0B893811b93c52c3A4A0F"
},
"421614": {
"UnifiedStore": "0x9Ce09649451616733844b77a5d67FF2E467d2A14",
"manager": "0x08E3dBFCF164Df355E36B65B4e71D9E66483e083",
"deployer": "0xB7d030F7c6406446e703E73B3d1dd8611A2D87b6",
"GiftedAccountGuardian": "0xB4Bb45Fe7595105fdB425A9e024CfDEADF321EF6",
"GiftedAccount": "0xFD52a038021976e84564C78EB5d2b0B8a4509333",
"ERC6551Registry": "0xF54930B90b5844fD976eE6EFE1cc3640c0742863",
"GiftedBox": "0x8f0ad7Db5be7ad0ab5A4F9BC08Fc8FBAa4952773",
"Vault": "0xEdc199d7a4de25511C44aA85f6E5B794A21c1704",
"GasSponsorBook": "0xfaA1e72f8609A86F7cEbbaDa0719FaC617D67e18",
"NFTVault": "0x6f1Be99caf26cC55C1d3fa827CBC0c2e098aAaf3"
},
"11155111": {
"UnifiedStore": "0x09748F6411a4D1A84a87645A3E406dCb3c31Fc73",
"manager": "0x08E3dBFCF164Df355E36B65B4e71D9E66483e083",
"deployer": "0xB7d030F7c6406446e703E73B3d1dd8611A2D87b6",
"GiftedAccountGuardian": "0xfe4BCdbDC3fd3Db643c4acB2b9d4A4d34354f623",
"GiftedAccount": "0xB34927f8EF1C2E70aAE0b59477cBc9C52c3f959A",
"ERC6551Registry": "0xcE59CEedFa2F96069F46e7cE1A0652C9268fB24a",
"GiftedBox": "0xeaAE38B765c5509132c9B3c4a757bBd857fe3536",
"Vault": "0xe6121F29A58f235c1c12837fACE0f9419411F402",
"GasSponsorBook": "0x01b793FDf3d21d8C9cD52De3aD5B50c5c95009A3",
"NFTVault": "0xF5D35748514832bE99c8DBad60ed7cc7957bDBaB"
},
"999999999": {
"UnifiedStore": "0x10B3fEAF1012E82D8ad0beA45857fc35F72E165e",
"manager": "0x08E3dBFCF164Df355E36B65B4e71D9E66483e083",
"deployer": "0xB7d030F7c6406446e703E73B3d1dd8611A2D87b6",
"GiftedAccountGuardian": "0xF7027703193eFc66DcAA18Cc34eb95e7a535c82D",
"GiftedAccount": "0x7488F264b2B6FEDa37B18af0080C4dBC12bC3F95",
"ERC6551Registry": "0xB0CddfF980D3589E22D4714e24dB40C8ee693a38",
"GiftedBox": "0x549dF4BabA9F7E887996fB6EA776D501E95FA99A",
"Vault": "0x23162150013b06700a8b4523176e948E1D2E4ef5",
"GasSponsorBook": "0x496c4f369566b265DfbA3df9Ac6C6Aca96A13792",
"NFTVault": "0x0000000000000000000000000000000000000000"
}
}

3
env/.env.dev vendored
View File

@@ -1,2 +1,3 @@
ETH_KEYSTORE="keystores/keys/dev"
ETH_PASSWORD="keystores/passwords/dev"
ETH_PASSWORD="keystores/passwords/dev"
DEPLOY_ENV=dev

3
env/.env.prod vendored
View File

@@ -1,2 +1,3 @@
ETH_KEYSTORE="keystores/keys/prod"
ETH_PASSWORD="keystores/passwords/prod"
ETH_PASSWORD="keystores/passwords/prod"
DEPLOY_ENV=prod

3
env/.env.staging vendored
View File

@@ -0,0 +1,3 @@
ETH_KEYSTORE="keystores/keys/dev"
ETH_PASSWORD="keystores/passwords/dev"
DEPLOY_ENV=staging

View File

@@ -3,6 +3,7 @@ src = "src"
out = "out"
libs = ["lib"]
solc = "0.8.20"
fs_permissions = [{ access = "read", path = "./"}]
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
[rpc_endpoints]

1
keystores/keys/staging Normal file
View File

@@ -0,0 +1 @@
{"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"8bd83e5a2c83ca185d64a0246253abf1"},"ciphertext":"16a4a2f30b8c5746e89bcc4a7cfe8c95559c44121845055e69fd568c46cca174","kdf":"scrypt","kdfparams":{"dklen":32,"n":8192,"p":1,"r":8,"salt":"9dd243ac384b59e77ddbae829822aea3dcd3a3225379d7d60daedf7d1fd7ea88"},"mac":"ac426d4c9f58a4d12a7c93b15537e147cdafe4055eafc79e864ff1a0abfb7ffc"},"id":"eab453de-7a1a-434e-b4e9-e1450385afbf","version":3}

10
package.json Normal file
View File

@@ -0,0 +1,10 @@
{
"dependencies": {
"p-queue": "^8.0.1",
"tsx": "^4.17.0",
"viem": "^2.20.0"
},
"devDependencies": {
"@types/node": "^22.5.0"
}
}

447
pnpm-lock.yaml generated Normal file
View File

@@ -0,0 +1,447 @@
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
p-queue:
specifier: ^8.0.1
version: 8.0.1
tsx:
specifier: ^4.17.0
version: 4.17.0
viem:
specifier: ^2.20.0
version: 2.20.0
devDependencies:
'@types/node':
specifier: ^22.5.0
version: 22.5.0
packages:
'@adraffy/ens-normalize@1.10.0':
resolution: {integrity: sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q==}
'@esbuild/aix-ppc64@0.23.1':
resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [aix]
'@esbuild/android-arm64@0.23.1':
resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==}
engines: {node: '>=18'}
cpu: [arm64]
os: [android]
'@esbuild/android-arm@0.23.1':
resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==}
engines: {node: '>=18'}
cpu: [arm]
os: [android]
'@esbuild/android-x64@0.23.1':
resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==}
engines: {node: '>=18'}
cpu: [x64]
os: [android]
'@esbuild/darwin-arm64@0.23.1':
resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==}
engines: {node: '>=18'}
cpu: [arm64]
os: [darwin]
'@esbuild/darwin-x64@0.23.1':
resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==}
engines: {node: '>=18'}
cpu: [x64]
os: [darwin]
'@esbuild/freebsd-arm64@0.23.1':
resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==}
engines: {node: '>=18'}
cpu: [arm64]
os: [freebsd]
'@esbuild/freebsd-x64@0.23.1':
resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==}
engines: {node: '>=18'}
cpu: [x64]
os: [freebsd]
'@esbuild/linux-arm64@0.23.1':
resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==}
engines: {node: '>=18'}
cpu: [arm64]
os: [linux]
'@esbuild/linux-arm@0.23.1':
resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==}
engines: {node: '>=18'}
cpu: [arm]
os: [linux]
'@esbuild/linux-ia32@0.23.1':
resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==}
engines: {node: '>=18'}
cpu: [ia32]
os: [linux]
'@esbuild/linux-loong64@0.23.1':
resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==}
engines: {node: '>=18'}
cpu: [loong64]
os: [linux]
'@esbuild/linux-mips64el@0.23.1':
resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==}
engines: {node: '>=18'}
cpu: [mips64el]
os: [linux]
'@esbuild/linux-ppc64@0.23.1':
resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==}
engines: {node: '>=18'}
cpu: [ppc64]
os: [linux]
'@esbuild/linux-riscv64@0.23.1':
resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==}
engines: {node: '>=18'}
cpu: [riscv64]
os: [linux]
'@esbuild/linux-s390x@0.23.1':
resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==}
engines: {node: '>=18'}
cpu: [s390x]
os: [linux]
'@esbuild/linux-x64@0.23.1':
resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==}
engines: {node: '>=18'}
cpu: [x64]
os: [linux]
'@esbuild/netbsd-x64@0.23.1':
resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==}
engines: {node: '>=18'}
cpu: [x64]
os: [netbsd]
'@esbuild/openbsd-arm64@0.23.1':
resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==}
engines: {node: '>=18'}
cpu: [arm64]
os: [openbsd]
'@esbuild/openbsd-x64@0.23.1':
resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==}
engines: {node: '>=18'}
cpu: [x64]
os: [openbsd]
'@esbuild/sunos-x64@0.23.1':
resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==}
engines: {node: '>=18'}
cpu: [x64]
os: [sunos]
'@esbuild/win32-arm64@0.23.1':
resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==}
engines: {node: '>=18'}
cpu: [arm64]
os: [win32]
'@esbuild/win32-ia32@0.23.1':
resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==}
engines: {node: '>=18'}
cpu: [ia32]
os: [win32]
'@esbuild/win32-x64@0.23.1':
resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==}
engines: {node: '>=18'}
cpu: [x64]
os: [win32]
'@noble/curves@1.4.0':
resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==}
'@noble/hashes@1.4.0':
resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==}
engines: {node: '>= 16'}
'@scure/base@1.1.7':
resolution: {integrity: sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g==}
'@scure/bip32@1.4.0':
resolution: {integrity: sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==}
'@scure/bip39@1.3.0':
resolution: {integrity: sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==}
'@types/node@22.5.0':
resolution: {integrity: sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg==}
abitype@1.0.5:
resolution: {integrity: sha512-YzDhti7cjlfaBhHutMaboYB21Ha3rXR9QTkNJFzYC4kC8YclaiwPBBBJY8ejFdu2wnJeZCVZSMlQJ7fi8S6hsw==}
peerDependencies:
typescript: '>=5.0.4'
zod: ^3 >=3.22.0
peerDependenciesMeta:
typescript:
optional: true
zod:
optional: true
esbuild@0.23.1:
resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==}
engines: {node: '>=18'}
hasBin: true
eventemitter3@5.0.1:
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
fsevents@2.3.3:
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
get-tsconfig@4.7.6:
resolution: {integrity: sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==}
isows@1.0.4:
resolution: {integrity: sha512-hEzjY+x9u9hPmBom9IIAqdJCwNLax+xrPb51vEPpERoFlIxgmZcHzsT5jKG06nvInKOBGvReAVz80Umed5CczQ==}
peerDependencies:
ws: '*'
p-queue@8.0.1:
resolution: {integrity: sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==}
engines: {node: '>=18'}
p-timeout@6.1.2:
resolution: {integrity: sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ==}
engines: {node: '>=14.16'}
resolve-pkg-maps@1.0.0:
resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
tsx@4.17.0:
resolution: {integrity: sha512-eN4mnDA5UMKDt4YZixo9tBioibaMBpoxBkD+rIPAjVmYERSG0/dWEY1CEFuV89CgASlKL499q8AhmkMnnjtOJg==}
engines: {node: '>=18.0.0'}
hasBin: true
undici-types@6.19.8:
resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==}
viem@2.20.0:
resolution: {integrity: sha512-cM4vs81HnSNbfceI1MLkx4pCVzbVjl9xiNSv5SCutYjUyFFOVSPDlEyhpg2iHinxx1NM4Qne3END5eLT8rvUdg==}
peerDependencies:
typescript: '>=5.0.4'
peerDependenciesMeta:
typescript:
optional: true
webauthn-p256@0.0.5:
resolution: {integrity: sha512-drMGNWKdaixZNobeORVIqq7k5DsRC9FnG201K2QjeOoQLmtSDaSsVZdkg6n5jUALJKcAG++zBPJXmv6hy0nWFg==}
ws@8.17.1:
resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: '>=5.0.2'
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
snapshots:
'@adraffy/ens-normalize@1.10.0': {}
'@esbuild/aix-ppc64@0.23.1':
optional: true
'@esbuild/android-arm64@0.23.1':
optional: true
'@esbuild/android-arm@0.23.1':
optional: true
'@esbuild/android-x64@0.23.1':
optional: true
'@esbuild/darwin-arm64@0.23.1':
optional: true
'@esbuild/darwin-x64@0.23.1':
optional: true
'@esbuild/freebsd-arm64@0.23.1':
optional: true
'@esbuild/freebsd-x64@0.23.1':
optional: true
'@esbuild/linux-arm64@0.23.1':
optional: true
'@esbuild/linux-arm@0.23.1':
optional: true
'@esbuild/linux-ia32@0.23.1':
optional: true
'@esbuild/linux-loong64@0.23.1':
optional: true
'@esbuild/linux-mips64el@0.23.1':
optional: true
'@esbuild/linux-ppc64@0.23.1':
optional: true
'@esbuild/linux-riscv64@0.23.1':
optional: true
'@esbuild/linux-s390x@0.23.1':
optional: true
'@esbuild/linux-x64@0.23.1':
optional: true
'@esbuild/netbsd-x64@0.23.1':
optional: true
'@esbuild/openbsd-arm64@0.23.1':
optional: true
'@esbuild/openbsd-x64@0.23.1':
optional: true
'@esbuild/sunos-x64@0.23.1':
optional: true
'@esbuild/win32-arm64@0.23.1':
optional: true
'@esbuild/win32-ia32@0.23.1':
optional: true
'@esbuild/win32-x64@0.23.1':
optional: true
'@noble/curves@1.4.0':
dependencies:
'@noble/hashes': 1.4.0
'@noble/hashes@1.4.0': {}
'@scure/base@1.1.7': {}
'@scure/bip32@1.4.0':
dependencies:
'@noble/curves': 1.4.0
'@noble/hashes': 1.4.0
'@scure/base': 1.1.7
'@scure/bip39@1.3.0':
dependencies:
'@noble/hashes': 1.4.0
'@scure/base': 1.1.7
'@types/node@22.5.0':
dependencies:
undici-types: 6.19.8
abitype@1.0.5: {}
esbuild@0.23.1:
optionalDependencies:
'@esbuild/aix-ppc64': 0.23.1
'@esbuild/android-arm': 0.23.1
'@esbuild/android-arm64': 0.23.1
'@esbuild/android-x64': 0.23.1
'@esbuild/darwin-arm64': 0.23.1
'@esbuild/darwin-x64': 0.23.1
'@esbuild/freebsd-arm64': 0.23.1
'@esbuild/freebsd-x64': 0.23.1
'@esbuild/linux-arm': 0.23.1
'@esbuild/linux-arm64': 0.23.1
'@esbuild/linux-ia32': 0.23.1
'@esbuild/linux-loong64': 0.23.1
'@esbuild/linux-mips64el': 0.23.1
'@esbuild/linux-ppc64': 0.23.1
'@esbuild/linux-riscv64': 0.23.1
'@esbuild/linux-s390x': 0.23.1
'@esbuild/linux-x64': 0.23.1
'@esbuild/netbsd-x64': 0.23.1
'@esbuild/openbsd-arm64': 0.23.1
'@esbuild/openbsd-x64': 0.23.1
'@esbuild/sunos-x64': 0.23.1
'@esbuild/win32-arm64': 0.23.1
'@esbuild/win32-ia32': 0.23.1
'@esbuild/win32-x64': 0.23.1
eventemitter3@5.0.1: {}
fsevents@2.3.3:
optional: true
get-tsconfig@4.7.6:
dependencies:
resolve-pkg-maps: 1.0.0
isows@1.0.4(ws@8.17.1):
dependencies:
ws: 8.17.1
p-queue@8.0.1:
dependencies:
eventemitter3: 5.0.1
p-timeout: 6.1.2
p-timeout@6.1.2: {}
resolve-pkg-maps@1.0.0: {}
tsx@4.17.0:
dependencies:
esbuild: 0.23.1
get-tsconfig: 4.7.6
optionalDependencies:
fsevents: 2.3.3
undici-types@6.19.8: {}
viem@2.20.0:
dependencies:
'@adraffy/ens-normalize': 1.10.0
'@noble/curves': 1.4.0
'@noble/hashes': 1.4.0
'@scure/bip32': 1.4.0
'@scure/bip39': 1.3.0
abitype: 1.0.5
isows: 1.0.4(ws@8.17.1)
webauthn-p256: 0.0.5
ws: 8.17.1
transitivePeerDependencies:
- bufferutil
- utf-8-validate
- zod
webauthn-p256@0.0.5:
dependencies:
'@noble/curves': 1.4.0
'@noble/hashes': 1.4.0
ws@8.17.1: {}

63
script/deploy.vault.s.sol Normal file
View File

@@ -0,0 +1,63 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Script, console} from "forge-std/Script.sol";
import "../src/NFTVault.sol";
import "../src/UnifiedStore.sol";
contract DeployVault is Script {
NFTVault public nftVault;
UnifiedStore public unifiedStore;
address public manager;
function run() public {
deploy_contracts();
setup_roles();
update_unified_store();
}
function deploy_contracts() internal {
vm.startBroadcast(getAddressFromConfig("deployer"));
nftVault = new NFTVault();
vm.stopBroadcast();
}
function setup_roles() internal {
vm.startBroadcast(getAddressFromConfig("deployer"));
manager = getAddressFromConfig("manager");
nftVault.grantManagerRole(manager);
vm.stopBroadcast();
}
function update_unified_store() internal {
vm.startBroadcast(getAddressFromConfig("deployer"));
address unifiedStoreAddress = getAddressFromConfig("UnifiedStore");
unifiedStore = UnifiedStore(unifiedStoreAddress);
string[] memory keys = new string[](1);
address[] memory addresses = new address[](1);
keys[0] = "NFTVault";
addresses[0] = address(nftVault);
unifiedStore.setAddresses(keys, addresses);
vm.stopBroadcast();
}
function getAddressFromConfig(string memory key) internal view returns (address) {
string memory env = vm.envString("DEPLOY_ENV");
require(bytes(env).length > 0, "DEPLOY_ENV must be set");
string memory root = vm.projectRoot();
string memory path = string.concat(root, "/config/", env, "_addresses.json");
string memory json = vm.readFile(path);
bytes memory addressBytes = vm.parseJson(json, string.concat(".", vm.toString(block.chainid), ".", key));
return abi.decode(addressBytes, (address));
}
}

351
ts-scripts/abis.ts Normal file
View File

@@ -0,0 +1,351 @@
export const abiUnifiedStore = [
{ type: "constructor", inputs: [], stateMutability: "nonpayable" },
{
type: "function",
name: "configAddress",
inputs: [{ name: "", type: "string", internalType: "string" }],
outputs: [{ name: "", type: "address", internalType: "address" }],
stateMutability: "view",
},
{
type: "function",
name: "configBool",
inputs: [{ name: "", type: "string", internalType: "string" }],
outputs: [{ name: "", type: "bool", internalType: "bool" }],
stateMutability: "view",
},
{
type: "function",
name: "configString",
inputs: [{ name: "", type: "string", internalType: "string" }],
outputs: [{ name: "", type: "string", internalType: "string" }],
stateMutability: "view",
},
{
type: "function",
name: "configUint256",
inputs: [{ name: "", type: "string", internalType: "string" }],
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
stateMutability: "view",
},
{
type: "function",
name: "deleteAddress",
inputs: [{ name: "key", type: "string", internalType: "string" }],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "deleteAddresses",
inputs: [{ name: "keys", type: "string[]", internalType: "string[]" }],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "deleteBool",
inputs: [{ name: "key", type: "string", internalType: "string" }],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "deleteBools",
inputs: [{ name: "keys", type: "string[]", internalType: "string[]" }],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "deleteString",
inputs: [{ name: "key", type: "string", internalType: "string" }],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "deleteStrings",
inputs: [{ name: "keys", type: "string[]", internalType: "string[]" }],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "deleteUint256",
inputs: [{ name: "key", type: "string", internalType: "string" }],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "deleteUint256s",
inputs: [{ name: "keys", type: "string[]", internalType: "string[]" }],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "getAddress",
inputs: [{ name: "key", type: "string", internalType: "string" }],
outputs: [{ name: "", type: "address", internalType: "address" }],
stateMutability: "view",
},
{
type: "function",
name: "getAddresses",
inputs: [{ name: "keys", type: "string[]", internalType: "string[]" }],
outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
stateMutability: "view",
},
{
type: "function",
name: "getBool",
inputs: [{ name: "key", type: "string", internalType: "string" }],
outputs: [{ name: "", type: "bool", internalType: "bool" }],
stateMutability: "view",
},
{
type: "function",
name: "getBools",
inputs: [{ name: "keys", type: "string[]", internalType: "string[]" }],
outputs: [{ name: "", type: "bool[]", internalType: "bool[]" }],
stateMutability: "view",
},
{
type: "function",
name: "getString",
inputs: [{ name: "key", type: "string", internalType: "string" }],
outputs: [{ name: "", type: "string", internalType: "string" }],
stateMutability: "view",
},
{
type: "function",
name: "getStrings",
inputs: [{ name: "keys", type: "string[]", internalType: "string[]" }],
outputs: [{ name: "", type: "string[]", internalType: "string[]" }],
stateMutability: "view",
},
{
type: "function",
name: "getUint256",
inputs: [{ name: "key", type: "string", internalType: "string" }],
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
stateMutability: "view",
},
{
type: "function",
name: "getUint256s",
inputs: [{ name: "keys", type: "string[]", internalType: "string[]" }],
outputs: [{ name: "", type: "uint256[]", internalType: "uint256[]" }],
stateMutability: "view",
},
{
type: "function",
name: "owner",
inputs: [],
outputs: [{ name: "", type: "address", internalType: "address" }],
stateMutability: "view",
},
{
type: "function",
name: "renounceOwnership",
inputs: [],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setAddress",
inputs: [
{ name: "key", type: "string", internalType: "string" },
{ name: "value", type: "address", internalType: "address" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setAddresses",
inputs: [
{ name: "keys", type: "string[]", internalType: "string[]" },
{ name: "values", type: "address[]", internalType: "address[]" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setBool",
inputs: [
{ name: "key", type: "string", internalType: "string" },
{ name: "value", type: "bool", internalType: "bool" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setBools",
inputs: [
{ name: "keys", type: "string[]", internalType: "string[]" },
{ name: "values", type: "bool[]", internalType: "bool[]" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setString",
inputs: [
{ name: "key", type: "string", internalType: "string" },
{ name: "value", type: "string", internalType: "string" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setStrings",
inputs: [
{ name: "keys", type: "string[]", internalType: "string[]" },
{ name: "values", type: "string[]", internalType: "string[]" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setUint256",
inputs: [
{ name: "key", type: "string", internalType: "string" },
{ name: "value", type: "uint256", internalType: "uint256" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "setUint256s",
inputs: [
{ name: "keys", type: "string[]", internalType: "string[]" },
{ name: "values", type: "uint256[]", internalType: "uint256[]" },
],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "function",
name: "transferOwnership",
inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
outputs: [],
stateMutability: "nonpayable",
},
{
type: "event",
name: "DeleteAddress",
inputs: [
{ name: "key", type: "string", indexed: false, internalType: "string" },
],
anonymous: false,
},
{
type: "event",
name: "DeleteBool",
inputs: [
{ name: "key", type: "string", indexed: false, internalType: "string" },
],
anonymous: false,
},
{
type: "event",
name: "DeleteString",
inputs: [
{ name: "key", type: "string", indexed: false, internalType: "string" },
],
anonymous: false,
},
{
type: "event",
name: "DeleteUint256",
inputs: [
{ name: "key", type: "string", indexed: false, internalType: "string" },
],
anonymous: false,
},
{
type: "event",
name: "OwnershipTransferred",
inputs: [
{
name: "previousOwner",
type: "address",
indexed: true,
internalType: "address",
},
{
name: "newOwner",
type: "address",
indexed: true,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "UpdateAddress",
inputs: [
{ name: "key", type: "string", indexed: false, internalType: "string" },
{
name: "value",
type: "address",
indexed: false,
internalType: "address",
},
],
anonymous: false,
},
{
type: "event",
name: "UpdateBool",
inputs: [
{ name: "key", type: "string", indexed: false, internalType: "string" },
{ name: "value", type: "bool", indexed: false, internalType: "bool" },
],
anonymous: false,
},
{
type: "event",
name: "UpdateString",
inputs: [
{ name: "key", type: "string", indexed: false, internalType: "string" },
{ name: "value", type: "string", indexed: false, internalType: "string" },
],
anonymous: false,
},
{
type: "event",
name: "UpdateUint256",
inputs: [
{ name: "key", type: "string", indexed: false, internalType: "string" },
{
name: "value",
type: "uint256",
indexed: false,
internalType: "uint256",
},
],
anonymous: false,
},
{
type: "error",
name: "OwnableInvalidOwner",
inputs: [{ name: "owner", type: "address", internalType: "address" }],
},
{
type: "error",
name: "OwnableUnauthorizedAccount",
inputs: [{ name: "account", type: "address", internalType: "address" }],
},
];

View File

@@ -0,0 +1,90 @@
import { spawn } from "node:child_process";
import PQueue from "p-queue";
const colors = [
"\x1b[32m", // Green
"\x1b[33m", // Yellow
"\x1b[34m", // Blue
"\x1b[35m", // Magenta
"\x1b[36m", // Cyan
"\x1b[90m", // Bright Black (Gray)
"\x1b[92m", // Bright Green
"\x1b[94m", // Bright Blue
];
const resetColor = "\x1b[0m";
const networks = [
// "base_sepolia",
// "sepolia",
// "arbitrum_sepolia",
// "zora_sepolia",
"base"
] as const;
async function deploy() {
console.log(`Deploying NFTVault to ${networks.join(", ")}...`);
const queue = new PQueue({ concurrency: 10 });
for (const network of networks) {
queue.add(async () => {
try {
const colorIndex = networks.indexOf(network) % colors.length;
console.log(
`${colors[colorIndex]}Deploying NFTVault to ${network}...${resetColor}`
);
const command = `forge script script/deploy.vault.s.sol --rpc-url ${network} -vvvv --broadcast --verify --slow`;
// const command = `forge script script/deploy.vault.s.sol --rpc-url ${network} -vvvv`;
const child = spawn(command, { shell: true });
let output = "";
child.stdout.on("data", (data: Buffer) => {
const message = data.toString().trim();
console.log(
`${colors[colorIndex]}[${network}] ${message}${resetColor}`
);
output += message + "\n";
});
child.stderr.on("data", (data: Buffer) => {
console.error(
`${colors[colorIndex]}[${network}] Error: ${data
.toString()
.trim()}${resetColor}`
);
});
await new Promise<void>((resolve, reject) => {
child.on("close", (code: number) => {
if (code === 0) {
console.log(
`${colors[colorIndex]}[${network}] Deployment completed successfully${resetColor}`
);
resolve();
} else {
console.error(
`${colors[colorIndex]}[${network}] Deployment failed with code ${code}${resetColor}`
);
reject(new Error(`Deployment failed for ${network}`));
}
});
});
console.log(
`${colors[colorIndex]}Deployment output for ${network}:${resetColor}`
);
console.log(output);
} catch (error) {
console.error(
`${colors[colorIndex]}Error deploying NFTVault for ${network}:${resetColor}`
);
console.error(error);
}
});
}
await queue.onIdle();
console.log("NFTVault deployment completed.");
}
deploy();

105
ts-scripts/update-config.ts Normal file
View File

@@ -0,0 +1,105 @@
import { createPublicClient, http, Address, Chain } from "viem";
import * as chains from "viem/chains";
import fs from "fs";
import path from "path";
import assert from "assert";
import { abiUnifiedStore } from "./abis";
// Get all keys from the UnifiedStore contract
const keys = [
"GiftedAccountGuardian",
"GiftedAccount",
"ERC6551Registry",
"GiftedBox",
"Vault",
"GasSponsorBook",
"NFTVault",
];
function getChainById(networkId: string): Chain | undefined {
const chain = Object.values(chains).find((c) => c.id === parseInt(networkId));
if (!chain) {
console.error(`Chain not found for network ID ${networkId}`);
return undefined;
}
const chainName = chain.name.toUpperCase().replace(/ /g, "_");
const envRpcUrl = process.env[`${chainName}_RPC_URL`];
if (envRpcUrl) {
const clonedChain = { ...chain };
clonedChain.rpcUrls = {
...chain.rpcUrls,
default: { http: [envRpcUrl as any] },
};
return clonedChain;
}
return chain;
}
async function updateConfig() {
// Get the deployment environment
const deployEnv = process.env.DEPLOY_ENV;
assert(deployEnv, "DEPLOY_ENV is not set");
// Read the addresses JSON file
const addressesPath = path.join(
__dirname,
"..",
"config",
`${deployEnv}_addresses.json`
);
const addresses = JSON.parse(fs.readFileSync(addressesPath, "utf-8"));
for (const [networkId, networkData] of Object.entries(addresses)) {
const unifiedStoreAddress = (networkData as { UnifiedStore?: Address })
.UnifiedStore;
if (!unifiedStoreAddress) {
console.error(`UnifiedStore address not found for network ${networkId}`);
continue;
}
const chain = getChainById(networkId);
if (!chain) {
console.error(`Chain not found for network ID ${networkId}`);
continue;
}
// Create a public client
const publicClient = createPublicClient({
chain,
transport: http(process.env.RPC_URL),
});
try {
// Fetch addresses for each key and update the configuration
for (const key of keys) {
const address = await publicClient.readContract({
address: unifiedStoreAddress,
abi: abiUnifiedStore,
functionName: "getAddress",
args: [key],
});
addresses[networkId][key] = address;
}
console.log(
`Configuration updated successfully for network ${deployEnv} - ${networkId}`
);
} catch (error) {
console.error(
`Error updating configuration for network ${deployEnv} - ${networkId}:`,
error
);
}
}
// Write the updated configuration back to the file
fs.writeFileSync(addressesPath, JSON.stringify(addresses, null, 2));
console.log(`All configurations updated and saved for ${deployEnv}`);
}
updateConfig().catch(console.error);

27
tsconfig.json Normal file
View File

@@ -0,0 +1,27 @@
{
"compilerOptions": {
/* Base Options: */
"skipLibCheck": true,
"target": "es2022",
"esModuleInterop": true,
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
/* Strictness */
"strict": true,
"noUncheckedIndexedAccess": true,
/* If NOT transpiling with tsc: */
"module": "Preserve",
"noEmit": true,
"lib": [
"es2022"
],
"types": [
"node"
]
},
"include": [
"ts-scripts/**/*.ts"
]
}