Skip to content
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
5,893 changes: 0 additions & 5,893 deletions spot-contracts/.openzeppelin/goerli.json

This file was deleted.

901 changes: 901 additions & 0 deletions spot-contracts/.openzeppelin/sepolia.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions spot-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ yarn test

### Testnets

There is a testnet deployment on Goerli.
There is a testnet deployment on Sepolia.

- SPOT ERC-20 Token: [0x95014Bc18F82a98CFAA3253fbD3184125A01f848](https://goerli.etherscan.io//address/0x95014Bc18F82a98CFAA3253fbD3184125A01f848)
- Bond issuer: [0xbC060a1EbEC5eC869C4D51d4563244d4a223D307](https://goerli.etherscan.io//address/0xbC060a1EbEC5eC869C4D51d4563244d4a223D307)
- Router: [0x5e902bdCC408550b4BD612678bE2d57677664Dc9](https://goerli.etherscan.io//address/0x5e902bdCC408550b4BD612678bE2d57677664Dc9)
- RolloverVault: [0xca36B64BEbdf141623911987b93767dcA4bF6F1f](https://goerli.etherscan.io//address/0xca36B64BEbdf141623911987b93767dcA4bF6F1f)
- SPOT ERC-20 Token: [0xdcCef9065876fD654bAddeBAa778FDA43E0bfC1F](https://sepolia.etherscan.io//address/0xdcCef9065876fD654bAddeBAa778FDA43E0bfC1F)
- Bond issuer: [0x3838C8d4D092d40Cb27DD22Dafc6E1A81ea2DB60](https://sepolia.etherscan.io//address/0x3838C8d4D092d40Cb27DD22Dafc6E1A81ea2DB60)
- Router: [0x5B59915E5754C62C40Ba5e7467382ced958F8559](https://sepolia.etherscan.io//address/0x5B59915E5754C62C40Ba5e7467382ced958F8559)
- RolloverVault: [0x107614c6602A8e602952Da107B8fE62b5Ab13b04](https://sepolia.etherscan.io//address/0x107614c6602A8e602952Da107B8fE62b5Ab13b04)

## Contribute

Expand Down
13 changes: 0 additions & 13 deletions spot-contracts/deployments/goerli.json

This file was deleted.

13 changes: 13 additions & 0 deletions spot-contracts/deployments/sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"network": "sepolia",
"startBlock": 5492003,
"ampl": "0x251410f849ad67bebffdb5a549e5f02d5d9c25ba",
"bondFactory": "0x25BcaEd6377CEAA345f12C2005a42e669B8a29fC",
"bondIssuer": "0x3838C8d4D092d40Cb27DD22Dafc6E1A81ea2DB60",
"previousIssuers": [],
"proxyAdmin": "0x0584042677d469C0B95775368cF1EFfe9cc222F5",
"feePolicy": "0x2DdF288F26490D1147296cC0FA2B3c4da5E15f10",
"spot": "0xdcCef9065876fD654bAddeBAa778FDA43E0bfC1F",
"vault": "0x107614c6602A8e602952Da107B8fE62b5Ab13b04",
"router": "0x5B59915E5754C62C40Ba5e7467382ced958F8559"
}
8 changes: 4 additions & 4 deletions spot-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ export default {
url: "http://127.0.0.1:8545",
chainId: 1337,
},
goerli: {
// url: `https://goerli.infura.io/v3/${process.env.INFURA_SECRET}`,
url: `https://eth-goerli.g.alchemy.com/v2/${process.env.ALCHEMY_SECRET}`,
sepolia: {
// url: `https://sepolia.infura.io/v3/${process.env.INFURA_SECRET}`,
url: `https://eth-sepolia.g.alchemy.com/v2/${process.env.ALCHEMY_SECRET}`,
accounts: {
mnemonic: process.env.PROD_MNEMONIC || Wallet.createRandom().mnemonic.phrase,
},
gasMultiplier: 1.03,
gasMultiplier: 1.01,
},
mainnet: {
// url: `https://mainnet.infura.io/v3/${process.env.INFURA_SECRET}`,
Expand Down
91 changes: 0 additions & 91 deletions spot-contracts/tasks/goeril.sh

This file was deleted.

2 changes: 1 addition & 1 deletion spot-contracts/tasks/ops/vaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ task("ops:vault:info")
console.log(
"deviationRatio:",
utils.formatUnits(
await feePolicy["computeDeviationRatio(uint256,uint256,uint256)"](perpTVL, vaultTVL, seniorTR),
await feePolicy["computeDeviationRatio((uint256,uint256,uint256))"]([perpTVL, vaultTVL, seniorTR]),
feeDecimals,
),
);
Expand Down
89 changes: 89 additions & 0 deletions spot-contracts/tasks/sepolia.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
########################################################################
## DEPLOYMENT

yarn hardhat --network sepolia deploy:MockAMPL --verify "false"

yarn hardhat --network sepolia deploy:BondFactory --verify "false"

yarn hardhat --network sepolia deploy:BondIssuer \
--bond-factory-address "0x25BcaEd6377CEAA345f12C2005a42e669B8a29fC" \
--bond-duration "3600" \
--issue-frequency "1200" \
--issue-window-offset "0" \
--collateral-token-address "0x251410f849ad67bebffdb5a549e5f02d5d9c25ba" \
--tranche-ratios "[333,667]" \
--issue true

yarn hardhat --network sepolia deploy:PerpSystem \
--bond-issuer-address "0x3838C8d4D092d40Cb27DD22Dafc6E1A81ea2DB60" \
--collateral-token-address "0x251410f849ad67bebffdb5a549e5f02d5d9c25ba" \
--perp-name "SPOT" \
--perp-symbol "SPOT" \
--vault-name "Staked Ampleforth" \
--vault-symbol "stAMPL"

yarn hardhat --network sepolia deploy:Router

yarn hardhat --network sepolia ops:perp:updateTolerableTrancheMaturity \
--address 0xdcCef9065876fD654bAddeBAa778FDA43E0bfC1F \
--minimum 600 \
--maximum 3600

yarn hardhat --network sepolia ops:fee:setSwapFees \
--address "0x2DdF288F26490D1147296cC0FA2B3c4da5E15f10" \
--fee-perc "0.05"

########################################################################
## OPS
yarn hardhat --network sepolia ops:perp:info 0xdcCef9065876fD654bAddeBAa778FDA43E0bfC1F
yarn hardhat --network sepolia ops:vault:info 0x107614c6602A8e602952Da107B8fE62b5Ab13b04
yarn hardhat --network sepolia ops:perp:updateState 0xdcCef9065876fD654bAddeBAa778FDA43E0bfC1F
yarn hardhat --network sepolia ops:vault:recoverAndRedeploy \
--vault-address 0x107614c6602A8e602952Da107B8fE62b5Ab13b04
yarn hardhat --network sepolia ops:vault:deploy \
--vault-address 0x107614c6602A8e602952Da107B8fE62b5Ab13b04
yarn hardhat --network sepolia ops:vault:recover \
--vault-address 0x107614c6602A8e602952Da107B8fE62b5Ab13b04

yarn hardhat --network sepolia ops:rebase:MockAMPL \
--ampl-address "0x251410f849ad67bebffdb5a549e5f02d5d9c25ba" \
--rebase-perc 0.1

# Perp
yarn hardhat --network sepolia ops:perp:trancheAndDeposit \
--router-address 0x5B59915E5754C62C40Ba5e7467382ced958F8559 \
--perp-address 0xdcCef9065876fD654bAddeBAa778FDA43E0bfC1F \
--collateral-amount 250

yarn hardhat --network sepolia ops:perp:redeem \
--router-address 0x5B59915E5754C62C40Ba5e7467382ced958F8559 \
--perp-address 0xdcCef9065876fD654bAddeBAa778FDA43E0bfC1F \
--amount 10

## Vault
yarn hardhat --network sepolia ops:vault:deposit \
--vault-address 0x107614c6602A8e602952Da107B8fE62b5Ab13b04 \
--underlying-amount 250

yarn hardhat --network sepolia ops:vault:redeem \
--vault-address 0x107614c6602A8e602952Da107B8fE62b5Ab13b04 \
--amount "0.001"

yarn hardhat --network sepolia ops:vault:swapUnderlyingForPerps \
--vault-address 0x107614c6602A8e602952Da107B8fE62b5Ab13b04 \
--underlying-amount 10

yarn hardhat --network sepolia ops:vault:swapPerpsForUnderlying \
--vault-address 0x107614c6602A8e602952Da107B8fE62b5Ab13b04 \
--perp-amount 10

## Tranches
yarn hardhat --network sepolia ops:redeemTranches \
--bond-issuer-address 0x3838C8d4D092d40Cb27DD22Dafc6E1A81ea2DB60

########################################################################
## upgrade

yarn hardhat --network sepolia upgrade:perp:testnet 0xdcCef9065876fD654bAddeBAa778FDA43E0bfC1F

yarn hardhat --network sepolia upgrade:rolloverVault:testnet 0xca36B64BEbdf141623911987b93767dcA4bF6F1f