Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git hell #47

Merged
merged 17 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
/coverage
lcov.info
.DS_Store
broadcast/
.vscode
.env

output/31337.json
broadcast/*/31337
deployments/31337.md
deployments/json/31337.json
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": "*.json",
"options": {
"tabWidth": 4
}
}
]
}
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,24 @@ A default implementation is included and this contract will be proxy upgradable

### Setup

- [Install foundry](https://book.getfoundry.sh/getting-started/installation)
- Install Dependencies: `forge install`
- Build: `forge build`
- Test: `forge test`
- [Install foundry](https://book.getfoundry.sh/getting-started/installation)
- Install Dependencies: `forge install`
- Build: `forge build`
- Test: `forge test`

### Deployment

Forge scripts are used to deploy or upgrade contracts and an additional extract.js script can be used to generate a JSON and Markdown file with coalesced deployment information. (see [deployments](./deployments/))

1. Ensure .env file is set, `cp .env.example`
2. Populate Enviornment variables: `source .env`
3. We use a forge script to deploy the contracts, and have an additional extract.js script to store a JSON file with coalesced deployment information. (see [output](./output/))
2. `source .env`

3. Deploy using foundry

- (mainnet): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --etherscan-api-key $ETHERSCAN_API_KEY`
- (testnet, goerli for example): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --private-key $PRIVATE_KEY --verifier-url https://api-goerli.etherscan.io/api --chain-id 5`
- (mainnet): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --etherscan-api-key $ETHERSCAN_API_KEY`
- (testnet, goerli for example): `forge script script/Deploy.s.sol --broadcast --verify --rpc-url $RPC_URL --verifier-url https://api-goerli.etherscan.io/api --chain-id 5`

4. Run `node script/util/extract.js <chainId>` to extract deployment information from forge broadcast output (broadcast/latest-run.json).
4. Run `node script/util/extract.js <chainId> [version = 1.0.0] [scriptName = Deploy.s.sol]` to extract deployment information from forge broadcast output (broadcast/latest-run.json).

## Reference Deployments

Expand Down
238 changes: 238 additions & 0 deletions broadcast/Deploy.s.sol/5/run-1696415718.json

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions broadcast/Deploy.s.sol/5/run-1696415725.json

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions broadcast/Deploy.s.sol/5/run-1696415816.json

Large diffs are not rendered by default.

685 changes: 685 additions & 0 deletions broadcast/Deploy.s.sol/5/run-latest.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"transactions": [
{
"hash": "0x25bc708e7a3943104d5f0d95739c2f28233b114c919cf4c345cf95765141bf04",
"transactionType": "CREATE",
"contractName": "DefaultEmissionManager",
"contractAddress": "0x16258ebEa8eb68271Ca2677aBE05256265398A4D",
"function": null,
"arguments": [
"0x5c5589fca76237Ed00BA024e19b6C077a108f687",
"0x00200eA4Ee292E253E6Ca07dBA5EdC07c8Aa37A3",
"0x531c7Befe78B6496e5753815ab3d3Cc024c1E842"
],
"transaction": {
"type": "0x02",
"from": "0x95e6f8bd0549786c2a49f6546cf51410889f9330",
"gas": "0x19cd2e",
"value": "0x0",
"data": "0x61010034620001c357601f6200181438819003918201601f191683019291906001600160401b03841183851017620001c8578160609284926040968752833981010312620001c3576200005281620001de565b906200006e836200006660208401620001de565b9201620001de565b916001600160a01b03908116908115908115620001b7575b8115620001ab575b506200019a573360805260a05260c05260e05260005460ff8160081c16620001465760ff808216036200010b575b50516116209081620001f482396080518161040b015260a051818181610492015281816107460152610c78015260c0518181816102c90152610cae015260e0518181816103740152610c280152f35b60ff90811916176000557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986020825160ff8152a138620000bc565b815162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b835163e6c4247b60e01b8152600490fd5b9050831615386200008e565b83811615915062000086565b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620001c35756fe608060408181526004918236101561001657600080fd5b600092833560e01c9182630d8e6e2c1461078e575081631249c58b146107755781631705a3bd1461073157816321daf0851461070a578163485cc955146103a357816361d027b31461035f578163715018a6146102f85781637542ff95146102b457816379ba50971461022757816387b1103414610200575080638da5cb5b146101d8578063e30c3978146101b0578063e6fd48bc14610192578063f2fde38b14610121578063f6908f7c146101005763fc0c546a146100d557600080fd5b346100fc57816003193601126100fc5760975490516001600160a01b039091168152602090f35b5080fd5b50346100fc57816003193601126100fc5760209051669780cc86ea48988152f35b823461018f57602036600319011261018f5761013b610818565b610143610889565b606580546001600160a01b0319166001600160a01b039283169081179091556033549091167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227008380a380f35b80fd5b50346100fc57816003193601126100fc576020906098549051908152f35b50346100fc57816003193601126100fc5760655490516001600160a01b039091168152602090f35b50346100fc57816003193601126100fc5760335490516001600160a01b039091168152602090f35b82843461018f57602036600319011261018f575061022060209235610d8c565b9051908152f35b919050346102b057826003193601126102b057606554336001600160a01b039091160361025b578261025833610833565b80f35b906020608492519162461bcd60e51b8352820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152fd5b8280fd5b5050346100fc57816003193601126100fc57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b833461018f578060031936011261018f57610311610889565b606580546001600160a01b031990811690915560338054918216905581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5050346100fc57816003193601126100fc57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9050346102b057816003193601126102b0576103bd610818565b6001600160a01b03916024803591848316908184036107065787549460ff8660081c1615958680976106f9575b80156106e2575b156106895760ff1981166001178a5586610678575b5033877f0000000000000000000000000000000000000000000000000000000000000000160361067457861691821590811561066b575b5061065d57609780546001600160a01b031916831790554260985586516318160ddd60e01b81526020969087818481875afa908115610614578a91610630575b506b204fce5e3e250261100000000361061e577f000000000000000000000000000000000000000000000000000000000000000016928751636eb1769f60e11b8152308382015284828201528781604481875afa908115610614578a916105e3575b506105825787519363095ea7b360e01b8886015281850152600019604485015260448452608084019184831067ffffffffffffffff8411176105715750508652610532929161052d91610949565b610833565b61053a578280f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001984541684555160018152a138808280f35b634e487b7160e01b8a526041905288fd5b875162461bcd60e51b81529182018790526036908201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608490fd5b90508781813d831161060d575b6105fa8183610927565b810103126106095751386104df565b8980fd5b503d6105f0565b89513d8c823e3d90fd5b634e487b7160e01b8952600182528389fd5b90508781813d8311610656575b6106478183610927565b8101031261060957513861047d565b503d61063d565b865163e6c4247b60e01b8152fd5b9050153861043d565b8880fd5b61ffff191661010117895538610406565b885162461bcd60e51b8152602081850152602e818701527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b1580156103f15750600160ff8216146103f1565b50600160ff8216106103ea565b8780fd5b5050346100fc57816003193601126100fc57602090516b204fce5e3e250261100000008152f35b5050346100fc57816003193601126100fc57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b833461018f578060031936011261018f57610258610b45565b849084346102b057826003193601126102b0576107cb92506107af8261090b565b60058252640312e312e360dc1b602083015251918291826107cf565b0390f35b6020808252825181830181905290939260005b82811061080457505060409293506000838284010152601f8019910116010190565b8181018601518482016040015285016107e2565b600435906001600160a01b038216820361082e57565b600080fd5b6bffffffffffffffffffffffff60a01b90816065541660655560335460018060a01b038092168093821617603355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b6033546001600160a01b0316330361089d57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b67ffffffffffffffff81116108f557604052565b634e487b7160e01b600052604160045260246000fd5b6040810190811067ffffffffffffffff8211176108f557604052565b90601f8019910116810190811067ffffffffffffffff8211176108f557604052565b60018060a01b03169060405161095e8161090b565b6020928382527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564848301526000808486829651910182855af13d15610a83573d9167ffffffffffffffff8311610a6f57906109d9939291604051926109cc88601f19601f8401160185610927565b83523d868885013e610a8d565b805191821591848315610a4b575b5050509050156109f45750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126100fc5782015190811515820361018f5750803880846109e7565b634e487b7160e01b85526041600452602485fd5b906109d992916060915b91929015610aef5750815115610aa1575090565b3b15610aaa5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015610b025750805190602001fd5b60405162461bcd60e51b8152908190610b1e90600483016107cf565b0390fd5b91908203918211610b2f57565b634e487b7160e01b600052601160045260246000fd5b609754604080516318160ddd60e01b81526000926001600160a01b03908116916020908181600481875afa8015610d82578690610d4f575b610b9b9150610b96610b9160985442610b22565b610d8c565b610b22565b928315610d47576003840491610bb18386610b22565b947fcae919fa60d0c9867c5b3e0a9529934bca78c09d353736e3327f74837594adc58780518381523385820152a1823b156107065786516340c10f1960e01b81523060048201526024810191909152878160448183875af18015610d3d57610d20575b50855163a9059cbb60e01b918101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166024820152604480820193909352918252610c769190610c71606483610927565b610949565b7f00000000000000000000000000000000000000000000000000000000000000001690813b15610d1c578251630899d25960e41b81527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031660048201526024810191909152919083908390604490829084905af1908115610d135750610d02575050565b610d0c82916108e1565b61018f5750565b513d84823e3d90fd5b8380fd5b610c7693929197610d33610c71926108e1565b9791929350610c14565b87513d8a823e3d90fd5b505050505050565b508181813d8311610d7b575b610d658183610927565b81010312610d7757610b9b9051610b7d565b8580fd5b503d610d5b565b85513d88823e3d90fd5b669780cc86ea48989080820291820403610b2f57670de0b6b3a764000090816301e1338060409204821b0482600160bf1b67ff0000000000000083166114d9575b66ff00000000000083166113d1575b65ff000000000083166112d1575b64ff0000000083166111d9575b63ff00000083166110e9575b62ff00008316611001575b61ff008316610f21575b60ff8316610e4a575b02911c60bf031c6b204fce5e3e2502611000000090818102918183041490151715610b2f570490565b60808316610f0f575b838316610efd575b60208316610eeb575b60108316610ed9575b60088316610ec7575b60048316610eb5575b60028316610ea3575b6001831615610e21576801000000000000000102831c610e21565b6801000000000000000102831c610e88565b6801000000000000000302831c610e7f565b6801000000000000000602831c610e76565b6801000000000000000b02831c610e6d565b6801000000000000001602831c610e64565b6801000000000000002c02831c610e5b565b6801000000000000005902831c610e53565b6180008316610fef575b6140008316610fdd575b6120008316610fcb575b6110008316610fb9575b6108008316610fa7575b6104008316610f95575b6102008316610f83575b610100831615610e1857680100000000000000b102831c610e18565b6801000000000000016302831c610f67565b680100000000000002c602831c610f5d565b6801000000000000058c02831c610f53565b68010000000000000b1702831c610f49565b6801000000000000162e02831c610f3f565b68010000000000002c5d02831c610f35565b680100000000000058b902831c610f2b565b6280000083166110d7575b6240000083166110c5575b6220000083166110b3575b6210000083166110a1575b62080000831661108f575b62040000831661107d575b62020000831661106b575b62010000831615610e0e576801000000000000b17202831c610e0e565b680100000000000162e402831c61104e565b6801000000000002c5c802831c611043565b68010000000000058b9102831c611038565b680100000000000b172102831c61102d565b68010000000000162e4302831c611022565b680100000000002c5c8602831c611017565b6801000000000058b90c02831c61100c565b638000000083166111c7575b634000000083166111b5575b632000000083166111a3575b63100000008316611191575b6308000000831661117f575b6304000000831661116d575b6302000000831661115b575b6301000000831615610e035768010000000000b1721802831c610e03565b6801000000000162e43002831c61113d565b68010000000002c5c86002831c611131565b680100000000058b90c002831c611125565b6801000000000b17217f02831c611119565b680100000000162e42ff02831c61110d565b6801000000002c5c85fe02831c611101565b68010000000058b90bfc02831c6110f5565b64800000000083166112bf575b64400000000083166112ad575b642000000000831661129b575b6410000000008316611289575b6408000000008316611277575b6404000000008316611265575b6402000000008316611253575b640100000000831615610df757680100000000b17217f802831c610df7565b68010000000162e42ff102831c611234565b680100000002c5c85fe302831c611227565b6801000000058b90bfce02831c61121a565b68010000000b17217fbb02831c61120d565b6801000000162e42fff002831c611200565b68010000002c5c8601cc02831c6111f3565b680100000058b90c0b4902831c6111e6565b6580000000000083166113bf575b6540000000000083166113ad575b65200000000000831661139b575b651000000000008316611389575b650800000000008316611377575b650400000000008316611365575b650200000000008316611353575b65010000000000831615610dea576801000000b17218355102831c610dea565b680100000162e430e5a202831c611333565b6801000002c5c863b73f02831c611325565b68010000058b90cf1e6e02831c611317565b680100000b1721bcfc9a02831c611309565b68010000162e43f4f83102831c6112fb565b680100002c5c89d5ec6d02831c6112ed565b6801000058b91b5bc9ae02831c6112df565b668000000000000083166114c7575b664000000000000083166114b5575b662000000000000083166114a3575b66100000000000008316611491575b6608000000000000831661147f575b6604000000000000831661146d575b6602000000000000831661145b575b6601000000000000831615610ddc5768010000b17255775c0402831c610ddc565b6801000162e525ee054702831c61143a565b68010002c5cc37da949202831c61142b565b680100058ba01fb9f96d02831c61141c565b6801000b175effdc76ba02831c61140d565b680100162f3904051fa102831c6113fe565b6801002c605e2e8cec5002831c6113ef565b68010058c86da1c09ea202831c6113e0565b67800000000000000083166115d7575b67400000000000000083166115c5575b67200000000000000083166115b3575b67100000000000000083166115a1575b670800000000000000831661158f575b670400000000000000831661157d575b670200000000000000831661156b575b670100000000000000831615610dcd57680100b1afa5abcbed6102831c610dcd565b68010163da9fb33356d802831c611549565b680102c9a3e778060ee702831c611539565b6801059b0d31585743ae02831c611529565b68010b5586cf9890f62a02831c611519565b6801172b83c7d517adce02831c611509565b6801306fe0a31b7152df02831c6114f9565b5068016a09e667f3bcc909607f1b6114e956fea26469706673582212202b7f96ad3870372b47dc953b76e8d0bdbcd67d99f98564b55e72f6c02bc2aa3a64736f6c634300081500330000000000000000000000005c5589fca76237ed00ba024e19b6c077a108f68700000000000000000000000000200ea4ee292e253e6ca07dba5edc07c8aa37a3000000000000000000000000531c7befe78b6496e5753815ab3d3cc024c1e842",
"nonce": "0xb",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [],
"libraries": [],
"pending": [
"0x25bc708e7a3943104d5f0d95739c2f28233b114c919cf4c345cf95765141bf04"
],
"returns": {},
"timestamp": 1697585431,
"chain": 5,
"multi": false,
"commit": "444a61b"
}
Loading
Loading