diff --git a/.gitignore b/.gitignore index 6062c68..f197e62 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ cache/ out/ node_modules -broadcast \ No newline at end of file +broadcast +.env \ No newline at end of file diff --git a/README.md b/README.md index 8184a45..fc06d29 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,27 @@ -## Getting Started + +## Deployments + +The contract is deployed on Goerli and Mainnet: + +| Chain | Address | +| -------- | -------- | +| Mainnet | [0x5caec004f1378fbfd54a11e9f00e2aad32796b33](https://etherscan.io/address/0x5caec004f1378fbfd54a11e9f00e2aad32796b33#readContract) | +| Goerli | [0x5caec004f1378fbfd54a11e9f00e2aad32796b33](https://goerli.etherscan.io/address/0x5caec004f1378fbfd54a11e9f00e2aad32796b33#readContract) | + +### Using the contract + +You can use cast to directly query the value as follow (mainnet rpc example): + +``` +cast call 0x5caec004f1378fbfd54a11e9f00e2aad32796b33 "getEthTwaIV(uint32)(uint256)" 120 --rpc-url https://rpc.ankr.com/eth +``` + +## Development + +### Getting Started Compile and run tests @@ -21,9 +41,10 @@ forge build forge test ``` -### Using the contract -The contract is still in development phase and not yet deployed. But you can already stimulate the gas cost and result of the current mainnet state with foundry script: +### Estimation + +You can clone the contract, tune in a bit and use the following script to estimate real world vol value. ```shell forge script scripts/Deploy.sol --fork-url @@ -39,14 +60,6 @@ Output: ``` -### Deployment - -Run the script to deploy your own contract instance on mainnet. - -```shell -forge script scripts/Deploy.sol --fork-url --broadcast --verify -vvvv -``` - #### Gas Cost The gas cost is around 46K ~ 140K, depends on: diff --git a/lib/forge-std b/lib/forge-std index 6b4ca42..2a2ce36 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 6b4ca42943f093642bac31783b08aa52a5a6ff64 +Subproject commit 2a2ce3692b8c1523b29de3ec9d961ee9fbbc43a6 diff --git a/scripts/Deploy.sol b/scripts/Deploy.sol index 28eac0c..0fb2161 100644 --- a/scripts/Deploy.sol +++ b/scripts/Deploy.sol @@ -17,6 +17,8 @@ contract Deploy is Script { assembly { chainId := chainid() } require(chainId == 1 || chainId == 5, "wrong chain"); + console.log("deployer: ", msg.sender); + deploy(chainId); vm.stopBroadcast();