Skip to content

Commit

Permalink
chore: version 1.0.0 deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
antoncoding committed Oct 24, 2022
1 parent 7b49459 commit 20bd512
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cache/
out/
node_modules
broadcast
broadcast
.env
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,27 @@

</div>

## 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

Expand All @@ -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 <mainnet rpc>
Expand All @@ -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 <mainnet rpc> --broadcast --verify -vvvv
```

#### Gas Cost

The gas cost is around 46K ~ 140K, depends on:
Expand Down
2 changes: 2 additions & 0 deletions scripts/Deploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 20bd512

Please sign in to comment.