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

chore: remove ETH caps #362

Open
wants to merge 6 commits into
base: v1.0
Choose a base branch
from
Open
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 changes: 5 additions & 0 deletions .changeset/mighty-bears-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fuel-bridge/solidity-contracts': patch
---

Removed mainnet deposit caps
287 changes: 287 additions & 0 deletions packages/solidity-contracts/.openzeppelin/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,293 @@
},
"namespaces": {}
}
},
"4d889abe65ff220ebe9e241fbf36784759794c6eea3e7f46740f2babb705751b": {
"address": "0x2C4df10a82CF077122eD99573acA6daCd76F2E67",
"txHash": "0xaaa628d33a2247ea28a9db05472e879c8aa63689a2561c947dfc8facac06ce11",
"layout": {
"solcVersion": "0.8.9",
"storage": [
{
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68"
},
{
"label": "__gap",
"offset": 0,
"slot": "1",
"type": "t_array(t_uint256)50_storage",
"contract": "ContextUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40"
},
{
"label": "_paused",
"offset": 0,
"slot": "51",
"type": "t_bool",
"contract": "PausableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29"
},
{
"label": "__gap",
"offset": 0,
"slot": "52",
"type": "t_array(t_uint256)49_storage",
"contract": "PausableUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116"
},
{
"label": "__gap",
"offset": 0,
"slot": "101",
"type": "t_array(t_uint256)50_storage",
"contract": "ERC165Upgradeable",
"src": "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol:41"
},
{
"label": "_roles",
"offset": 0,
"slot": "151",
"type": "t_mapping(t_bytes32,t_struct(RoleData)23_storage)",
"contract": "AccessControlUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:57"
},
{
"label": "__gap",
"offset": 0,
"slot": "152",
"type": "t_array(t_uint256)49_storage",
"contract": "AccessControlUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol:260"
},
{
"label": "_status",
"offset": 0,
"slot": "201",
"type": "t_uint256",
"contract": "ReentrancyGuardUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38"
},
{
"label": "__gap",
"offset": 0,
"slot": "202",
"type": "t_array(t_uint256)49_storage",
"contract": "ReentrancyGuardUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:88"
},
{
"label": "__gap",
"offset": 0,
"slot": "251",
"type": "t_array(t_uint256)50_storage",
"contract": "ERC1967UpgradeUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:169"
},
{
"label": "__gap",
"offset": 0,
"slot": "301",
"type": "t_array(t_uint256)50_storage",
"contract": "UUPSUpgradeable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol:111"
},
{
"label": "_incomingMessageSender",
"offset": 0,
"slot": "351",
"type": "t_bytes32",
"contract": "FuelMessagePortal",
"src": "contracts/fuelchain/FuelMessagePortal.sol:96"
},
{
"label": "_fuelChainState",
"offset": 0,
"slot": "352",
"type": "t_contract(FuelChainState)3385",
"contract": "FuelMessagePortal",
"src": "contracts/fuelchain/FuelMessagePortal.sol:99"
},
{
"label": "_outgoingMessageNonce",
"offset": 0,
"slot": "353",
"type": "t_uint256",
"contract": "FuelMessagePortal",
"src": "contracts/fuelchain/FuelMessagePortal.sol:102"
},
{
"label": "_incomingMessageSuccessful",
"offset": 0,
"slot": "354",
"type": "t_mapping(t_bytes32,t_bool)",
"contract": "FuelMessagePortal",
"src": "contracts/fuelchain/FuelMessagePortal.sol:105"
},
{
"label": "__gap",
"offset": 0,
"slot": "355",
"type": "t_array(t_uint256)49_storage",
"contract": "FuelMessagePortal",
"src": "contracts/fuelchain/FuelMessagePortal.sol:337"
},
{
"label": "totalDeposited",
"offset": 0,
"slot": "404",
"type": "t_uint256",
"contract": "FuelMessagePortalV2",
"src": "contracts/fuelchain/FuelMessagePortal/v2/FuelMessagePortalV2.sol:14"
},
{
"label": "__gap",
"offset": 0,
"slot": "405",
"type": "t_array(t_uint256)49_storage",
"contract": "FuelMessagePortalV2",
"src": "contracts/fuelchain/FuelMessagePortal/v2/FuelMessagePortalV2.sol:108"
},
{
"label": "withdrawalsPaused",
"offset": 0,
"slot": "454",
"type": "t_bool",
"contract": "FuelMessagePortalV3",
"src": "contracts/fuelchain/FuelMessagePortal/v3/FuelMessagePortalV3.sol:31"
},
{
"label": "messageIsBlacklisted",
"offset": 0,
"slot": "455",
"type": "t_mapping(t_bytes32,t_bool)",
"contract": "FuelMessagePortalV3",
"src": "contracts/fuelchain/FuelMessagePortal/v3/FuelMessagePortalV3.sol:33"
},
{
"label": "currentPeriodAmount",
"offset": 0,
"slot": "456",
"type": "t_uint256",
"contract": "FuelMessagePortalV3",
"src": "contracts/fuelchain/FuelMessagePortal/v3/FuelMessagePortalV3.sol:36"
},
{
"label": "currentPeriodEnd",
"offset": 0,
"slot": "457",
"type": "t_uint256",
"contract": "FuelMessagePortalV3",
"src": "contracts/fuelchain/FuelMessagePortal/v3/FuelMessagePortalV3.sol:39"
},
{
"label": "limitAmount",
"offset": 0,
"slot": "458",
"type": "t_uint256",
"contract": "FuelMessagePortalV3",
"src": "contracts/fuelchain/FuelMessagePortal/v3/FuelMessagePortalV3.sol:42"
},
{
"label": "rateLimitEnabled",
"offset": 0,
"slot": "459",
"type": "t_bool",
"contract": "FuelMessagePortalV3",
"src": "contracts/fuelchain/FuelMessagePortal/v3/FuelMessagePortalV3.sol:45"
},
{
"label": "__gap",
"offset": 0,
"slot": "460",
"type": "t_array(t_uint256)48_storage",
"contract": "FuelMessagePortalV3",
"src": "contracts/fuelchain/FuelMessagePortal/v3/FuelMessagePortalV3.sol:266"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_uint256)48_storage": {
"label": "uint256[48]",
"numberOfBytes": "1536"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]",
"numberOfBytes": "1568"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]",
"numberOfBytes": "1600"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_bytes32": {
"label": "bytes32",
"numberOfBytes": "32"
},
"t_contract(FuelChainState)3385": {
"label": "contract FuelChainState",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_bool)": {
"label": "mapping(address => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_bytes32,t_bool)": {
"label": "mapping(bytes32 => bool)",
"numberOfBytes": "32"
},
"t_mapping(t_bytes32,t_struct(RoleData)23_storage)": {
"label": "mapping(bytes32 => struct AccessControlUpgradeable.RoleData)",
"numberOfBytes": "32"
},
"t_struct(RoleData)23_storage": {
"label": "struct AccessControlUpgradeable.RoleData",
"members": [
{
"label": "members",
"type": "t_mapping(t_address,t_bool)",
"offset": 0,
"slot": "0"
},
{
"label": "adminRole",
"type": "t_bytes32",
"offset": 0,
"slot": "1"
}
],
"numberOfBytes": "64"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
}
},
"namespaces": {}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { password } from '@inquirer/prompts';
import type { TransactionResponse } from 'ethers';
import { MaxUint256 } from 'ethers';
import type { HardhatRuntimeEnvironment } from 'hardhat/types';
import type { DeployFunction } from 'hardhat-deploy/dist/types';

