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

Boring Vault Decimals Script #16

Merged
merged 1 commit into from
Sep 8, 2024
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
2 changes: 1 addition & 1 deletion deployment-config/boba-eth-l1-08-09-24.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"protocolAdmin": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"base": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"baseDecimals": "18",
"boringVaultAndBaseDecimals": "18",
"boringVault": {
"boringVaultSalt": "0x1000000000000000000000000000000000000000000000000000000000000001",
"boringVaultName": "Boba Native Yield Nucleus Token",
Expand Down
2 changes: 1 addition & 1 deletion deployment-config/boba-eth-l2-08-09-24.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"protocolAdmin": "0x0888c3D797E13892C5e67cD802F93Ffe55Ea2826",
"base": "0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000",
"baseDecimals": "18",
"boringVaultAndBaseDecimals": "18",
"boringVault": {
"boringVaultSalt": "0x1000000000000000000000000000000000000000000000000000000000000001",
"boringVaultName": "Boba Native Yield Nucleus Token",
Expand Down
2 changes: 1 addition & 1 deletion deployment-config/fraxtal-eth-l1-08-13-24.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"protocolAdmin": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"base": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"baseDecimals": "18",
"boringVaultAndBaseDecimals": "18",
"boringVault": {
"boringVaultSalt": "0x1000000000000000000000000000000000000000000000000000000000000002",
"boringVaultName": "Fraxtal Native Yield Nucleus Token",
Expand Down
2 changes: 1 addition & 1 deletion deployment-config/fraxtal-eth-l2-08-13-24.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"protocolAdmin": "0x0888c3D797E13892C5e67cD802F93Ffe55Ea2826",
"base": "0xFC00000000000000000000000000000000000006",
"baseDecimals": "18",
"boringVaultAndBaseDecimals": "18",
"boringVault": {
"boringVaultSalt": "0x1000000000000000000000000000000000000000000000000000000000000002",
"boringVaultName": "Fraxtal Native Yield Nucleus Token",
Expand Down
2 changes: 1 addition & 1 deletion deployment-config/sei-eth-l1-08-08-24.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"protocolAdmin": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"base": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"baseDecimals": "18",
"boringVaultAndBaseDecimals": "18",
"boringVault":{
"boringVaultSalt": "0x100000000000000000000000000000000000000000000000000000000000000a",
"boringVaultName": "Sei Native Yield Nucleus Token",
Expand Down
2 changes: 1 addition & 1 deletion deployment-config/sei-eth-l2-08-08-24.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"protocolAdmin": "0xF2dE1311C5b2C1BD94de996DA13F80010453e505",
"base": "0x160345fC359604fC6e70E3c5fAcbdE5F7A9342d8",
"baseDecimals": "18",
"boringVaultAndBaseDecimals": "18",
"boringVault":{
"boringVaultSalt": "0x1000000000000000000000000000000000000000000000000000000000000000",
"boringVaultName": "Sei Native Yield Nucleus Token",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"protocolAdmin": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"base": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"baseDecimals": "8",
"boringVaultAndBaseDecimals": "8",

"boringVault":{
"boringVaultSalt": "0x100000000000000000000000000000000000000000000000000000000000000b",
"boringVaultName": "Swell Native Yield Nucleus Token",
"boringVaultSalt": "0x100000000000000000000000000000000000000000000000000000000000000c",
"boringVaultName": "Swell BTC Native Yield Nucleus Token",
"boringVaultSymbol": "rswBTC",

"address": "0x0000000000000000000000000000000000000000"
},

"manager":{
"managerSalt": "0x200000000000000000000000000000000000000000000000000000000000000b",
"managerSalt": "0x200000000000000000000000000000000000000000000000000000000000000c",

"address": "0x0000000000000000000000000000000000000000"
},

"accountant":{
"accountantSalt": "0x300000000000000000000000000000000000000000000000000000000000000b",
"accountantSalt": "0x300000000000000000000000000000000000000000000000000000000000000c",
"payoutAddress": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"allowedExchangeRateChangeUpper": "10030",
"allowedExchangeRateChangeLower": "9980",
Expand All @@ -29,7 +29,7 @@
},

"teller": {
"tellerSalt": "0x400000000000000000000000000000000000000000000000000000000000000a",
"tellerSalt": "0x400000000000000000000000000000000000000000000000000000000000000c",
"maxGasForPeer": 200000,
"minGasForPeer": 60000,
"peerEid": 0,
Expand All @@ -41,7 +41,7 @@
"address": "0x0000000000000000000000000000000000000000"
},
"rolesAuthority": {
"rolesAuthoritySalt": "0x500000000000000000000000000000000000000000000000000000000000000b",
"rolesAuthoritySalt": "0x500000000000000000000000000000000000000000000000000000000000000c",
"strategist": "0x0000000000417626Ef34D62C4DC189b021603f2F",
"exchangeRateBot": "0x0000000000417626Ef34D62C4DC189b021603f2F",

Expand Down
4 changes: 2 additions & 2 deletions script/ConfigReader.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ library ConfigReader {
struct Config {
address protocolAdmin;
address base;
uint8 baseDecimals;
uint8 boringVaultAndBaseDecimals;
bytes32 accountantSalt;
address boringVault;
address payoutAddress;
Expand Down Expand Up @@ -58,7 +58,7 @@ library ConfigReader {
// Reading the 'protocolAdmin'
config.protocolAdmin = _config.readAddress(".protocolAdmin");
config.base = _config.readAddress(".base");
config.baseDecimals = uint8(_config.readUint(".baseDecimals"));
config.boringVaultAndBaseDecimals = uint8(_config.readUint(".boringVaultAndBaseDecimals"));

// Reading from the 'accountant' section
config.accountant = _config.readAddress(".accountant.address");
Expand Down
7 changes: 5 additions & 2 deletions script/deploy/single/02_DeployBoringVault.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity 0.8.21;
import { BoringVault } from "./../../../src/base/BoringVault.sol";
import { BaseScript } from "./../../Base.s.sol";
import { ConfigReader } from "../../ConfigReader.s.sol";
import { ERC20 } from "@solmate/tokens/ERC20.sol";
import { stdJson as StdJson } from "@forge-std/StdJson.sol";

contract DeployIonBoringVaultScript is BaseScript {
Expand Down Expand Up @@ -31,7 +32,7 @@ contract DeployIonBoringVaultScript is BaseScript {
broadcaster,
config.boringVaultName,
config.boringVaultSymbol,
18 // decimals
config.boringVaultAndBaseDecimals // decimals
)
)
)
Expand All @@ -41,7 +42,9 @@ contract DeployIonBoringVaultScript is BaseScript {
// Post Deploy Checks
require(boringVault.owner() == broadcaster, "owner should be the deployer");
require(address(boringVault.hook()) == address(0), "before transfer hook should be zero");

require(
boringVault.decimals() == ERC20(config.base).decimals(), "boringVault decimals should be the same as base"
);
return address(boringVault);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ contract DeployAccountantWithRateProviders is BaseScript {
require(config.minimumUpdateDelayInSeconds >= 3600, "minimumUpdateDelayInSeconds");
require(config.managementFee < 1e4, "managementFee");
require(
startingExchangeRate == 10 ** config.baseDecimals,
"starting exchange rate must be equal to base decimals"
startingExchangeRate == 10 ** config.boringVaultAndBaseDecimals,
"starting exchange rate must be equal to the boringVault and base decimals"
);
}
// Create Contract
Expand Down
Loading