From d0ec99be03c545e73b410589b206e1decce4f06b Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Mon, 26 Aug 2024 13:48:18 +0200 Subject: [PATCH] Solidity v1.1.0 release This commit contains artifacts of contracts deployed on mainnet in v1.1.0 release. It also updates version in package.json. --- solidity/.openzeppelin/mainnet.json | 566 ++++++++++++++++++ .../deployments/mainnet/MezoAllocator.json | 4 +- solidity/deployments/mainnet/stBTC.json | 289 ++++++++- solidity/package.json | 2 +- 4 files changed, 856 insertions(+), 5 deletions(-) diff --git a/solidity/.openzeppelin/mainnet.json b/solidity/.openzeppelin/mainnet.json index ce9bc9d0e..22afde212 100644 --- a/solidity/.openzeppelin/mainnet.json +++ b/solidity/.openzeppelin/mainnet.json @@ -907,6 +907,572 @@ ] } } + }, + "ec48019fb0dee58e77901ea8425091aaa66342367524e5da16ebd9ea91104f44": { + "address": "0xeF96B93Db617F3DB5b2Cf2dF9AA50BD7f5cb22c4", + "txHash": "0x1cb1f3b7199d0664dbe23926210a1baa2e04a5d12805678c655a05b902d9e2f7", + "layout": { + "solcVersion": "0.8.24", + "storage": [ + { + "label": "nonFungibleWithdrawalsEnabled", + "offset": 0, + "slot": "0", + "type": "t_bool", + "contract": "ERC4626NonFungibleWithdrawals", + "src": "contracts/lib/ERC4626NonFungibleWithdrawals.sol:17" + }, + { + "label": "withdrawableShares", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC4626NonFungibleWithdrawals", + "src": "contracts/lib/ERC4626NonFungibleWithdrawals.sol:21" + }, + { + "label": "__gap", + "offset": 0, + "slot": "2", + "type": "t_array(t_uint256)49_storage", + "contract": "ERC4626NonFungibleWithdrawals", + "src": "contracts/lib/ERC4626NonFungibleWithdrawals.sol:29" + }, + { + "label": "pauseAdmin", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "PausableOwnable", + "src": "contracts/PausableOwnable.sol:19" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableOwnable", + "src": "contracts/PausableOwnable.sol:27" + }, + { + "label": "dispatcher", + "offset": 0, + "slot": "101", + "type": "t_contract(IDispatcher)11763", + "contract": "stBTC", + "src": "contracts/stBTC.sol:29" + }, + { + "label": "treasury", + "offset": 0, + "slot": "102", + "type": "t_address", + "contract": "stBTC", + "src": "contracts/stBTC.sol:32" + }, + { + "label": "minimumDepositAmount", + "offset": 0, + "slot": "103", + "type": "t_uint256", + "contract": "stBTC", + "src": "contracts/stBTC.sol:39" + }, + { + "label": "entryFeeBasisPoints", + "offset": 0, + "slot": "104", + "type": "t_uint256", + "contract": "stBTC", + "src": "contracts/stBTC.sol:42" + }, + { + "label": "exitFeeBasisPoints", + "offset": 0, + "slot": "105", + "type": "t_uint256", + "contract": "stBTC", + "src": "contracts/stBTC.sol:45" + }, + { + "label": "allowedDebt", + "offset": 0, + "slot": "106", + "type": "t_mapping(t_address,t_uint256)", + "contract": "stBTC", + "src": "contracts/stBTC.sol:49" + }, + { + "label": "currentDebt", + "offset": 0, + "slot": "107", + "type": "t_mapping(t_address,t_uint256)", + "contract": "stBTC", + "src": "contracts/stBTC.sol:52" + }, + { + "label": "totalDebt", + "offset": 0, + "slot": "108", + "type": "t_uint256", + "contract": "stBTC", + "src": "contracts/stBTC.sol:58" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IERC20)1153": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(ERC20Storage)641_storage": { + "label": "struct ERC20Upgradeable.ERC20Storage", + "members": [ + { + "label": "_balances", + "type": "t_mapping(t_address,t_uint256)", + "offset": 0, + "slot": "0" + }, + { + "label": "_allowances", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "offset": 0, + "slot": "1" + }, + { + "label": "_totalSupply", + "type": "t_uint256", + "offset": 0, + "slot": "2" + }, + { + "label": "_name", + "type": "t_string_storage", + "offset": 0, + "slot": "3" + }, + { + "label": "_symbol", + "type": "t_string_storage", + "offset": 0, + "slot": "4" + } + ], + "numberOfBytes": "160" + }, + "t_struct(ERC4626Storage)735_storage": { + "label": "struct ERC4626Upgradeable.ERC4626Storage", + "members": [ + { + "label": "_asset", + "type": "t_contract(IERC20)1153", + "offset": 0, + "slot": "0" + }, + { + "label": "_underlyingDecimals", + "type": "t_uint8", + "offset": 20, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(InitializableStorage)560_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Ownable2StepStorage)467_storage": { + "label": "struct Ownable2StepUpgradeable.Ownable2StepStorage", + "members": [ + { + "label": "_pendingOwner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)509_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(PausableStorage)862_storage": { + "label": "struct PausableUpgradeable.PausableStorage", + "members": [ + { + "label": "_paused", + "type": "t_bool", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_contract(IDispatcher)11763": { + "label": "contract IDispatcher", + "numberOfBytes": "20" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable2Step": [ + { + "contract": "Ownable2StepUpgradeable", + "label": "_pendingOwner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol:23", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Pausable": [ + { + "contract": "PausableUpgradeable", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol:21", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.ERC4626": [ + { + "contract": "ERC4626Upgradeable", + "label": "_asset", + "type": "t_contract(IERC20)1153", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol:56", + "offset": 0, + "slot": "0" + }, + { + "contract": "ERC4626Upgradeable", + "label": "_underlyingDecimals", + "type": "t_uint8", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol:57", + "offset": 20, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.ERC20": [ + { + "contract": "ERC20Upgradeable", + "label": "_balances", + "type": "t_mapping(t_address,t_uint256)", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:38", + "offset": 0, + "slot": "0" + }, + { + "contract": "ERC20Upgradeable", + "label": "_allowances", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:40", + "offset": 0, + "slot": "1" + }, + { + "contract": "ERC20Upgradeable", + "label": "_totalSupply", + "type": "t_uint256", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:42", + "offset": 0, + "slot": "2" + }, + { + "contract": "ERC20Upgradeable", + "label": "_name", + "type": "t_string_storage", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44", + "offset": 0, + "slot": "3" + }, + { + "contract": "ERC20Upgradeable", + "label": "_symbol", + "type": "t_string_storage", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:45", + "offset": 0, + "slot": "4" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } + }, + "196d9c8c15d809048499d7676a9485cfe93d4a2cf7335fe6565565e0b5736553": { + "address": "0x3E1d7ea6C2F5A39E90a21450a57269ca50e2b5Df", + "txHash": "0x66756cfdbc0ce0850910b24657e3b7905b35c3c716a399ffc14200b8a2cfbbdb", + "layout": { + "solcVersion": "0.8.24", + "storage": [ + { + "label": "mezoPortal", + "offset": 0, + "slot": "0", + "type": "t_contract(IMezoPortal)11031", + "contract": "MezoAllocator", + "src": "contracts/MezoAllocator.sol:107" + }, + { + "label": "tbtc", + "offset": 0, + "slot": "1", + "type": "t_contract(IERC20)6686", + "contract": "MezoAllocator", + "src": "contracts/MezoAllocator.sol:109" + }, + { + "label": "stbtc", + "offset": 0, + "slot": "2", + "type": "t_contract(stBTC)13251", + "contract": "MezoAllocator", + "src": "contracts/MezoAllocator.sol:111" + }, + { + "label": "isMaintainer", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_bool)", + "contract": "MezoAllocator", + "src": "contracts/MezoAllocator.sol:114" + }, + { + "label": "maintainers", + "offset": 0, + "slot": "4", + "type": "t_array(t_address)dyn_storage", + "contract": "MezoAllocator", + "src": "contracts/MezoAllocator.sol:116" + }, + { + "label": "depositId", + "offset": 0, + "slot": "5", + "type": "t_uint256", + "contract": "MezoAllocator", + "src": "contracts/MezoAllocator.sol:118" + }, + { + "label": "depositBalance", + "offset": 0, + "slot": "6", + "type": "t_uint96", + "contract": "MezoAllocator", + "src": "contracts/MezoAllocator.sol:120" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_struct(InitializableStorage)560_storage": { + "label": "struct Initializable.InitializableStorage", + "members": [ + { + "label": "_initialized", + "type": "t_uint64", + "offset": 0, + "slot": "0" + }, + { + "label": "_initializing", + "type": "t_bool", + "offset": 8, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Ownable2StepStorage)467_storage": { + "label": "struct Ownable2StepUpgradeable.Ownable2StepStorage", + "members": [ + { + "label": "_pendingOwner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_struct(OwnableStorage)509_storage": { + "label": "struct OwnableUpgradeable.OwnableStorage", + "members": [ + { + "label": "_owner", + "type": "t_address", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_array(t_address)dyn_storage": { + "label": "address[]", + "numberOfBytes": "32" + }, + "t_contract(IERC20)6686": { + "label": "contract IERC20", + "numberOfBytes": "20" + }, + "t_contract(IMezoPortal)11031": { + "label": "contract IMezoPortal", + "numberOfBytes": "20" + }, + "t_contract(stBTC)13251": { + "label": "contract stBTC", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint96": { + "label": "uint96", + "numberOfBytes": "12" + } + }, + "namespaces": { + "erc7201:openzeppelin.storage.Ownable2Step": [ + { + "contract": "Ownable2StepUpgradeable", + "label": "_pendingOwner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol:23", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Ownable": [ + { + "contract": "OwnableUpgradeable", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:24", + "offset": 0, + "slot": "0" + } + ], + "erc7201:openzeppelin.storage.Initializable": [ + { + "contract": "Initializable", + "label": "_initialized", + "type": "t_uint64", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:69", + "offset": 0, + "slot": "0" + }, + { + "contract": "Initializable", + "label": "_initializing", + "type": "t_bool", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:73", + "offset": 8, + "slot": "0" + } + ] + } + } } } } diff --git a/solidity/deployments/mainnet/MezoAllocator.json b/solidity/deployments/mainnet/MezoAllocator.json index 168cbb6eb..97cf02439 100644 --- a/solidity/deployments/mainnet/MezoAllocator.json +++ b/solidity/deployments/mainnet/MezoAllocator.json @@ -507,7 +507,7 @@ } ], "transactionHash": "0xd8697b2b901533c5f0efaf73a700f6d56518e287678527e9eda4e92d439f2d15", - "numDeployments": 1, - "implementation": "0xb9Ee960AD3c70C319cD3253eEe40D4de5F25F423", + "numDeployments": 2, + "implementation": "0x3E1d7ea6C2F5A39E90a21450a57269ca50e2b5Df", "devdoc": "Contract deployed as upgradable proxy" } \ No newline at end of file diff --git a/solidity/deployments/mainnet/stBTC.json b/solidity/deployments/mainnet/stBTC.json index 9bc2572c3..43d37b0d0 100644 --- a/solidity/deployments/mainnet/stBTC.json +++ b/solidity/deployments/mainnet/stBTC.json @@ -213,6 +213,27 @@ "name": "ExceedsMaxFeeBasisPoints", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "debtor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "debt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ExcessiveDebtRepayment", + "type": "error" + }, { "inputs": [], "name": "ExpectedPause", @@ -223,6 +244,27 @@ "name": "FailedInnerCall", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "debtor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "InsufficientDebtAllowance", + "type": "error" + }, { "inputs": [], "name": "InvalidInitialization", @@ -343,6 +385,87 @@ "name": "Approval", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "debtor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newAllowance", + "type": "uint256" + } + ], + "name": "DebtAllowanceUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "debtor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentDebt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "DebtMinted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "debtor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentDebt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "assets", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "DebtRepaid", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -646,6 +769,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowedDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -750,6 +892,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -788,6 +943,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "currentDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "decimals", @@ -1002,6 +1176,48 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "mintDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mintReceipt", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "name", @@ -1144,6 +1360,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "previewRepayDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -1199,6 +1434,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "repayDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "assets", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "symbol", @@ -1225,6 +1479,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "totalDebt", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "totalSupply", @@ -1324,6 +1591,24 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "debtor", + "type": "address" + }, + { + "internalType": "uint256", + "name": "newAllowance", + "type": "uint256" + } + ], + "name": "updateDebtAllowance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1452,7 +1737,7 @@ } ], "transactionHash": "0x0a24c3986f542ca95778e4ab4124d9ba737d2ef935da784fa551f43106041854", - "numDeployments": 1, - "implementation": "0xF71Fc6eAB5835b9254e5C81500eb979Aea042a7e", + "numDeployments": 2, + "implementation": "0xeF96B93Db617F3DB5b2Cf2dF9AA50BD7f5cb22c4", "devdoc": "Contract deployed as upgradable proxy" } \ No newline at end of file diff --git a/solidity/package.json b/solidity/package.json index 35d249596..8b9cedd82 100644 --- a/solidity/package.json +++ b/solidity/package.json @@ -1,6 +1,6 @@ { "name": "@acre-btc/contracts", - "version": "0.2.0-dev", + "version": "1.1.0", "description": "Bitcoin Liquid Staking", "license": "GPL-3.0-only", "files": [