import { FuelMessagePortalV3__factory as FuelMessagePortalV3 } from '../../typechain';

const RATE_LIMIT_DURATION = 3600 * 24 * 7;
Copy link
Contributor

@viraj124 viraj124 Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - we can fetch the RATE_LIMIT_DURATION from theconstants file


const ETH_DEPOSIT_CAP = MaxUint256;

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {
ethers,
upgrades: { prepareUpgrade },
deployments: { get, save },
} = hre;

const privateKey = await password({ message: 'Enter private key' });
const deployer = new ethers.Wallet(privateKey, ethers.provider);

const { address } = await get('FuelMessagePortal');

const constructorArgs = [ETH_DEPOSIT_CAP.toString(), RATE_LIMIT_DURATION];

const tx = (await prepareUpgrade(address, new FuelMessagePortalV3(deployer), {
constructorArgs,
getTxResponse: true,
})) as TransactionResponse;
const receipt = await tx.wait();

const implementation = receipt?.contractAddress;

if (!implementation) {
throw new Error('No contract in receipt');
}

console.log('Proposed FuelMessagePortal upgrade to', implementation);
await save('FuelMessagePortal', {
address,
abi: [...FuelMessagePortalV3.abi],
implementation,
transactionHash: tx.hash,
linkedData: { factory: 'FuelMessagePortalV3', constructorArgs },
});

return true;
};

func.tags = ['20_upgrade_portal'];
func.id = '20_upgrade_portal';
export default func;
Loading
Loading