From cfbf07451880922318e2ec3f61835e78c314d8cb Mon Sep 17 00:00:00 2001 From: Akash Date: Wed, 11 Jun 2025 17:56:16 +0530 Subject: [PATCH 001/139] chore: package.json trace script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b61572d5..b9d1c8a9 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "compile": "forge build", "deploy": "bash setupInfraContracts.sh", "publish-core": "yarn build && yarn publish --patch --no-git-tag-version", - "trace":"bash trace.sh" + "trace":"source .env && bash trace.sh" }, "pre-commit": [], "author": "", From e38b8063fbf9b5b2938aea747c174a759e4efb21 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 16 Jun 2025 12:48:50 +0530 Subject: [PATCH 002/139] feat: added CCTP switchboard support --- contracts/evmx/interfaces/IAppGateway.sol | 4 + contracts/evmx/interfaces/IWatcher.sol | 1 - contracts/protocol/SocketBatcher.sol | 50 +++- .../protocol/interfaces/ICCTPSwitchboard.sol | 62 +++++ .../protocol/interfaces/IMessageHandler.sol | 21 ++ .../interfaces/IMessageTransmitter.sol | 19 ++ contracts/protocol/interfaces/ISocket.sol | 6 +- .../protocol/switchboard/CCTPSwitchboard.sol | 219 ++++++++++++++++++ contracts/utils/common/Constants.sol | 1 + contracts/utils/common/Structs.sol | 15 ++ package.json | 2 +- test/SetupTest.t.sol | 211 ++++++++++++++--- test/apps/CCTPSuperToken.t.sol | 179 ++++++++++++++ .../super-token/SuperTokenAppGateway.sol | 4 + test/mock/CCTPMessageTransmitter.sol | 78 +++++++ test/mock/MockSocket.sol | 6 - 16 files changed, 842 insertions(+), 36 deletions(-) create mode 100644 contracts/protocol/interfaces/ICCTPSwitchboard.sol create mode 100644 contracts/protocol/interfaces/IMessageHandler.sol create mode 100644 contracts/protocol/interfaces/IMessageTransmitter.sol create mode 100644 contracts/protocol/switchboard/CCTPSwitchboard.sol create mode 100644 test/apps/CCTPSuperToken.t.sol create mode 100644 test/mock/CCTPMessageTransmitter.sol diff --git a/contracts/evmx/interfaces/IAppGateway.sol b/contracts/evmx/interfaces/IAppGateway.sol index 132e8c96..3ec414b8 100644 --- a/contracts/evmx/interfaces/IAppGateway.sol +++ b/contracts/evmx/interfaces/IAppGateway.sol @@ -45,4 +45,8 @@ interface IAppGateway { bytes32 contractId_, uint32 chainSlug_ ) external view returns (address forwarderAddress); + + /// @notice get the switchboard type + /// @return sbType The switchboard type + function sbType() external view returns (bytes32); } diff --git a/contracts/evmx/interfaces/IWatcher.sol b/contracts/evmx/interfaces/IWatcher.sol index d601d8d7..7110b4eb 100644 --- a/contracts/evmx/interfaces/IWatcher.sol +++ b/contracts/evmx/interfaces/IWatcher.sol @@ -11,7 +11,6 @@ import "./IPromiseResolver.sol"; /// @notice Interface for the Watcher Precompile system that handles payload verification and execution /// @dev Defines core functionality for payload processing and promise resolution interface IWatcher { - function requestHandler__() external view returns (IRequestHandler); function configurations__() external view returns (IConfigurations); diff --git a/contracts/protocol/SocketBatcher.sol b/contracts/protocol/SocketBatcher.sol index 1013af2f..7e2384bd 100644 --- a/contracts/protocol/SocketBatcher.sol +++ b/contracts/protocol/SocketBatcher.sol @@ -5,8 +5,10 @@ import "solady/auth/Ownable.sol"; import "./interfaces/ISocket.sol"; import "./interfaces/ISocketBatcher.sol"; import "./interfaces/ISwitchboard.sol"; +import "./interfaces/ICCTPSwitchboard.sol"; import "../utils/RescueFundsLib.sol"; -import {ExecuteParams, TransmissionParams} from "../utils/common/Structs.sol"; +import {ExecuteParams, TransmissionParams, CCTPBatchParams, CCTPExecutionParams} from "../utils/common/Structs.sol"; +import {createPayloadId} from "../utils/common/IdUtils.sol"; /** * @title SocketBatcher @@ -55,6 +57,52 @@ contract SocketBatcher is ISocketBatcher, Ownable { ); } + function attestCCTPAndProveAndExecute( + CCTPExecutionParams calldata execParams_, + CCTPBatchParams calldata cctpParams_, + address switchboard_ + ) external payable returns (bool, bytes memory) { + bytes32 payloadId = _createPayloadId(execParams_.executeParams, switchboard_); + ICCTPSwitchboard(switchboard_).attest(payloadId, execParams_.digest, execParams_.proof); + + ICCTPSwitchboard(switchboard_).verifyAttestations( + cctpParams_.messages, + cctpParams_.attestations + ); + ICCTPSwitchboard(switchboard_).proveRemoteExecutions( + cctpParams_.previousPayloadIds, + payloadId, + execParams_.transmitterSignature, + execParams_.executeParams + ); + (bool success, bytes memory returnData) = socket__.execute{value: msg.value}( + execParams_.executeParams, + TransmissionParams({ + transmitterSignature: execParams_.transmitterSignature, + socketFees: 0, + extraData: execParams_.executeParams.extraData, + refundAddress: execParams_.refundAddress + }) + ); + + ICCTPSwitchboard(switchboard_).syncOut(payloadId, cctpParams_.nextBatchRemoteChainSlugs); + return (success, returnData); + } + + function _createPayloadId( + ExecuteParams memory executeParams_, + address switchboard_ + ) internal view returns (bytes32) { + return + createPayloadId( + executeParams_.requestCount, + executeParams_.batchCount, + executeParams_.payloadCount, + switchboard_, + socket__.chainSlug() + ); + } + /** * @notice Rescues funds from the contract * @param token_ The address of the token to rescue diff --git a/contracts/protocol/interfaces/ICCTPSwitchboard.sol b/contracts/protocol/interfaces/ICCTPSwitchboard.sol new file mode 100644 index 00000000..ac3bb40e --- /dev/null +++ b/contracts/protocol/interfaces/ICCTPSwitchboard.sol @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import "./ISwitchboard.sol"; +import {ExecuteParams} from "../../utils/common/Structs.sol"; + +/** + * @title ISwitchboard + * @dev The interface for a switchboard contract that is responsible for verification of payloads if the correct + * digest is executed. + */ +interface ICCTPSwitchboard is ISwitchboard { + /** + * @notice Attests a payload + * @param digest_ The digest of the payload + * @param proof_ The proof of the payload + */ + function attest(bytes32 payloadId_, bytes32 digest_, bytes calldata proof_) external; + + /** + * @notice Syncs out a payload to the remote chains + * @param payloadId_ The unique identifier for the payload + * @param remoteChainSlugs_ The remote chain slugs + */ + function syncOut(bytes32 payloadId_, uint32[] calldata remoteChainSlugs_) external; + + /** + * @notice Handles the receive message + * @param sourceDomain The source domain + * @param sender The sender + * @param messageBody The message body + */ + function handleReceiveMessage( + uint32 sourceDomain, + bytes32 sender, + bytes calldata messageBody + ) external returns (bool); + + /** + * @notice Proves the remote executions + * @param previousPayloadIds_ The previous payload ids + * @param currentPayloadId_ The current payload id + * @param transmitterSignature_ The transmitter signature + * @param executeParams_ The execute parameters + */ + function proveRemoteExecutions( + bytes32[] calldata previousPayloadIds_, + bytes32 currentPayloadId_, + bytes calldata transmitterSignature_, + ExecuteParams calldata executeParams_ + ) external; + + /** + * @notice Verifies the attestations + * @param messages_ The messages + * @param attestations_ The attestations + */ + function verifyAttestations( + bytes[] calldata messages_, + bytes[] calldata attestations_ + ) external; +} diff --git a/contracts/protocol/interfaces/IMessageHandler.sol b/contracts/protocol/interfaces/IMessageHandler.sol new file mode 100644 index 00000000..c6c29b10 --- /dev/null +++ b/contracts/protocol/interfaces/IMessageHandler.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; +/** + * @title IMessageHandler + * @notice Handles messages on destination domain forwarded from + * an IReceiver + */ +interface IMessageHandler { + /** + * @notice handles an incoming message from a Receiver + * @param sourceDomain the source domain of the message + * @param sender the sender of the message + * @param messageBody The message raw bytes + * @return success bool, true if successful + */ + function handleReceiveMessage( + uint32 sourceDomain, + bytes32 sender, + bytes calldata messageBody + ) external returns (bool); +} diff --git a/contracts/protocol/interfaces/IMessageTransmitter.sol b/contracts/protocol/interfaces/IMessageTransmitter.sol new file mode 100644 index 00000000..427f2813 --- /dev/null +++ b/contracts/protocol/interfaces/IMessageTransmitter.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +interface IMessageTransmitter { + function sendMessage( + uint32 destinationDomain, + bytes32 recipient, + bytes calldata messageBody + ) external returns (uint64 nonce); + + function receiveMessage( + bytes calldata message, + bytes calldata attestation + ) external returns (bool success); + + function localDomain() external view returns (uint32); + + function attestationManager() external view returns (address); +} diff --git a/contracts/protocol/interfaces/ISocket.sol b/contracts/protocol/interfaces/ISocket.sol index 80a8a25a..e27eaefd 100644 --- a/contracts/protocol/interfaces/ISocket.sol +++ b/contracts/protocol/interfaces/ISocket.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; -import {ExecuteParams, TransmissionParams} from "../../utils/common/Structs.sol"; +import {ExecuteParams, TransmissionParams, ExecutionStatus} from "../../utils/common/Structs.sol"; /** * @title ISocket @@ -76,4 +76,8 @@ interface ISocket { function getPlugConfig( address plugAddress_ ) external view returns (bytes32 appGatewayId, address switchboard); + + function payloadExecuted(bytes32 payloadId_) external view returns (ExecutionStatus); + + function chainSlug() external view returns (uint32); } diff --git a/contracts/protocol/switchboard/CCTPSwitchboard.sol b/contracts/protocol/switchboard/CCTPSwitchboard.sol new file mode 100644 index 00000000..539ea06a --- /dev/null +++ b/contracts/protocol/switchboard/CCTPSwitchboard.sol @@ -0,0 +1,219 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import "./FastSwitchboard.sol"; +import {ISocket} from "../interfaces/ISocket.sol"; +import {ExecuteParams, ExecutionStatus} from "../../utils/common/Structs.sol"; +import {IMessageTransmitter} from "../interfaces/IMessageTransmitter.sol"; +import {IMessageHandler} from "../interfaces/IMessageHandler.sol"; + +contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { + struct RemoteEndpoint { + uint256 remoteChainId; + address remoteAddress; + uint32 remoteDomain; + } + + // remoteChainSlug => remoteEndpoint + mapping(uint32 => RemoteEndpoint) public remoteEndpoints; + // remoteDomain => remoteAddress + mapping(uint32 => address) public remoteAddresses; + + mapping(bytes32 => bool) public isSyncedOut; + mapping(bytes32 => bytes32) public payloadIdToDigest; + mapping(bytes32 => bytes32) public remoteExecutedDigests; + mapping(bytes32 => bool) public isRemoteExecuted; + + IMessageTransmitter public immutable messageTransmitter; + + error RemoteExecutionNotFound(); + error DigestMismatch(); + error PreviousDigestsHashMismatch(); + error NotAttested(); + error NotExecuted(); + error InvalidDomain(); + error InvalidSender(); + error OnlyMessageTransmitter(); + event Attested(bytes32 payloadId, bytes32 digest, address watcher); + + constructor( + uint32 chainSlug_, + ISocket socket_, + address owner_, + address messageTransmitter_ + ) FastSwitchboard(chainSlug_, socket_, owner_) { + messageTransmitter = IMessageTransmitter(messageTransmitter_); + } + + function attest(bytes32 payloadId_, bytes32 digest_, bytes calldata proof_) external { + address watcher = _recoverSigner( + keccak256(abi.encode(address(this), chainSlug, digest_)), + proof_ + ); + + if (isAttested[digest_]) revert AlreadyAttested(); + if (!_hasRole(WATCHER_ROLE, watcher)) revert WatcherNotFound(); + + isAttested[digest_] = true; + payloadIdToDigest[payloadId_] = digest_; + emit Attested(payloadId_, digest_, watcher); + } + + function allowPacket(bytes32 digest_, bytes32 payloadId_) external view returns (bool) { + // digest has enough attestations and is remote executed + return + payloadIdToDigest[payloadId_] == digest_ && + isAttested[digest_] && + isRemoteExecuted[payloadId_]; + } + + function syncOut(bytes32 payloadId_, uint32[] calldata remoteChainSlugs_) external { + bytes32 digest = payloadIdToDigest[payloadId_]; + + // not attested + if (digest == bytes32(0) || !isAttested[digest]) revert NotAttested(); + + // already synced out + if (isSyncedOut[digest]) return; + isSyncedOut[digest] = true; + + // not executed + ExecutionStatus isExecuted = socket__.payloadExecuted(payloadId_); + if (isExecuted != ExecutionStatus.Executed) revert NotExecuted(); + + bytes memory message = abi.encode(payloadId_, digest); + for (uint256 i = 0; i < remoteChainSlugs_.length; i++) { + RemoteEndpoint memory endpoint = remoteEndpoints[remoteChainSlugs_[i]]; + if (endpoint.remoteDomain == 0) revert InvalidDomain(); + + messageTransmitter.sendMessage( + endpoint.remoteDomain, + addressToBytes32(endpoint.remoteAddress), + message + ); + } + } + + function handleReceiveMessage( + uint32 sourceDomain, + bytes32 sender, + bytes calldata messageBody + ) external returns (bool) { + if (msg.sender != address(messageTransmitter)) revert OnlyMessageTransmitter(); + + (bytes32 payloadId, bytes32 digest) = abi.decode(messageBody, (bytes32, bytes32)); + if (remoteAddresses[sourceDomain] != bytes32ToAddress(sender)) { + revert InvalidSender(); + } + + remoteExecutedDigests[payloadId] = digest; + return true; + } + + function verifyAttestations(bytes[] calldata messages, bytes[] calldata attestations) external { + for (uint256 i = 0; i < messages.length; i++) { + messageTransmitter.receiveMessage(messages[i], attestations[i]); + } + } + + function proveRemoteExecutions( + bytes32[] calldata previousPayloadIds_, + bytes32 payloadId_, + bytes calldata transmitterSignature_, + ExecuteParams calldata executeParams_ + ) external { + // Calculate previousDigestsHash from stored remoteExecutedDigests + bytes32 previousDigestsHash = bytes32(0); + for (uint256 i = 0; i < previousPayloadIds_.length; i++) { + if (remoteExecutedDigests[previousPayloadIds_[i]] == bytes32(0)) + revert RemoteExecutionNotFound(); + previousDigestsHash = keccak256( + abi.encodePacked(previousDigestsHash, remoteExecutedDigests[previousPayloadIds_[i]]) + ); + } + // Check if the calculated previousDigestsHash matches the one in executeParams_ + if (previousDigestsHash != executeParams_.prevBatchDigestHash) + revert PreviousDigestsHashMismatch(); + + address transmitter = _recoverSigner( + keccak256(abi.encode(address(socket__), payloadId_)), + transmitterSignature_ + ); + + // Construct current digest + (bytes32 appGatewayId, ) = socket__.getPlugConfig(executeParams_.target); + bytes32 constructedDigest = _createDigest( + transmitter, + payloadId_, + appGatewayId, + executeParams_ + ); + + bytes32 storedDigest = payloadIdToDigest[payloadId_]; + // Verify the constructed digest matches the stored one + if (storedDigest == bytes32(0) || !isAttested[storedDigest]) revert NotAttested(); + if (constructedDigest != storedDigest) revert DigestMismatch(); + + isRemoteExecuted[payloadId_] = true; + } + + /** + * @notice creates the digest for the payload + * @param transmitter_ The address of the transmitter + * @param payloadId_ The ID of the payload + * @param appGatewayId_ The id of the app gateway + * @param executeParams_ The parameters of the payload + * @return The packed payload as a bytes32 hash + */ + function _createDigest( + address transmitter_, + bytes32 payloadId_, + bytes32 appGatewayId_, + ExecuteParams calldata executeParams_ + ) internal view returns (bytes32) { + return + keccak256( + abi.encode( + address(socket__), + transmitter_, + payloadId_, + executeParams_.deadline, + executeParams_.callType, + executeParams_.gasLimit, + executeParams_.value, + executeParams_.payload, + executeParams_.target, + appGatewayId_, + executeParams_.prevBatchDigestHash, + executeParams_.extraData + ) + ); + } + + function addRemoteEndpoint( + uint32 remoteChainSlug_, + uint256 remoteChainId_, + address remoteAddress_, + uint32 remoteDomain_ + ) external onlyOwner { + remoteEndpoints[remoteChainSlug_] = RemoteEndpoint({ + remoteChainId: remoteChainId_, + remoteAddress: remoteAddress_, + remoteDomain: remoteDomain_ + }); + remoteAddresses[remoteDomain_] = remoteAddress_; + } + + function removeRemoteEndpoint(uint32 remoteChainSlug_) external onlyOwner { + uint32 remoteDomain = remoteEndpoints[remoteChainSlug_].remoteDomain; + delete remoteEndpoints[remoteChainSlug_]; + delete remoteAddresses[remoteDomain]; + } + + function addressToBytes32(address addr_) public pure returns (bytes32) { + return bytes32(uint256(uint160(addr_))); + } + function bytes32ToAddress(bytes32 addrBytes32_) public pure returns (address) { + return address(uint160(uint256(addrBytes32_))); + } +} diff --git a/contracts/utils/common/Constants.sol b/contracts/utils/common/Constants.sol index 2afa6479..e6588e43 100644 --- a/contracts/utils/common/Constants.sol +++ b/contracts/utils/common/Constants.sol @@ -13,6 +13,7 @@ bytes4 constant SCHEDULE = bytes4(keccak256("SCHEDULE")); bytes32 constant CALLBACK = keccak256("CALLBACK"); bytes32 constant FAST = keccak256("FAST"); +bytes32 constant CCTP = keccak256("CCTP"); uint256 constant PAYLOAD_SIZE_LIMIT = 24_500; uint16 constant MAX_COPY_BYTES = 2048; // 2KB diff --git a/contracts/utils/common/Structs.sol b/contracts/utils/common/Structs.sol index 80943216..efc936ef 100644 --- a/contracts/utils/common/Structs.sol +++ b/contracts/utils/common/Structs.sol @@ -199,3 +199,18 @@ struct RequestParams { uint256 writeCount; bytes onCompleteData; } + +struct CCTPExecutionParams { + ExecuteParams executeParams; + bytes32 digest; + bytes proof; + bytes transmitterSignature; + address refundAddress; +} + +struct CCTPBatchParams { + bytes32[] previousPayloadIds; + uint32[] nextBatchRemoteChainSlugs; + bytes[] messages; + bytes[] attestations; +} diff --git a/package.json b/package.json index b9d1c8a9..9d0b88f1 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "compile": "forge build", "deploy": "bash setupInfraContracts.sh", "publish-core": "yarn build && yarn publish --patch --no-git-tag-version", - "trace":"source .env && bash trace.sh" + "trace": "source .env && bash trace.sh" }, "pre-commit": [], "author": "", diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 377e2c4b..f1dad31c 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -12,6 +12,7 @@ import "../contracts/evmx/interfaces/IForwarder.sol"; import "../contracts/protocol/Socket.sol"; import "../contracts/protocol/switchboard/FastSwitchboard.sol"; +import "../contracts/protocol/switchboard/CCTPSwitchboard.sol"; import "../contracts/protocol/SocketBatcher.sol"; import "../contracts/protocol/SocketFeeManager.sol"; @@ -32,6 +33,7 @@ import "../contracts/evmx/fees/FeesPool.sol"; import "../contracts/evmx/plugs/FeesPlug.sol"; import "../contracts/evmx/AuctionManager.sol"; import "../contracts/evmx/mocks/TestUSDC.sol"; +import "./mock/CCTPMessageTransmitter.sol"; import "solady/utils/ERC1967Factory.sol"; @@ -68,11 +70,14 @@ contract SetupStore is Test { uint256 public payloadIdCounter; uint256 public triggerCounter; uint256 public asyncPromiseCounter; + struct SocketContracts { uint32 chainSlug; Socket socket; SocketFeeManager socketFeeManager; FastSwitchboard switchboard; + CCTPSwitchboard cctpSwitchboard; + CCTPMessageTransmitter cctpMessageTransmitter; SocketBatcher socketBatcher; ContractFactoryPlug contractFactoryPlug; FeesPlug feesPlug; @@ -121,6 +126,20 @@ contract DeploySetup is SetupStore { optConfig = _deploySocket(optChainSlug); _configureChain(optChainSlug); + vm.startPrank(socketOwner); + arbConfig.cctpSwitchboard.addRemoteEndpoint( + optChainSlug, + optChainSlug, + address(optConfig.cctpSwitchboard), + optChainSlug + ); + optConfig.cctpSwitchboard.addRemoteEndpoint( + arbChainSlug, + arbChainSlug, + address(arbConfig.cctpSwitchboard), + arbChainSlug + ); + vm.stopPrank(); // transfer eth to fees pool for native fee payouts vm.deal(address(feesPool), 100000 ether); @@ -209,13 +228,23 @@ contract DeploySetup is SetupStore { function _deploySocket(uint32 chainSlug_) internal returns (SocketContracts memory) { // socket Socket socket = new Socket(chainSlug_, socketOwner, "test"); - + CCTPMessageTransmitter cctpMessageTransmitter = new CCTPMessageTransmitter( + chainSlug_, + address(0) + ); return SocketContracts({ chainSlug: chainSlug_, socket: socket, socketFeeManager: new SocketFeeManager(socketOwner, socketFees), switchboard: new FastSwitchboard(chainSlug_, socket, socketOwner), + cctpSwitchboard: new CCTPSwitchboard( + chainSlug_, + socket, + socketOwner, + address(cctpMessageTransmitter) + ), + cctpMessageTransmitter: cctpMessageTransmitter, socketBatcher: new SocketBatcher(socketOwner, socket), contractFactoryPlug: new ContractFactoryPlug(address(socket), socketOwner), feesPlug: new FeesPlug(address(socket), socketOwner), @@ -227,6 +256,7 @@ contract DeploySetup is SetupStore { SocketContracts memory socketConfig = getSocketConfig(chainSlug_); Socket socket = socketConfig.socket; FastSwitchboard switchboard = socketConfig.switchboard; + CCTPSwitchboard cctpSwitchboard = socketConfig.cctpSwitchboard; FeesPlug feesPlug = socketConfig.feesPlug; ContractFactoryPlug contractFactoryPlug = socketConfig.contractFactoryPlug; @@ -241,6 +271,9 @@ contract DeploySetup is SetupStore { switchboard.grantRole(WATCHER_ROLE, watcherEOA); switchboard.grantRole(RESCUE_ROLE, address(socketOwner)); + cctpSwitchboard.registerSwitchboard(); + cctpSwitchboard.grantRole(WATCHER_ROLE, watcherEOA); + feesPlug.grantRole(RESCUE_ROLE, address(socketOwner)); feesPlug.whitelistToken(address(socketConfig.testUSDC)); feesPlug.connectSocket( @@ -261,6 +294,7 @@ contract DeploySetup is SetupStore { vm.startPrank(watcherEOA); configurations.setSocket(chainSlug_, address(socket)); configurations.setSwitchboard(chainSlug_, FAST, address(switchboard)); + configurations.setSwitchboard(chainSlug_, CCTP, address(cctpSwitchboard)); // plugs feesManager.setFeesPlug(chainSlug_, address(feesPlug)); @@ -888,33 +922,160 @@ contract WatcherSetup is AuctionSetup { transmitterPrivateKey ); bytes memory returnData; - (success, returnData) = getSocketConfig(chainSlug).socketBatcher.attestAndExecute( - ExecuteParams({ - callType: digestParams.callType, - deadline: digestParams.deadline, - gasLimit: digestParams.gasLimit, - value: digestParams.value, - payload: digestParams.payload, - target: digestParams.target, - requestCount: payloadParams.requestCount, - batchCount: payloadParams.batchCount, - payloadCount: payloadParams.payloadCount, - prevBatchDigestHash: digestParams.prevBatchDigestHash, - extraData: digestParams.extraData - }), - switchboard, - digest, - watcherProof, - transmitterSig, - transmitterEOA - ); - + ExecuteParams memory executeParams = ExecuteParams({ + callType: digestParams.callType, + deadline: digestParams.deadline, + gasLimit: digestParams.gasLimit, + value: digestParams.value, + payload: digestParams.payload, + target: digestParams.target, + requestCount: payloadParams.requestCount, + batchCount: payloadParams.batchCount, + payloadCount: payloadParams.payloadCount, + prevBatchDigestHash: digestParams.prevBatchDigestHash, + extraData: digestParams.extraData + }); + if (switchboard == address(getSocketConfig(chainSlug).switchboard)) { + (success, returnData) = getSocketConfig(chainSlug).socketBatcher.attestAndExecute( + executeParams, + switchboard, + digest, + watcherProof, + transmitterSig, + transmitterEOA + ); + } else if (switchboard == address(getSocketConfig(chainSlug).cctpSwitchboard)) { + (success, returnData) = _executeWithCCTPBatcher( + chainSlug, + executeParams, + digest, + watcherProof, + transmitterSig, + payloadParams + ); + } promiseReturnData = PromiseReturnData({ exceededMaxCopy: false, payloadId: payloadParams.payloadId, returnData: returnData }); } + function _executeWithCCTPBatcher( + uint32 chainSlug, + ExecuteParams memory executeParams, + bytes32 digest, + bytes memory watcherProof, + bytes memory transmitterSig, + PayloadParams memory payloadParams + ) internal returns (bool success, bytes memory returnData) { + CCTPBatchParams memory cctpBatchParams = _prepareCCTPBatchData(chainSlug, payloadParams); + + return + getSocketConfig(chainSlug).socketBatcher.attestCCTPAndProveAndExecute( + CCTPExecutionParams({ + executeParams: executeParams, + digest: digest, + proof: watcherProof, + transmitterSignature: transmitterSig, + refundAddress: transmitterEOA + }), + cctpBatchParams, + address(getSocketConfig(chainSlug).cctpSwitchboard) + ); + } + + function _prepareCCTPBatchData( + uint32 chainSlug, + PayloadParams memory payloadParams + ) internal view returns (CCTPBatchParams memory cctpBatchParams) { + uint40[] memory requestBatchIds = requestHandler.getRequestBatchIds( + payloadParams.requestCount + ); + uint40 currentBatchCount = payloadParams.batchCount; + + bytes32[] memory prevBatchPayloadIds = _getPrevBatchPayloadIds( + currentBatchCount, + requestBatchIds + ); + bytes32[] memory nextBatchPayloadIds = _getNextBatchPayloadIds( + currentBatchCount, + requestBatchIds + ); + + uint32[] memory prevBatchRemoteChainSlugs = _getRemoteChainSlugs(prevBatchPayloadIds); + uint32[] memory nextBatchRemoteChainSlugs = _getRemoteChainSlugs(nextBatchPayloadIds); + + bytes[] memory messages = _createCCTPMessages( + prevBatchPayloadIds, + prevBatchRemoteChainSlugs, + chainSlug + ); + + cctpBatchParams = CCTPBatchParams({ + previousPayloadIds: prevBatchPayloadIds, + nextBatchRemoteChainSlugs: nextBatchRemoteChainSlugs, + messages: messages, + attestations: new bytes[](prevBatchPayloadIds.length) // using mock attestations for now + }); + } + + function _getPrevBatchPayloadIds( + uint40 currentBatchCount, + uint40[] memory requestBatchIds + ) internal view returns (bytes32[] memory) { + if (currentBatchCount == requestBatchIds[0]) { + return new bytes32[](0); + } + return requestHandler.getBatchPayloadIds(currentBatchCount - 1); + } + + function _getNextBatchPayloadIds( + uint40 currentBatchCount, + uint40[] memory requestBatchIds + ) internal view returns (bytes32[] memory) { + if (currentBatchCount == requestBatchIds[requestBatchIds.length - 1]) { + return new bytes32[](0); + } + return requestHandler.getBatchPayloadIds(currentBatchCount + 1); + } + + function _getRemoteChainSlugs(bytes32[] memory payloadIds) internal view returns (uint32[] memory) { + uint32[] memory chainSlugs = new uint32[](payloadIds.length); + for (uint i = 0; i < payloadIds.length; i++) { + PayloadParams memory params = requestHandler.getPayload(payloadIds[i]); + (, Transaction memory transaction, , , , ) = abi.decode( + params.precompileData, + (address, Transaction, WriteFinality, uint256, uint256, address) + ); + chainSlugs[i] = transaction.chainSlug; + } + return chainSlugs; + } + + function _createCCTPMessages( + bytes32[] memory payloadIds, + uint32[] memory remoteChainSlugs, + uint32 chainSlug + ) internal view returns (bytes[] memory) { + bytes[] memory messages = new bytes[](payloadIds.length); + for (uint i = 0; i < payloadIds.length; i++) { + messages[i] = abi.encode( + remoteChainSlugs[i], + addressToBytes32(address(getSocketConfig(remoteChainSlugs[i]).cctpSwitchboard)), + chainSlug, + addressToBytes32(address(getSocketConfig(chainSlug).cctpSwitchboard)), + abi.encode(payloadIds[i], writePrecompile.digestHashes(payloadIds[i])) + ); + } + return messages; + } + + function addressToBytes32(address addr_) internal pure returns (bytes32) { + return bytes32(uint256(uint160(addr_))); + } + function bytes32ToAddress(bytes32 addrBytes32_) internal pure returns (address) { + return address(uint160(uint256(addrBytes32_))); + } function _resolvePromise(PromiseReturnData[] memory promiseReturnData) internal { watcherMultiCall( @@ -944,16 +1105,15 @@ contract WatcherSetup is AuctionSetup { ) internal { AppGatewayConfig[] memory configs = new AppGatewayConfig[](contractIds_.length); - SocketContracts memory socketConfig = getSocketConfig(chainSlug_); for (uint i = 0; i < contractIds_.length; i++) { address plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); - + address switchboard = configurations.switchboards(chainSlug_, appGateway_.sbType()); configs[i] = AppGatewayConfig({ plug: plug, chainSlug: chainSlug_, plugConfig: PlugConfig({ appGatewayId: encodeAppGatewayId(address(appGateway_)), - switchboard: address(socketConfig.switchboard) + switchboard: switchboard }) }); } @@ -963,7 +1123,6 @@ contract WatcherSetup is AuctionSetup { ); } } - contract AppGatewayBaseSetup is WatcherSetup { function getOnChainAndForwarderAddresses( uint32 chainSlug_, diff --git a/test/apps/CCTPSuperToken.t.sol b/test/apps/CCTPSuperToken.t.sol new file mode 100644 index 00000000..3c7df780 --- /dev/null +++ b/test/apps/CCTPSuperToken.t.sol @@ -0,0 +1,179 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import {SuperTokenAppGateway} from "./app-gateways/super-token/SuperTokenAppGateway.sol"; +import {SuperToken} from "./app-gateways/super-token/SuperToken.sol"; +import "../SetupTest.t.sol"; + +/** + * @title SuperToken Test + * @notice Test contract for verifying the functionality of the SuperToken system, which enables + * multi-chain token bridging capabilities. + * @dev Inherits from AppGatewayBaseSetup to utilize multi-chain messaging infrastructure + * + * The test suite validates: + * - Contract deployment across different chains + * - Token transfers between chains + * - Proper balance updates + * - Integration with the delivery and auction system + */ +contract CCTPSuperTokenTest is AppGatewayBaseSetup { + /** + * @notice Groups the main contracts needed for SuperToken functionality + * @param superTokenApp The gateway contract that handles multi-chain token operations + * @param superTokenDeployer Contract responsible for deploying SuperToken instances + * @param superToken Identifier for the SuperToken contract + */ + struct AppContracts { + SuperTokenAppGateway superTokenApp; + bytes32 superToken; + } + address owner = address(uint160(c++)); + uint256 maxFees = 0.01 ether; + + /// @dev Main contracts used throughout the tests + AppContracts appContracts; + /// @dev Array storing contract IDs for deployment (currently only SuperToken) + bytes32[] contractIds = new bytes32[](1); + + /// @dev Test amount for token transfers (0.01 ETH) + uint256 srcAmount = 0.01 ether; + /// @dev Structure holding transfer order details + SuperTokenAppGateway.TransferOrder transferOrder; + + /** + * @notice Sets up the test environment + * @dev Initializes core infrastructure and deploys SuperToken-specific contracts + * Sequence: + * 1. Sets up delivery helper for multi-chain communication + * 2. Deploys SuperToken application + * 3. Initializes contract IDs array + */ + function setUp() public { + deploy(); + + SuperTokenAppGateway superTokenApp = new SuperTokenAppGateway( + address(addressResolver), + owner, + maxFees, + SuperTokenAppGateway.ConstructorParams({ + name_: "SUPER TOKEN", + symbol_: "SUPER", + decimals_: 18, + initialSupplyHolder_: owner, + initialSupply_: 1000000000 ether + }) + ); + vm.prank(owner); + superTokenApp.setSbType(CCTP); + // Enable app gateways to do all operations in the Watcher: Read, Write and Schedule on EVMx + // Watcher sets the limits for apps in this SOCKET protocol version + depositNativeAndCredits(arbChainSlug, 1 ether, 0, address(superTokenApp)); + + appContracts = AppContracts({ + superTokenApp: superTokenApp, + superToken: superTokenApp.superToken() + }); + + contractIds[0] = appContracts.superToken; + } + + /** + * @notice Deploys the SuperToken application and its components + * @dev Creates both the deployer and gateway contracts with initial configuration + * - Sets up SuperToken with "SUPER TOKEN" name and "SUPER" symbol + * - Configures initial supply of 1 billion tokens + * - Sets up fee structure and auction manager integration + */ + function deploySuperToken(uint32 chainSlug) internal { + appContracts.superTokenApp.deployContracts(chainSlug); + executeDeploy(IAppGateway(appContracts.superTokenApp), chainSlug, contractIds); + } + + /** + * @notice Tests the deployment of SuperToken contracts across chains + * @dev Verifies: + * - Correct deployment on target chain (Arbitrum in this case) + * - Proper initialization of token parameters + * - Correct setup of forwarder contracts for multi-chain communication + */ + function testCCTPContractDeployment() public { + deploySuperToken(arbChainSlug); + + (address onChain, address forwarder) = getOnChainAndForwarderAddresses( + arbChainSlug, + appContracts.superToken, + IAppGateway(appContracts.superTokenApp) + ); + + assertEq( + SuperToken(onChain).name(), + "SUPER TOKEN", + "OnChain SuperToken name should be SUPER TOKEN" + ); + + assertEq( + IForwarder(forwarder).getChainSlug(), + arbChainSlug, + "Forwarder SuperToken chainSlug should be arbChainSlug" + ); + + assertEq( + IForwarder(forwarder).getOnChainAddress(), + onChain, + "Forwarder SuperToken onChainAddress should be correct" + ); + assertEq(SuperToken(onChain).owner(), owner, "SuperToken owner should be correct"); + } + + /** + * @notice Tests multi-chain token transfers + * @dev Verifies: + * - Correct token burning on source chain (Arbitrum) + * - Correct token minting on destination chain (Optimism) + * - Accurate balance updates on both chains + * - Proper execution of multi-chain messaging + */ + function testCCTPTransfer() public { + deploySuperToken(arbChainSlug); + deploySuperToken(optChainSlug); + + (address onChainArb, address forwarderArb) = getOnChainAndForwarderAddresses( + arbChainSlug, + appContracts.superToken, + IAppGateway(appContracts.superTokenApp) + ); + + (address onChainOpt, address forwarderOpt) = getOnChainAndForwarderAddresses( + optChainSlug, + appContracts.superToken, + IAppGateway(appContracts.superTokenApp) + ); + + uint256 arbBalanceBefore = SuperToken(onChainArb).balanceOf(owner); + uint256 optBalanceBefore = SuperToken(onChainOpt).balanceOf(owner); + + transferOrder = SuperTokenAppGateway.TransferOrder({ + srcToken: forwarderArb, + dstToken: forwarderOpt, + user: owner, + srcAmount: srcAmount, + deadline: block.timestamp + 1000000 + }); + + bytes memory encodedOrder = abi.encode(transferOrder); + appContracts.superTokenApp.transfer(encodedOrder); + executeRequest(); + + assertEq( + SuperToken(onChainArb).balanceOf(owner), + arbBalanceBefore - srcAmount, + "Arb balance should be decreased by srcAmount" + ); + assertEq( + SuperToken(onChainOpt).balanceOf(owner), + optBalanceBefore + srcAmount, + "Opt balance should be increased by srcAmount" + ); + } +} diff --git a/test/apps/app-gateways/super-token/SuperTokenAppGateway.sol b/test/apps/app-gateways/super-token/SuperTokenAppGateway.sol index 0e835b7e..00870143 100644 --- a/test/apps/app-gateways/super-token/SuperTokenAppGateway.sol +++ b/test/apps/app-gateways/super-token/SuperTokenAppGateway.sol @@ -68,4 +68,8 @@ contract SuperTokenAppGateway is AppGatewayBase, Ownable { emit Transferred(_getCurrentRequestCount()); } + + function setSbType(bytes32 sbType_) external onlyOwner { + _setSbType(sbType_); + } } diff --git a/test/mock/CCTPMessageTransmitter.sol b/test/mock/CCTPMessageTransmitter.sol new file mode 100644 index 00000000..cb30570e --- /dev/null +++ b/test/mock/CCTPMessageTransmitter.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.21; + +import "../../contracts/protocol/interfaces/IMessageTransmitter.sol"; +import "../../contracts/protocol/interfaces/IMessageHandler.sol"; + +contract CCTPMessageTransmitter is IMessageTransmitter { + uint32 public immutable override localDomain; + address public immutable override attestationManager; + + // Mapping to store sent messages for verification + mapping(uint64 => bytes) public sentMessages; + uint64 public nonce; + + event MessageSent( + uint32 destinationDomain, + bytes32 recipient, + bytes messageBody, + uint64 nonce, + bytes message + ); + + event MessageReceived(bytes message, bytes attestation, bool success); + + constructor(uint32 _localDomain, address _attestationManager) { + localDomain = _localDomain; + attestationManager = _attestationManager; + } + + function sendMessage( + uint32 destinationDomain, + bytes32 recipient, + bytes calldata messageBody + ) external override returns (uint64) { + uint64 currentNonce = nonce++; + sentMessages[currentNonce] = messageBody; + + bytes memory message = abi.encode( + localDomain, + msg.sender, + destinationDomain, + recipient, + messageBody + ); + emit MessageSent(destinationDomain, recipient, messageBody, currentNonce, message); + + return currentNonce; + } + + function receiveMessage( + bytes calldata message, + bytes calldata attestation + ) external override returns (bool) { + ( + uint32 sourceDomain, + bytes32 sender, + , // destinationDomain + bytes32 recipient, + bytes memory messageBody + ) = abi.decode(message, (uint32, bytes32, uint32, bytes32, bytes)); + IMessageHandler(bytes32ToAddress(recipient)).handleReceiveMessage( + sourceDomain, + sender, + messageBody + ); + // In mock implementation, we'll always return true + // In real implementation, this would verify the attestation + emit MessageReceived(message, attestation, true); + return true; + } + + function addressToBytes32(address addr_) public pure returns (bytes32) { + return bytes32(uint256(uint160(addr_))); + } + function bytes32ToAddress(bytes32 addrBytes32_) public pure returns (address) { + return address(uint160(uint256(addrBytes32_))); + } +} diff --git a/test/mock/MockSocket.sol b/test/mock/MockSocket.sol index fbe737a8..7ae53bfa 100644 --- a/test/mock/MockSocket.sol +++ b/test/mock/MockSocket.sol @@ -65,12 +65,6 @@ contract MockSocket is ISocket { uint64 public triggerCounter; uint32 public chainSlug; - enum ExecutionStatus { - NotExecuted, - Executed, - Reverted - } - /** * @dev keeps track of whether a payload has been executed or not using payload id */ From 8affab262ea3a4ce5bc6e9aeed04653cb4a23121 Mon Sep 17 00:00:00 2001 From: Akash Date: Tue, 17 Jun 2025 16:26:12 +0530 Subject: [PATCH 003/139] feat: cctp support --- Errors.md | 13 +++ EventTopics.md | 16 ++++ .../protocol/switchboard/CCTPSwitchboard.sol | 3 +- foundry.toml | 8 +- hardhat-scripts/config/config.ts | 15 +++ hardhat-scripts/constants/constants.ts | 1 + hardhat-scripts/deploy/1.deploy.ts | 16 ++++ hardhat-scripts/deploy/2.roles.ts | 6 +- hardhat-scripts/deploy/3.configureChains.ts | 95 ++++++++++++++++++- .../misc-scripts/getAttestations.ts | 95 +++++++++++++++++++ package.json | 2 +- .../supertoken/DeployEVMxSuperTokenApp.s.sol | 38 ++++++++ script/supertoken/TransferSuperToken.s.sol | 36 +++++++ src/enums.ts | 1 + src/types.ts | 1 + test/SetupTest.t.sol | 4 +- test/mock/CCTPMessageTransmitter.sol | 4 +- trace.sh | 2 +- 18 files changed, 345 insertions(+), 11 deletions(-) create mode 100644 hardhat-scripts/misc-scripts/getAttestations.ts create mode 100644 script/supertoken/DeployEVMxSuperTokenApp.s.sol create mode 100644 script/supertoken/TransferSuperToken.s.sol diff --git a/Errors.md b/Errors.md index 77179268..f88ea278 100644 --- a/Errors.md +++ b/Errors.md @@ -68,6 +68,19 @@ | `OnlyOffChain()` | `0x9cbfe066` | | `SimulationFailed()` | `0x2fbab3ac` | +## protocol/switchboard/CCTPSwitchboard.sol + +| Error | Signature | +| ------------------------------- | ------------ | +| `RemoteExecutionNotFound()` | `0xbd506972` | +| `DigestMismatch()` | `0x582e0907` | +| `PreviousDigestsHashMismatch()` | `0x3e62c52c` | +| `NotAttested()` | `0x99efb890` | +| `NotExecuted()` | `0xec84b1da` | +| `InvalidDomain()` | `0xeb127982` | +| `InvalidSender()` | `0xddb5de5e` | +| `OnlyMessageTransmitter()` | `0x935ac89c` | + ## protocol/switchboard/FastSwitchboard.sol | Error | Signature | diff --git a/EventTopics.md b/EventTopics.md index c94cd569..cb090d72 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -222,6 +222,22 @@ | `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | | `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | +## ICCTPSwitchboard + +| Event | Arguments | Topic | +| ----- | --------- | ----- | + +## CCTPSwitchboard + +| Event | Arguments | Topic | +| ---------------------------- | ----------------------------------------- | -------------------------------------------------------------------- | +| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | + ## FastSwitchboard | Event | Arguments | Topic | diff --git a/contracts/protocol/switchboard/CCTPSwitchboard.sol b/contracts/protocol/switchboard/CCTPSwitchboard.sol index 539ea06a..3be56b01 100644 --- a/contracts/protocol/switchboard/CCTPSwitchboard.sol +++ b/contracts/protocol/switchboard/CCTPSwitchboard.sol @@ -34,7 +34,6 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { error InvalidDomain(); error InvalidSender(); error OnlyMessageTransmitter(); - event Attested(bytes32 payloadId, bytes32 digest, address watcher); constructor( uint32 chainSlug_, @@ -56,7 +55,7 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { isAttested[digest_] = true; payloadIdToDigest[payloadId_] = digest_; - emit Attested(payloadId_, digest_, watcher); + emit Attested(payloadId_, watcher); } function allowPacket(bytes32 digest_, bytes32 payloadId_) external view returns (bool) { diff --git a/foundry.toml b/foundry.toml index 6d1a2709..8dca882d 100644 --- a/foundry.toml +++ b/foundry.toml @@ -33,4 +33,10 @@ via_ir = false 0x7726e559A5129A9174f89F7E2029f7212B66dD13 = "WatcherImpl" 0xd8be408E271EEe9d3D0f28305bB9b6003589E1A9 = "WritePrecompile" 0xE24c4b0f67f566Fa558b3FE85f1780CD330f1F4D = "WritePrecompileImpl" -0x4Faa9C39f4E1C5be5f9c2e3F5AC8774da3b7B1C2 = "APP_GATEWAY" +0xf9A93a92c0754084f6320f3fC1D54584C2e0439d = "CCTPSwitchboard" +0xAA78A6c96DF690d30eF161490f6590fCAb8f4406 = "ContractFactoryPlug" +0x696d7d0Af367cFE3d3c56BD61ca16B3A0939618b = "FastSwitchboard" +0xC6Fb338F2009B5AD1e1bbA2dd2c9f52e9dE2C91C = "FeesPlug" +0x4B5718c1f739A83EF5c75f64776f2c9D4D460B1D = "Socket" +0xc9E18b73C1A575D8A5975754a01CD19BE8400037 = "SocketBatcher" +0x86081C993583916720E58788b68292b2BBcDA6f3 = "APP_GATEWAY" diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 7ba92e79..f75bbb56 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -116,3 +116,18 @@ export const UPGRADE_VERSION = 1; // Transmitter constants export const TRANSMITTER_CREDIT_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold export const TRANSMITTER_NATIVE_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold + +// CCTP +export const MESSAGE_TRANSMITTER: { + [chainSlug: number]: string; +} = { + 421614: "0xaCF1ceeF35caAc005e15888dDb8A3515C41B4872", + 11155420: "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD", +}; + +export const CCTP_DOMAINS: { + [chainSlug: number]: number; +} = { + 421614: 3, + 11155420: 2, +}; diff --git a/hardhat-scripts/constants/constants.ts b/hardhat-scripts/constants/constants.ts index 71aa09e1..168d2b47 100644 --- a/hardhat-scripts/constants/constants.ts +++ b/hardhat-scripts/constants/constants.ts @@ -7,6 +7,7 @@ export const IMPLEMENTATION_SLOT = "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"; export const FAST_SWITCHBOARD_TYPE = id("FAST"); +export const CCTP_SWITCHBOARD_TYPE = id("CCTP"); export const ZERO_APP_GATEWAY_ID = ethers.utils.hexZeroPad( constants.AddressZero, diff --git a/hardhat-scripts/deploy/1.deploy.ts b/hardhat-scripts/deploy/1.deploy.ts index f5e19534..3f088d74 100644 --- a/hardhat-scripts/deploy/1.deploy.ts +++ b/hardhat-scripts/deploy/1.deploy.ts @@ -13,6 +13,7 @@ import { logConfig, MAX_RE_AUCTION_COUNT, MAX_SCHEDULE_DELAY_SECONDS, + MESSAGE_TRANSMITTER, mode, READ_FEES, SCHEDULE_CALLBACK_FEES, @@ -322,6 +323,21 @@ const deploySocketContracts = async () => { ); deployUtils.addresses[contractName] = sb.address; + contractName = Contracts.CCTPSwitchboard; + const cctpSwitchboard: Contract = await getOrDeploy( + contractName, + contractName, + `contracts/protocol/switchboard/${contractName}.sol`, + [ + chain as ChainSlug, + socket.address, + socketOwner, + MESSAGE_TRANSMITTER[chain as ChainSlug], + ], + deployUtils + ); + deployUtils.addresses[contractName] = cctpSwitchboard.address; + if (getFeesPlugChains().includes(chain as ChainSlug)) { contractName = Contracts.FeesPlug; const feesPlug: Contract = await getOrDeploy( diff --git a/hardhat-scripts/deploy/2.roles.ts b/hardhat-scripts/deploy/2.roles.ts index 79723cec..99db548c 100644 --- a/hardhat-scripts/deploy/2.roles.ts +++ b/hardhat-scripts/deploy/2.roles.ts @@ -16,6 +16,7 @@ export const REQUIRED_ROLES = { }, Chain: { FastSwitchboard: [ROLES.WATCHER_ROLE, ROLES.RESCUE_ROLE], + CCTPSwitchboard: [ROLES.WATCHER_ROLE, ROLES.RESCUE_ROLE], Socket: [ ROLES.GOVERNANCE_ROLE, ROLES.RESCUE_ROLE, @@ -80,8 +81,9 @@ async function setRolesOnChain(chain: number, addresses: DeploymentAddresses) { for (const roleName of roles) { const targetAddress = - contractName === Contracts.FastSwitchboard && - roleName === ROLES.WATCHER_ROLE + [Contracts.FastSwitchboard, Contracts.CCTPSwitchboard].includes( + contractName as Contracts + ) && roleName === ROLES.WATCHER_ROLE ? watcher : signer.address; diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 54a3cb11..b5a568e5 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -3,8 +3,17 @@ dotenvConfig(); import { Contract, Signer, Wallet } from "ethers"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; -import { chains, EVMX_CHAIN_ID, MAX_MSG_VALUE_LIMIT, mode } from "../config"; import { + CCTP_DOMAINS, + chains, + EVMX_CHAIN_ID, + mainnetChains, + MAX_MSG_VALUE_LIMIT, + mode, + testnetChains, +} from "../config"; +import { + CCTP_SWITCHBOARD_TYPE, DeploymentAddresses, FAST_SWITCHBOARD_TYPE, getFeeTokens, @@ -48,6 +57,13 @@ export const configureChains = async (addresses: DeploymentAddresses) => { socketContract ); + await registerSb( + chain, + chainAddresses[Contracts.CCTPSwitchboard], + signer, + socketContract + ); + if (chainAddresses[Contracts.FeesPlug]) { await whitelistToken(chain, chainAddresses[Contracts.FeesPlug], signer); } @@ -55,6 +71,13 @@ export const configureChains = async (addresses: DeploymentAddresses) => { await setMaxMsgValueLimit(chain); await setOnchainContracts(chain, addresses); + + await addRemoteEndpointsToCCTPSwitchboard( + chain, + addresses, + signer, + socketContract + ); } }; @@ -91,6 +114,16 @@ async function setOnchainContracts( [chain, FAST_SWITCHBOARD_TYPE, chainAddresses[Contracts.FastSwitchboard]], signer ); + await updateContractSettings( + EVMX_CHAIN_ID, + Contracts.Configurations, + "switchboards", + [chain, CCTP_SWITCHBOARD_TYPE], + chainAddresses[Contracts.CCTPSwitchboard], + "setSwitchboard", + [chain, CCTP_SWITCHBOARD_TYPE, chainAddresses[Contracts.CCTPSwitchboard]], + signer + ); await updateContractSettings( EVMX_CHAIN_ID, Contracts.Configurations, @@ -126,6 +159,66 @@ async function setOnchainContracts( ); } +const addRemoteEndpointsToCCTPSwitchboard = async ( + chain: number, + addresses: DeploymentAddresses, + signer: Wallet, + socket: Contract +) => { + try { + console.log("Adding remote endpoints to CCTP switchboard"); + const chainAddresses = addresses[chain] as ChainAddressesObj; + const sbAddress = chainAddresses[Contracts.CCTPSwitchboard]; + const switchboard = ( + await getInstance(Contracts.CCTPSwitchboard, sbAddress) + ).connect(signer); + const remoteChainSlugs = getRemoteChainSlugs(chain); + console.log(chain, " remoteChainSlugs: ", remoteChainSlugs); + + for (const remoteChainSlug of remoteChainSlugs) { + const remoteSwitchboardAddress = + addresses[remoteChainSlug]?.[Contracts.CCTPSwitchboard]; + const currentRemoteEndpoint = await switchboard.remoteEndpoints( + remoteChainSlug + ); + if (currentRemoteEndpoint.remoteAddress == remoteSwitchboardAddress) { + console.log(`Remote endpoint ${remoteChainSlug} already exists`); + continue; + } + + const registerTx = await switchboard.addRemoteEndpoint( + remoteChainSlug, + remoteChainSlug, + remoteSwitchboardAddress, + CCTP_DOMAINS[remoteChainSlug], + { + ...(await overrides(chain)), + } + ); + console.log( + `Adding remote endpoint ${remoteChainSlug} to ${sbAddress}: ${registerTx.hash}` + ); + await registerTx.wait(); + } + } catch (error) { + throw error; + } +}; + +const getRemoteChainSlugs = (chain: number) => { + if (testnetChains.includes(chain)) { + return chains.filter( + (c) => c !== chain && testnetChains.includes(c as ChainSlug) + ); + } + if (mainnetChains.includes(chain)) { + return chains.filter( + (c) => c !== chain && mainnetChains.includes(c as ChainSlug) + ); + } + return chains.filter((c) => c !== chain); +}; + const registerSb = async ( chain: number, sbAddress: string, diff --git a/hardhat-scripts/misc-scripts/getAttestations.ts b/hardhat-scripts/misc-scripts/getAttestations.ts new file mode 100644 index 00000000..dcdcc7be --- /dev/null +++ b/hardhat-scripts/misc-scripts/getAttestations.ts @@ -0,0 +1,95 @@ +import { ethers } from "ethers"; +import axios from "axios"; + +async function getAttestation(messageHash: string): Promise { + try { + const response = await axios.get( + `https://iris-api-sandbox.circle.com/v1/attestations/${messageHash}` + ); + console.log("messageHash", messageHash, "response", response.data); + if (response.data.status === "complete") { + return response.data.attestation; + } + return null; + } catch (error) { + return null; + } +} + +async function main() { + const args = process.argv.slice(2); + if (args.length !== 2) { + console.log("Usage: ts-node getAttestations.ts "); + process.exit(1); + } + + const [txHash, providerUrl] = args; + const provider = new ethers.providers.JsonRpcProvider(providerUrl); + + // Get transaction receipt + const receipt = await provider.getTransactionReceipt(txHash); + + // ABI for MessageSent event + const messageTransmitterInterface = new ethers.utils.Interface([ + "event MessageSent(bytes message)", + ]); + + // Filter logs for MessageSent event + const messageSentLogs = receipt.logs.filter((log) => { + try { + const parsedLog = messageTransmitterInterface.parseLog(log); + return parsedLog.name === "MessageSent"; + } catch { + return false; + } + }); + + if (messageSentLogs.length === 0) { + console.log("No MessageSent events found in transaction"); + process.exit(1); + } + + const messages: string[] = []; + const messageHashes: string[] = []; + const attestations: string[] = []; + + // Get messages and calculate hashes + for (const log of messageSentLogs) { + const parsedLog = messageTransmitterInterface.parseLog(log); + const message = parsedLog.args.message; + const messageHash = ethers.utils.keccak256(message); + + messages.push(message); + messageHashes.push(messageHash); + } + + // Poll for attestations + let complete = false; + while (!complete) { + complete = true; + + for (let i = 0; i < messageHashes.length; i++) { + if (!attestations[i]) { + const attestation = await getAttestation(messageHashes[i]); + if (attestation) { + attestations[i] = attestation; + } else { + complete = false; + } + } + } + + if (!complete) { + console.log("Waiting for attestations..."); + await new Promise((resolve) => setTimeout(resolve, 5000)); // Wait 5 seconds + } + } + + console.log("\nMessages:", messages); + console.log("\nAttestations:", attestations); +} + +main().catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/package.json b/package.json index 9d0b88f1..265df42f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.1.22", + "version": "1.1.22-test.1", "description": "socket protocol", "scripts": { "build": "yarn abi && tsc --project lib.tsconfig.json", diff --git a/script/supertoken/DeployEVMxSuperTokenApp.s.sol b/script/supertoken/DeployEVMxSuperTokenApp.s.sol new file mode 100644 index 00000000..c09efdcc --- /dev/null +++ b/script/supertoken/DeployEVMxSuperTokenApp.s.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; +import "../../test/apps/app-gateways/super-token/SuperTokenAppGateway.sol"; +import {CCTP} from "../../contracts/utils/common/Constants.sol"; +// source .env && forge script script/supertoken/deployEVMxSuperTokenApp.s.sol --broadcast --skip-simulation --legacy --gas-price 0 +contract SuperTokenDeploy is Script { + function run() external { + address addressResolver = vm.envAddress("ADDRESS_RESOLVER"); + string memory rpc = vm.envString("EVMX_RPC"); + vm.createSelectFork(rpc); + + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + // Setting fee payment on Arbitrum Sepolia + uint256 fees = 1 ether; + + SuperTokenAppGateway gateway = new SuperTokenAppGateway( + addressResolver, + vm.addr(deployerPrivateKey), + fees, + SuperTokenAppGateway.ConstructorParams({ + name_: "SuperToken", + symbol_: "SUPER", + decimals_: 18, + initialSupplyHolder_: vm.addr(deployerPrivateKey), + initialSupply_: 1000000000000000000000000000 + }) + ); + + console.log("Contracts deployed:"); + console.log("SuperTokenAppGateway:", address(gateway)); + gateway.setSbType(CCTP); + } +} diff --git a/script/supertoken/TransferSuperToken.s.sol b/script/supertoken/TransferSuperToken.s.sol new file mode 100644 index 00000000..c1d39d2a --- /dev/null +++ b/script/supertoken/TransferSuperToken.s.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; +import {SuperTokenAppGateway} from "../../test/apps/app-gateways/super-token/SuperTokenAppGateway.sol"; + +// source .env && forge script script/supertoken/TransferSuperToken.s.sol --broadcast --skip-simulation --legacy --gas-price 0 +contract TransferSuperToken is Script { + function run() external { + string memory socketRPC = vm.envString("EVMX_RPC"); + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + + vm.createSelectFork(socketRPC); + + SuperTokenAppGateway gateway = SuperTokenAppGateway(vm.envAddress("APP_GATEWAY")); + address forwarderArb = gateway.forwarderAddresses(gateway.superToken(), 421614); + address forwarderOpt = gateway.forwarderAddresses(gateway.superToken(), 11155420); + + SuperTokenAppGateway.TransferOrder memory transferOrder = SuperTokenAppGateway + .TransferOrder({ + srcToken: forwarderArb, + dstToken: forwarderOpt, + user: vm.addr(deployerPrivateKey), + srcAmount: 100, + deadline: block.timestamp + 1000000 + }); + + bytes memory encodedOrder = abi.encode(transferOrder); + bytes memory encodedPayload = abi.encodeWithSelector( + bytes4(keccak256("transfer(bytes)")), + encodedOrder + ); + console.logBytes(encodedPayload); + } +} diff --git a/src/enums.ts b/src/enums.ts index f54d3ba8..1c5879c9 100644 --- a/src/enums.ts +++ b/src/enums.ts @@ -50,6 +50,7 @@ export enum Contracts { FeesPlug = "FeesPlug", ContractFactoryPlug = "ContractFactoryPlug", FastSwitchboard = "FastSwitchboard", + CCTPSwitchboard = "CCTPSwitchboard", SocketBatcher = "SocketBatcher", SocketFeeManager = "SocketFeeManager", AddressResolver = "AddressResolver", diff --git a/src/types.ts b/src/types.ts index 1a047bcc..ba32e046 100644 --- a/src/types.ts +++ b/src/types.ts @@ -19,6 +19,7 @@ export type ChainAddressesObj = { Socket: string; SocketBatcher: string; FastSwitchboard: string; + CCTPSwitchboard: string; ContractFactoryPlug: string; SocketFeesManager?: string; FeesPlug?: string; diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index f1dad31c..3301afda 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -1039,7 +1039,9 @@ contract WatcherSetup is AuctionSetup { return requestHandler.getBatchPayloadIds(currentBatchCount + 1); } - function _getRemoteChainSlugs(bytes32[] memory payloadIds) internal view returns (uint32[] memory) { + function _getRemoteChainSlugs( + bytes32[] memory payloadIds + ) internal view returns (uint32[] memory) { uint32[] memory chainSlugs = new uint32[](payloadIds.length); for (uint i = 0; i < payloadIds.length; i++) { PayloadParams memory params = requestHandler.getPayload(payloadIds[i]); diff --git a/test/mock/CCTPMessageTransmitter.sol b/test/mock/CCTPMessageTransmitter.sol index cb30570e..57eee54a 100644 --- a/test/mock/CCTPMessageTransmitter.sol +++ b/test/mock/CCTPMessageTransmitter.sol @@ -53,8 +53,8 @@ contract CCTPMessageTransmitter is IMessageTransmitter { ) external override returns (bool) { ( uint32 sourceDomain, - bytes32 sender, - , // destinationDomain + bytes32 sender, // destinationDomain + , bytes32 recipient, bytes memory messageBody ) = abi.decode(message, (uint32, bytes32, uint32, bytes32, bytes)); diff --git a/trace.sh b/trace.sh index 3e185bc6..fc1cedf9 100644 --- a/trace.sh +++ b/trace.sh @@ -54,7 +54,7 @@ echo "txHash: $2" echo "rpcUrl: $RPC_URL" npx ts-node hardhat-scripts/misc-scripts/createLabels.ts $1 -cast run --la $2 --rpc-url $RPC_URL +cast run --la $2 --rpc-url $RPC_URL --quick # usage : # yarn trace From aac9e033d840d96a1e1541538d0c61ae8c26e920 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 23 Jun 2025 15:30:22 +0530 Subject: [PATCH 004/139] feat: added cctp constants --- hardhat-scripts/config/config.ts | 29 +++++++----------- hardhat-scripts/deploy/1.deploy.ts | 8 +++-- hardhat-scripts/deploy/3.configureChains.ts | 6 +++- src/cctp.ts | 34 +++++++++++++++++++++ src/index.ts | 1 + 5 files changed, 57 insertions(+), 21 deletions(-) create mode 100644 src/cctp.ts diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index f75bbb56..5d78ae70 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -26,9 +26,17 @@ export const logConfig = () => { export const getChains = () => { switch (mode) { case DeploymentMode.LOCAL: - return [ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA]; + return [ + ChainSlug.ARBITRUM_SEPOLIA, + ChainSlug.OPTIMISM_SEPOLIA, + ChainSlug.BASE_SEPOLIA, + ]; case DeploymentMode.DEV: - return [ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA]; + return [ + ChainSlug.ARBITRUM_SEPOLIA, + ChainSlug.OPTIMISM_SEPOLIA, + ChainSlug.BASE_SEPOLIA, + ]; case DeploymentMode.STAGE: return [ ChainSlug.BASE, @@ -95,7 +103,7 @@ export const MAX_MSG_VALUE_LIMIT = ethers.utils.parseEther("0.001"); // Auction parameters export const AUCTION_END_DELAY_SECONDS = 0; export const BID_TIMEOUT = 600; // 10 minutes -export const EXPIRY_TIME = 300; // 5 minutes +export const EXPIRY_TIME = 3600; // 1 hour export const MAX_RE_AUCTION_COUNT = 5; // Fees Pool Funding Amount @@ -116,18 +124,3 @@ export const UPGRADE_VERSION = 1; // Transmitter constants export const TRANSMITTER_CREDIT_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold export const TRANSMITTER_NATIVE_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold - -// CCTP -export const MESSAGE_TRANSMITTER: { - [chainSlug: number]: string; -} = { - 421614: "0xaCF1ceeF35caAc005e15888dDb8A3515C41B4872", - 11155420: "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD", -}; - -export const CCTP_DOMAINS: { - [chainSlug: number]: number; -} = { - 421614: 3, - 11155420: 2, -}; diff --git a/hardhat-scripts/deploy/1.deploy.ts b/hardhat-scripts/deploy/1.deploy.ts index 3f088d74..8a7c1317 100644 --- a/hardhat-scripts/deploy/1.deploy.ts +++ b/hardhat-scripts/deploy/1.deploy.ts @@ -2,7 +2,12 @@ import { config } from "dotenv"; import { Contract, utils, Wallet } from "ethers"; import { formatEther } from "ethers/lib/utils"; import { ethers } from "hardhat"; -import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; +import { + ChainAddressesObj, + ChainSlug, + Contracts, + MESSAGE_TRANSMITTER, +} from "../../src"; import { AUCTION_END_DELAY_SECONDS, BID_TIMEOUT, @@ -13,7 +18,6 @@ import { logConfig, MAX_RE_AUCTION_COUNT, MAX_SCHEDULE_DELAY_SECONDS, - MESSAGE_TRANSMITTER, mode, READ_FEES, SCHEDULE_CALLBACK_FEES, diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index b5a568e5..3e196de8 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -2,9 +2,13 @@ import { config as dotenvConfig } from "dotenv"; dotenvConfig(); import { Contract, Signer, Wallet } from "ethers"; -import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; import { + ChainAddressesObj, + ChainSlug, + Contracts, CCTP_DOMAINS, +} from "../../src"; +import { chains, EVMX_CHAIN_ID, mainnetChains, diff --git a/src/cctp.ts b/src/cctp.ts new file mode 100644 index 00000000..c0436393 --- /dev/null +++ b/src/cctp.ts @@ -0,0 +1,34 @@ +import { ChainSlug } from "./chain-enums"; + +// CCTP +export const MESSAGE_TRANSMITTER: { + [chainSlug: number]: string; +} = { + [ChainSlug.SEPOLIA]: "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD", + [ChainSlug.OPTIMISM_SEPOLIA]: "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD", + [ChainSlug.ARBITRUM_SEPOLIA]: "0xaCF1ceeF35caAc005e15888dDb8A3515C41B4872", + [ChainSlug.BASE_SEPOLIA]: "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD", + [ChainSlug.POLYGON_AMOY]: "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD", + [ChainSlug.MAINNET]: "0x0a992d191DEeC32aFe36203Ad87D7d289a738F81", + [ChainSlug.AVALANCHE]: "0x8186359aF5F57FbB40c6b14A588d2A59C0C29880", + [ChainSlug.OPTIMISM]: "0x4D41f22c5a0e5c74090899E5a8Fb597a8842b3e8", + [ChainSlug.ARBITRUM]: "0xC30362313FBBA5cf9163F0bb16a0e01f01A896ca", + [ChainSlug.BASE]: "0xAD09780d193884d503182aD4588450C416D6F9D4", + [ChainSlug.POLYGON_MAINNET]: "0xF3be9355363857F3e001be68856A2f96b4C39Ba9", +}; + +export const CCTP_DOMAINS: { + [chainSlug: number]: number; +} = { + [ChainSlug.SEPOLIA]: 0, + [ChainSlug.OPTIMISM_SEPOLIA]: 2, + [ChainSlug.ARBITRUM_SEPOLIA]: 3, + [ChainSlug.BASE_SEPOLIA]: 6, + [ChainSlug.POLYGON_AMOY]: 7, + [ChainSlug.MAINNET]: 0, + [ChainSlug.AVALANCHE]: 1, + [ChainSlug.OPTIMISM]: 2, + [ChainSlug.ARBITRUM]: 3, + [ChainSlug.BASE]: 6, + [ChainSlug.POLYGON_MAINNET]: 7, +}; diff --git a/src/index.ts b/src/index.ts index 39a65132..e58e42d5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,3 +5,4 @@ export * from "./finality"; export * from "./types"; export * from "./constants"; export * from "./signer"; +export * from "./cctp"; From 1223806d70da8bb8aca60eae80d00ac80f063f67 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 23 Jun 2025 15:30:57 +0530 Subject: [PATCH 005/139] fix: tests update plugs, allowing partial deployment --- foundry.toml | 14 +- package.json | 2 +- script/helpers/TransferRemainingCredits.s.sol | 38 ++++ script/helpers/WithdrawRemainingCredits.s.sol | 30 +++ test/SetupTest.t.sol | 45 +++-- test/apps/CCTPSuperToken.t.sol | 179 ------------------ 6 files changed, 108 insertions(+), 200 deletions(-) create mode 100644 script/helpers/TransferRemainingCredits.s.sol create mode 100644 script/helpers/WithdrawRemainingCredits.s.sol delete mode 100644 test/apps/CCTPSuperToken.t.sol diff --git a/foundry.toml b/foundry.toml index 8dca882d..d7f33426 100644 --- a/foundry.toml +++ b/foundry.toml @@ -33,10 +33,10 @@ via_ir = false 0x7726e559A5129A9174f89F7E2029f7212B66dD13 = "WatcherImpl" 0xd8be408E271EEe9d3D0f28305bB9b6003589E1A9 = "WritePrecompile" 0xE24c4b0f67f566Fa558b3FE85f1780CD330f1F4D = "WritePrecompileImpl" -0xf9A93a92c0754084f6320f3fC1D54584C2e0439d = "CCTPSwitchboard" -0xAA78A6c96DF690d30eF161490f6590fCAb8f4406 = "ContractFactoryPlug" -0x696d7d0Af367cFE3d3c56BD61ca16B3A0939618b = "FastSwitchboard" -0xC6Fb338F2009B5AD1e1bbA2dd2c9f52e9dE2C91C = "FeesPlug" -0x4B5718c1f739A83EF5c75f64776f2c9D4D460B1D = "Socket" -0xc9E18b73C1A575D8A5975754a01CD19BE8400037 = "SocketBatcher" -0x86081C993583916720E58788b68292b2BBcDA6f3 = "APP_GATEWAY" +0x74A4aa989515b088A1aC33C5D59897f69cA66B91 = "CCTPSwitchboard" +0x25190648330361f35d00a0D41BD347de8E1B838C = "ContractFactoryPlug" +0x39d21e679312Bf0e3681bd0254c587E3528dd2a3 = "FastSwitchboard" +0xe9BDa44a39F8d29eaF1956EB05442551794871f3 = "FeesPlug" +0x86264607bAD260e9032add9e4E2DA74f71E354E0 = "Socket" +0x5B83E4104E37c7ECDf6Aeb62a4E204E4c63ac8D5 = "SocketBatcher" +0xfC3E610f631c02f7654DaC849B50994944d1FB8B = "APP_GATEWAY" diff --git a/package.json b/package.json index 265df42f..cc9063b6 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.1.22-test.1", + "version": "1.1.25", "description": "socket protocol", "scripts": { "build": "yarn abi && tsc --project lib.tsconfig.json", diff --git a/script/helpers/TransferRemainingCredits.s.sol b/script/helpers/TransferRemainingCredits.s.sol new file mode 100644 index 00000000..e0ae8cea --- /dev/null +++ b/script/helpers/TransferRemainingCredits.s.sol @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; +import {FeesManager} from "../../contracts/evmx/fees/FeesManager.sol"; +import {IAppGateway} from "../../contracts/evmx/interfaces/IAppGateway.sol"; + +contract TransferRemainingCredits is Script { + function run() external { + string memory rpc = vm.envString("EVMX_RPC"); + vm.createSelectFork(rpc); + + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + FeesManager feesManager = FeesManager(payable(vm.envAddress("FEES_MANAGER"))); + address appGateway = vm.envAddress("APP_GATEWAY"); + address newAppGateway = vm.envAddress("NEW_APP_GATEWAY"); + + (uint256 totalCredits, uint256 blockedCredits) = feesManager.userCredits(appGateway); + console.log("App Gateway:", appGateway); + console.log("New App Gateway:", newAppGateway); + console.log("Fees Manager:", address(feesManager)); + console.log("totalCredits fees:", totalCredits); + console.log("blockedCredits fees:", blockedCredits); + + uint256 availableFees = feesManager.getAvailableCredits(appGateway); + console.log("Available fees:", availableFees); + bytes memory data = abi.encodeWithSignature( + "transferCredits(address,uint256)", + newAppGateway, + availableFees + ); + (bool success, ) = appGateway.call(data); + require(success, "Transfer failed"); + vm.stopBroadcast(); + } +} diff --git a/script/helpers/WithdrawRemainingCredits.s.sol b/script/helpers/WithdrawRemainingCredits.s.sol new file mode 100644 index 00000000..c0b8bd31 --- /dev/null +++ b/script/helpers/WithdrawRemainingCredits.s.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import {Script} from "forge-std/Script.sol"; +import {console} from "forge-std/console.sol"; +import {FeesManager} from "../../contracts/evmx/fees/FeesManager.sol"; + +contract WithdrawRemainingCredits is Script { + function run() external { + string memory rpc = vm.envString("EVMX_RPC"); + vm.createSelectFork(rpc); + + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + FeesManager feesManager = FeesManager(payable(vm.envAddress("FEES_MANAGER"))); + address appGateway = vm.envAddress("APP_GATEWAY"); + + (uint256 totalCredits, uint256 blockedCredits) = feesManager.userCredits(appGateway); + console.log("App Gateway:", appGateway); + console.log("Fees Manager:", address(feesManager)); + console.log("totalCredits fees:", totalCredits); + console.log("blockedCredits fees:", blockedCredits); + + uint256 availableFees = feesManager.getAvailableCredits(appGateway); + console.log("Available fees:", availableFees); + feesManager.transferCredits(appGateway, vm.addr(deployerPrivateKey), availableFees); + + vm.stopBroadcast(); + } +} diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 3301afda..4b6715d2 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -1105,24 +1105,43 @@ contract WatcherSetup is AuctionSetup { IAppGateway appGateway_, bytes32[] memory contractIds_ ) internal { - AppGatewayConfig[] memory configs = new AppGatewayConfig[](contractIds_.length); + // Count valid plugs first. In some cases we might have contractIds such that oly a subset is + // deployed on a chain. for ex, vault on source, and supertoken on destination. + uint256 validPlugCount = 0; + for (uint i = 0; i < contractIds_.length; i++) { + address plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); + if (plug != address(0)) { + validPlugCount++; + } + } + + // Create array with exact size needed + AppGatewayConfig[] memory configs = new AppGatewayConfig[](validPlugCount); + uint256 configIndex = 0; for (uint i = 0; i < contractIds_.length; i++) { address plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); address switchboard = configurations.switchboards(chainSlug_, appGateway_.sbType()); - configs[i] = AppGatewayConfig({ - plug: plug, - chainSlug: chainSlug_, - plugConfig: PlugConfig({ - appGatewayId: encodeAppGatewayId(address(appGateway_)), - switchboard: switchboard - }) - }); + if (plug != address(0)) { + configs[configIndex] = AppGatewayConfig({ + plug: plug, + chainSlug: chainSlug_, + plugConfig: PlugConfig({ + appGatewayId: encodeAppGatewayId(address(appGateway_)), + switchboard: switchboard + }) + }); + configIndex++; + } + } + + // Only call watcher if we have valid configs + if (validPlugCount > 0) { + watcherMultiCall( + address(configurations), + abi.encodeWithSelector(Configurations.setAppGatewayConfigs.selector, configs) + ); } - watcherMultiCall( - address(configurations), - abi.encodeWithSelector(Configurations.setAppGatewayConfigs.selector, configs) - ); } } contract AppGatewayBaseSetup is WatcherSetup { diff --git a/test/apps/CCTPSuperToken.t.sol b/test/apps/CCTPSuperToken.t.sol deleted file mode 100644 index 3c7df780..00000000 --- a/test/apps/CCTPSuperToken.t.sol +++ /dev/null @@ -1,179 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.21; - -import {SuperTokenAppGateway} from "./app-gateways/super-token/SuperTokenAppGateway.sol"; -import {SuperToken} from "./app-gateways/super-token/SuperToken.sol"; -import "../SetupTest.t.sol"; - -/** - * @title SuperToken Test - * @notice Test contract for verifying the functionality of the SuperToken system, which enables - * multi-chain token bridging capabilities. - * @dev Inherits from AppGatewayBaseSetup to utilize multi-chain messaging infrastructure - * - * The test suite validates: - * - Contract deployment across different chains - * - Token transfers between chains - * - Proper balance updates - * - Integration with the delivery and auction system - */ -contract CCTPSuperTokenTest is AppGatewayBaseSetup { - /** - * @notice Groups the main contracts needed for SuperToken functionality - * @param superTokenApp The gateway contract that handles multi-chain token operations - * @param superTokenDeployer Contract responsible for deploying SuperToken instances - * @param superToken Identifier for the SuperToken contract - */ - struct AppContracts { - SuperTokenAppGateway superTokenApp; - bytes32 superToken; - } - address owner = address(uint160(c++)); - uint256 maxFees = 0.01 ether; - - /// @dev Main contracts used throughout the tests - AppContracts appContracts; - /// @dev Array storing contract IDs for deployment (currently only SuperToken) - bytes32[] contractIds = new bytes32[](1); - - /// @dev Test amount for token transfers (0.01 ETH) - uint256 srcAmount = 0.01 ether; - /// @dev Structure holding transfer order details - SuperTokenAppGateway.TransferOrder transferOrder; - - /** - * @notice Sets up the test environment - * @dev Initializes core infrastructure and deploys SuperToken-specific contracts - * Sequence: - * 1. Sets up delivery helper for multi-chain communication - * 2. Deploys SuperToken application - * 3. Initializes contract IDs array - */ - function setUp() public { - deploy(); - - SuperTokenAppGateway superTokenApp = new SuperTokenAppGateway( - address(addressResolver), - owner, - maxFees, - SuperTokenAppGateway.ConstructorParams({ - name_: "SUPER TOKEN", - symbol_: "SUPER", - decimals_: 18, - initialSupplyHolder_: owner, - initialSupply_: 1000000000 ether - }) - ); - vm.prank(owner); - superTokenApp.setSbType(CCTP); - // Enable app gateways to do all operations in the Watcher: Read, Write and Schedule on EVMx - // Watcher sets the limits for apps in this SOCKET protocol version - depositNativeAndCredits(arbChainSlug, 1 ether, 0, address(superTokenApp)); - - appContracts = AppContracts({ - superTokenApp: superTokenApp, - superToken: superTokenApp.superToken() - }); - - contractIds[0] = appContracts.superToken; - } - - /** - * @notice Deploys the SuperToken application and its components - * @dev Creates both the deployer and gateway contracts with initial configuration - * - Sets up SuperToken with "SUPER TOKEN" name and "SUPER" symbol - * - Configures initial supply of 1 billion tokens - * - Sets up fee structure and auction manager integration - */ - function deploySuperToken(uint32 chainSlug) internal { - appContracts.superTokenApp.deployContracts(chainSlug); - executeDeploy(IAppGateway(appContracts.superTokenApp), chainSlug, contractIds); - } - - /** - * @notice Tests the deployment of SuperToken contracts across chains - * @dev Verifies: - * - Correct deployment on target chain (Arbitrum in this case) - * - Proper initialization of token parameters - * - Correct setup of forwarder contracts for multi-chain communication - */ - function testCCTPContractDeployment() public { - deploySuperToken(arbChainSlug); - - (address onChain, address forwarder) = getOnChainAndForwarderAddresses( - arbChainSlug, - appContracts.superToken, - IAppGateway(appContracts.superTokenApp) - ); - - assertEq( - SuperToken(onChain).name(), - "SUPER TOKEN", - "OnChain SuperToken name should be SUPER TOKEN" - ); - - assertEq( - IForwarder(forwarder).getChainSlug(), - arbChainSlug, - "Forwarder SuperToken chainSlug should be arbChainSlug" - ); - - assertEq( - IForwarder(forwarder).getOnChainAddress(), - onChain, - "Forwarder SuperToken onChainAddress should be correct" - ); - assertEq(SuperToken(onChain).owner(), owner, "SuperToken owner should be correct"); - } - - /** - * @notice Tests multi-chain token transfers - * @dev Verifies: - * - Correct token burning on source chain (Arbitrum) - * - Correct token minting on destination chain (Optimism) - * - Accurate balance updates on both chains - * - Proper execution of multi-chain messaging - */ - function testCCTPTransfer() public { - deploySuperToken(arbChainSlug); - deploySuperToken(optChainSlug); - - (address onChainArb, address forwarderArb) = getOnChainAndForwarderAddresses( - arbChainSlug, - appContracts.superToken, - IAppGateway(appContracts.superTokenApp) - ); - - (address onChainOpt, address forwarderOpt) = getOnChainAndForwarderAddresses( - optChainSlug, - appContracts.superToken, - IAppGateway(appContracts.superTokenApp) - ); - - uint256 arbBalanceBefore = SuperToken(onChainArb).balanceOf(owner); - uint256 optBalanceBefore = SuperToken(onChainOpt).balanceOf(owner); - - transferOrder = SuperTokenAppGateway.TransferOrder({ - srcToken: forwarderArb, - dstToken: forwarderOpt, - user: owner, - srcAmount: srcAmount, - deadline: block.timestamp + 1000000 - }); - - bytes memory encodedOrder = abi.encode(transferOrder); - appContracts.superTokenApp.transfer(encodedOrder); - executeRequest(); - - assertEq( - SuperToken(onChainArb).balanceOf(owner), - arbBalanceBefore - srcAmount, - "Arb balance should be decreased by srcAmount" - ); - assertEq( - SuperToken(onChainOpt).balanceOf(owner), - optBalanceBefore + srcAmount, - "Opt balance should be increased by srcAmount" - ); - } -} From 1fe7b30bd6d8462bb52f575a72a009bfc2b3e5e4 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 23 Jun 2025 16:44:19 +0530 Subject: [PATCH 006/139] fix: rename previousDigestsHash -> prevBatchDigestHash --- Errors.md | 205 +++++++++--------- .../protocol/switchboard/CCTPSwitchboard.sol | 16 +- 2 files changed, 111 insertions(+), 110 deletions(-) diff --git a/Errors.md b/Errors.md index f88ea278..58f74337 100644 --- a/Errors.md +++ b/Errors.md @@ -1,155 +1,156 @@ # Custom Error Codes + ## evmx/fees/FeesPool.sol -| Error | Signature | -| ------------------ | ------------ | +| Error | Signature | +|-------|-----------| | `TransferFailed()` | `0x90b8ec18` | ## evmx/helpers/AsyncPromise.sol -| Error | Signature | -| -------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `PromiseAlreadyResolved()` | `0x56b63537` | -| `OnlyInvoker()` | `0x74ed21f5` | -| `PromiseAlreadySetUp()` | `0x927c53d5` | -| `PromiseRevertFailed()` | `0x0175b9de` | -| `NotLatestPromise()` | `0x39ca95d3` | +| `OnlyInvoker()` | `0x74ed21f5` | +| `PromiseAlreadySetUp()` | `0x927c53d5` | +| `PromiseRevertFailed()` | `0x0175b9de` | +| `NotLatestPromise()` | `0x39ca95d3` | ## evmx/plugs/ContractFactoryPlug.sol -| Error | Signature | -| -------------------------------- | ------------ | -| `DeploymentFailed()` | `0x30116425` | +| Error | Signature | +|-------|-----------| +| `DeploymentFailed()` | `0x30116425` | | `ExecutionFailed(bytes32,bytes)` | `0xd255d8a3` | -| `information(bool,,bytes)` | `0x3a82a1f3` | +| `information(bool,,bytes)` | `0x3a82a1f3` | ## evmx/plugs/FeesPlug.sol -| Error | Signature | -| --------------------------------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientTokenBalance(address,uint256,uint256)` | `0xebd6ced9` | -| `InvalidDepositAmount()` | `0xfe9ba5cd` | -| `TokenNotWhitelisted(address)` | `0xea3bff2e` | +| `InvalidDepositAmount()` | `0xfe9ba5cd` | +| `TokenNotWhitelisted(address)` | `0xea3bff2e` | ## evmx/watcher/RequestHandler.sol -| Error | Signature | -| ----------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientMaxFees()` | `0x0e5bc492` | ## protocol/Socket.sol -| Error | Signature | -| ----------------------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `PayloadAlreadyExecuted(ExecutionStatus)` | `0xf4c54edd` | -| `VerificationFailed()` | `0x439cc0cd` | -| `LowGasLimit()` | `0xd38edae0` | -| `InsufficientMsgValue()` | `0x78f38f76` | +| `VerificationFailed()` | `0x439cc0cd` | +| `LowGasLimit()` | `0xd38edae0` | +| `InsufficientMsgValue()` | `0x78f38f76` | ## protocol/SocketConfig.sol -| Error | Signature | -| ------------------------------- | ------------ | -| `SwitchboardExists()` | `0x2dff8555` | +| Error | Signature | +|-------|-----------| +| `SwitchboardExists()` | `0x2dff8555` | | `SwitchboardExistsOrDisabled()` | `0x1c7d2487` | ## protocol/SocketFeeManager.sol -| Error | Signature | -| -------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientFees()` | `0x8d53e553` | -| `FeeTooLow()` | `0x732f9413` | +| `FeeTooLow()` | `0x732f9413` | ## protocol/SocketUtils.sol -| Error | Signature | -| -------------------- | ------------ | -| `OnlyOffChain()` | `0x9cbfe066` | +| Error | Signature | +|-------|-----------| +| `OnlyOffChain()` | `0x9cbfe066` | | `SimulationFailed()` | `0x2fbab3ac` | ## protocol/switchboard/CCTPSwitchboard.sol -| Error | Signature | -| ------------------------------- | ------------ | -| `RemoteExecutionNotFound()` | `0xbd506972` | -| `DigestMismatch()` | `0x582e0907` | -| `PreviousDigestsHashMismatch()` | `0x3e62c52c` | -| `NotAttested()` | `0x99efb890` | -| `NotExecuted()` | `0xec84b1da` | -| `InvalidDomain()` | `0xeb127982` | -| `InvalidSender()` | `0xddb5de5e` | -| `OnlyMessageTransmitter()` | `0x935ac89c` | +| Error | Signature | +|-------|-----------| +| `RemoteExecutionNotFound()` | `0xbd506972` | +| `DigestMismatch()` | `0x582e0907` | +| `PrevBatchDigestHashMismatch()` | `0xc9864e9d` | +| `NotAttested()` | `0x99efb890` | +| `NotExecuted()` | `0xec84b1da` | +| `InvalidDomain()` | `0xeb127982` | +| `InvalidSender()` | `0xddb5de5e` | +| `OnlyMessageTransmitter()` | `0x935ac89c` | ## protocol/switchboard/FastSwitchboard.sol -| Error | Signature | -| ------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `AlreadyAttested()` | `0x35d90805` | | `WatcherNotFound()` | `0xa278e4ad` | ## utils/AccessControl.sol -| Error | Signature | -| ------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `NoPermit(bytes32)` | `0x962f6333` | ## utils/common/Errors.sol -| Error | Signature | -| --------------------------------------------- | ------------ | -| `ZeroAddress()` | `0xd92e233d` | -| `InvalidTransmitter()` | `0x58a70a0a` | -| `InvalidTokenAddress()` | `0x1eb00b06` | -| `InvalidSwitchboard()` | `0xf63c9e4d` | -| `SocketAlreadyInitialized()` | `0xc9500b00` | -| `NotSocket()` | `0xc59f8f7c` | -| `PlugNotFound()` | `0x5f1ac76a` | -| `ResolvingScheduleTooEarly()` | `0x207e8731` | -| `CallFailed()` | `0x3204506f` | -| `InvalidAppGateway()` | `0x82ded261` | -| `AppGatewayAlreadyCalled()` | `0xb224683f` | -| `InvalidCallerTriggered()` | `0x3292d247` | -| `InvalidPromise()` | `0x45f2d176` | -| `InvalidWatcherSignature()` | `0x5029f14f` | -| `NonceUsed()` | `0x1f6d5aef` | -| `AsyncModifierNotSet()` | `0xcae106f9` | -| `WatcherNotSet()` | `0x42d473a7` | -| `InvalidTarget()` | `0x82d5d76a` | -| `InvalidIndex()` | `0x63df8171` | -| `InvalidChainSlug()` | `0xbff6b106` | -| `InvalidPayloadSize()` | `0xfbdf7954` | -| `InvalidOnChainAddress()` | `0xb758c606` | -| `InvalidScheduleDelay()` | `0x9a993219` | -| `AuctionClosed()` | `0x36b6b46d` | -| `AuctionNotOpen()` | `0xf0460077` | -| `BidExceedsMaxFees()` | `0x4c923f3c` | -| `LowerBidAlreadyExists()` | `0xaaa1f709` | -| `RequestCountMismatch()` | `0x98bbcbff` | -| `InvalidAmount()` | `0x2c5211c6` | -| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | -| `InsufficientBalance()` | `0xf4d678b8` | -| `InvalidCaller()` | `0x48f5c3ed` | -| `InvalidGateway()` | `0xfc9dfe85` | -| `RequestAlreadyCancelled()` | `0xc70f47d8` | -| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | -| `InvalidBid()` | `0xc6388ef7` | -| `MaxReAuctionCountReached()` | `0xf2b4388c` | -| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | -| `OnlyWatcherAllowed()` | `0xdf7d227c` | -| `InvalidPrecompileData()` | `0x320062c0` | -| `InvalidCallType()` | `0x39d2eb55` | -| `NotRequestHandler()` | `0x8f8cba5b` | -| `NotInvoker()` | `0x8a6353d1` | -| `NotPromiseResolver()` | `0x86d876b2` | -| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | -| `InsufficientFees()` | `0x8d53e553` | -| `RequestAlreadySettled()` | `0x66fad465` | -| `NoWriteRequest()` | `0x9dcd3065` | -| `AlreadyAssigned()` | `0x9688dc51` | -| `OnlyAppGateway()` | `0xfec944ea` | +| Error | Signature | +|-------|-----------| +| `ZeroAddress()` | `0xd92e233d` | +| `InvalidTransmitter()` | `0x58a70a0a` | +| `InvalidTokenAddress()` | `0x1eb00b06` | +| `InvalidSwitchboard()` | `0xf63c9e4d` | +| `SocketAlreadyInitialized()` | `0xc9500b00` | +| `NotSocket()` | `0xc59f8f7c` | +| `PlugNotFound()` | `0x5f1ac76a` | +| `ResolvingScheduleTooEarly()` | `0x207e8731` | +| `CallFailed()` | `0x3204506f` | +| `InvalidAppGateway()` | `0x82ded261` | +| `AppGatewayAlreadyCalled()` | `0xb224683f` | +| `InvalidCallerTriggered()` | `0x3292d247` | +| `InvalidPromise()` | `0x45f2d176` | +| `InvalidWatcherSignature()` | `0x5029f14f` | +| `NonceUsed()` | `0x1f6d5aef` | +| `AsyncModifierNotSet()` | `0xcae106f9` | +| `WatcherNotSet()` | `0x42d473a7` | +| `InvalidTarget()` | `0x82d5d76a` | +| `InvalidIndex()` | `0x63df8171` | +| `InvalidChainSlug()` | `0xbff6b106` | +| `InvalidPayloadSize()` | `0xfbdf7954` | +| `InvalidOnChainAddress()` | `0xb758c606` | +| `InvalidScheduleDelay()` | `0x9a993219` | +| `AuctionClosed()` | `0x36b6b46d` | +| `AuctionNotOpen()` | `0xf0460077` | +| `BidExceedsMaxFees()` | `0x4c923f3c` | +| `LowerBidAlreadyExists()` | `0xaaa1f709` | +| `RequestCountMismatch()` | `0x98bbcbff` | +| `InvalidAmount()` | `0x2c5211c6` | +| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | +| `InsufficientBalance()` | `0xf4d678b8` | +| `InvalidCaller()` | `0x48f5c3ed` | +| `InvalidGateway()` | `0xfc9dfe85` | +| `RequestAlreadyCancelled()` | `0xc70f47d8` | +| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | +| `InvalidBid()` | `0xc6388ef7` | +| `MaxReAuctionCountReached()` | `0xf2b4388c` | +| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | +| `OnlyWatcherAllowed()` | `0xdf7d227c` | +| `InvalidPrecompileData()` | `0x320062c0` | +| `InvalidCallType()` | `0x39d2eb55` | +| `NotRequestHandler()` | `0x8f8cba5b` | +| `NotInvoker()` | `0x8a6353d1` | +| `NotPromiseResolver()` | `0x86d876b2` | +| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | +| `InsufficientFees()` | `0x8d53e553` | +| `RequestAlreadySettled()` | `0x66fad465` | +| `NoWriteRequest()` | `0x9dcd3065` | +| `AlreadyAssigned()` | `0x9688dc51` | +| `OnlyAppGateway()` | `0xfec944ea` | | `NewMaxFeesLowerThanCurrent(uint256,uint256)` | `0x1345dda1` | -| `InvalidContract()` | `0x6eefed20` | -| `InvalidData()` | `0x5cb045db` | -| `InvalidSignature()` | `0x8baa579f` | -| `DeadlinePassed()` | `0x70f65caa` | +| `InvalidContract()` | `0x6eefed20` | +| `InvalidData()` | `0x5cb045db` | +| `InvalidSignature()` | `0x8baa579f` | +| `DeadlinePassed()` | `0x70f65caa` | diff --git a/contracts/protocol/switchboard/CCTPSwitchboard.sol b/contracts/protocol/switchboard/CCTPSwitchboard.sol index 3be56b01..8c0965d1 100644 --- a/contracts/protocol/switchboard/CCTPSwitchboard.sol +++ b/contracts/protocol/switchboard/CCTPSwitchboard.sol @@ -28,7 +28,7 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { error RemoteExecutionNotFound(); error DigestMismatch(); - error PreviousDigestsHashMismatch(); + error PrevBatchDigestHashMismatch(); error NotAttested(); error NotExecuted(); error InvalidDomain(); @@ -121,18 +121,18 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { bytes calldata transmitterSignature_, ExecuteParams calldata executeParams_ ) external { - // Calculate previousDigestsHash from stored remoteExecutedDigests - bytes32 previousDigestsHash = bytes32(0); + // Calculate prevBatchDigestHash from stored remoteExecutedDigests + bytes32 prevBatchDigestHash = bytes32(0); for (uint256 i = 0; i < previousPayloadIds_.length; i++) { if (remoteExecutedDigests[previousPayloadIds_[i]] == bytes32(0)) revert RemoteExecutionNotFound(); - previousDigestsHash = keccak256( - abi.encodePacked(previousDigestsHash, remoteExecutedDigests[previousPayloadIds_[i]]) + prevBatchDigestHash = keccak256( + abi.encodePacked(prevBatchDigestHash, remoteExecutedDigests[previousPayloadIds_[i]]) ); } - // Check if the calculated previousDigestsHash matches the one in executeParams_ - if (previousDigestsHash != executeParams_.prevBatchDigestHash) - revert PreviousDigestsHashMismatch(); + // Check if the calculated prevBatchDigestHash matches the one in executeParams_ + if (prevBatchDigestHash != executeParams_.prevBatchDigestHash) + revert PrevBatchDigestHashMismatch(); address transmitter = _recoverSigner( keccak256(abi.encode(address(socket__), payloadId_)), From 45ca46616efd7f826c4c212a23f30fb58d1bc395 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 23 Jun 2025 16:44:52 +0530 Subject: [PATCH 007/139] chore: lint --- Errors.md | 203 +++++++++++++++++++++++++++--------------------------- 1 file changed, 101 insertions(+), 102 deletions(-) diff --git a/Errors.md b/Errors.md index 58f74337..a2a0fc42 100644 --- a/Errors.md +++ b/Errors.md @@ -1,156 +1,155 @@ # Custom Error Codes - ## evmx/fees/FeesPool.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ------------------ | ------------ | | `TransferFailed()` | `0x90b8ec18` | ## evmx/helpers/AsyncPromise.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| -------------------------- | ------------ | | `PromiseAlreadyResolved()` | `0x56b63537` | -| `OnlyInvoker()` | `0x74ed21f5` | -| `PromiseAlreadySetUp()` | `0x927c53d5` | -| `PromiseRevertFailed()` | `0x0175b9de` | -| `NotLatestPromise()` | `0x39ca95d3` | +| `OnlyInvoker()` | `0x74ed21f5` | +| `PromiseAlreadySetUp()` | `0x927c53d5` | +| `PromiseRevertFailed()` | `0x0175b9de` | +| `NotLatestPromise()` | `0x39ca95d3` | ## evmx/plugs/ContractFactoryPlug.sol -| Error | Signature | -|-------|-----------| -| `DeploymentFailed()` | `0x30116425` | +| Error | Signature | +| -------------------------------- | ------------ | +| `DeploymentFailed()` | `0x30116425` | | `ExecutionFailed(bytes32,bytes)` | `0xd255d8a3` | -| `information(bool,,bytes)` | `0x3a82a1f3` | +| `information(bool,,bytes)` | `0x3a82a1f3` | ## evmx/plugs/FeesPlug.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| --------------------------------------------------- | ------------ | | `InsufficientTokenBalance(address,uint256,uint256)` | `0xebd6ced9` | -| `InvalidDepositAmount()` | `0xfe9ba5cd` | -| `TokenNotWhitelisted(address)` | `0xea3bff2e` | +| `InvalidDepositAmount()` | `0xfe9ba5cd` | +| `TokenNotWhitelisted(address)` | `0xea3bff2e` | ## evmx/watcher/RequestHandler.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ----------------------- | ------------ | | `InsufficientMaxFees()` | `0x0e5bc492` | ## protocol/Socket.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ----------------------------------------- | ------------ | | `PayloadAlreadyExecuted(ExecutionStatus)` | `0xf4c54edd` | -| `VerificationFailed()` | `0x439cc0cd` | -| `LowGasLimit()` | `0xd38edae0` | -| `InsufficientMsgValue()` | `0x78f38f76` | +| `VerificationFailed()` | `0x439cc0cd` | +| `LowGasLimit()` | `0xd38edae0` | +| `InsufficientMsgValue()` | `0x78f38f76` | ## protocol/SocketConfig.sol -| Error | Signature | -|-------|-----------| -| `SwitchboardExists()` | `0x2dff8555` | +| Error | Signature | +| ------------------------------- | ------------ | +| `SwitchboardExists()` | `0x2dff8555` | | `SwitchboardExistsOrDisabled()` | `0x1c7d2487` | ## protocol/SocketFeeManager.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| -------------------- | ------------ | | `InsufficientFees()` | `0x8d53e553` | -| `FeeTooLow()` | `0x732f9413` | +| `FeeTooLow()` | `0x732f9413` | ## protocol/SocketUtils.sol -| Error | Signature | -|-------|-----------| -| `OnlyOffChain()` | `0x9cbfe066` | +| Error | Signature | +| -------------------- | ------------ | +| `OnlyOffChain()` | `0x9cbfe066` | | `SimulationFailed()` | `0x2fbab3ac` | ## protocol/switchboard/CCTPSwitchboard.sol -| Error | Signature | -|-------|-----------| -| `RemoteExecutionNotFound()` | `0xbd506972` | -| `DigestMismatch()` | `0x582e0907` | +| Error | Signature | +| ------------------------------- | ------------ | +| `RemoteExecutionNotFound()` | `0xbd506972` | +| `DigestMismatch()` | `0x582e0907` | | `PrevBatchDigestHashMismatch()` | `0xc9864e9d` | -| `NotAttested()` | `0x99efb890` | -| `NotExecuted()` | `0xec84b1da` | -| `InvalidDomain()` | `0xeb127982` | -| `InvalidSender()` | `0xddb5de5e` | -| `OnlyMessageTransmitter()` | `0x935ac89c` | +| `NotAttested()` | `0x99efb890` | +| `NotExecuted()` | `0xec84b1da` | +| `InvalidDomain()` | `0xeb127982` | +| `InvalidSender()` | `0xddb5de5e` | +| `OnlyMessageTransmitter()` | `0x935ac89c` | ## protocol/switchboard/FastSwitchboard.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ------------------- | ------------ | | `AlreadyAttested()` | `0x35d90805` | | `WatcherNotFound()` | `0xa278e4ad` | ## utils/AccessControl.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ------------------- | ------------ | | `NoPermit(bytes32)` | `0x962f6333` | ## utils/common/Errors.sol -| Error | Signature | -|-------|-----------| -| `ZeroAddress()` | `0xd92e233d` | -| `InvalidTransmitter()` | `0x58a70a0a` | -| `InvalidTokenAddress()` | `0x1eb00b06` | -| `InvalidSwitchboard()` | `0xf63c9e4d` | -| `SocketAlreadyInitialized()` | `0xc9500b00` | -| `NotSocket()` | `0xc59f8f7c` | -| `PlugNotFound()` | `0x5f1ac76a` | -| `ResolvingScheduleTooEarly()` | `0x207e8731` | -| `CallFailed()` | `0x3204506f` | -| `InvalidAppGateway()` | `0x82ded261` | -| `AppGatewayAlreadyCalled()` | `0xb224683f` | -| `InvalidCallerTriggered()` | `0x3292d247` | -| `InvalidPromise()` | `0x45f2d176` | -| `InvalidWatcherSignature()` | `0x5029f14f` | -| `NonceUsed()` | `0x1f6d5aef` | -| `AsyncModifierNotSet()` | `0xcae106f9` | -| `WatcherNotSet()` | `0x42d473a7` | -| `InvalidTarget()` | `0x82d5d76a` | -| `InvalidIndex()` | `0x63df8171` | -| `InvalidChainSlug()` | `0xbff6b106` | -| `InvalidPayloadSize()` | `0xfbdf7954` | -| `InvalidOnChainAddress()` | `0xb758c606` | -| `InvalidScheduleDelay()` | `0x9a993219` | -| `AuctionClosed()` | `0x36b6b46d` | -| `AuctionNotOpen()` | `0xf0460077` | -| `BidExceedsMaxFees()` | `0x4c923f3c` | -| `LowerBidAlreadyExists()` | `0xaaa1f709` | -| `RequestCountMismatch()` | `0x98bbcbff` | -| `InvalidAmount()` | `0x2c5211c6` | -| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | -| `InsufficientBalance()` | `0xf4d678b8` | -| `InvalidCaller()` | `0x48f5c3ed` | -| `InvalidGateway()` | `0xfc9dfe85` | -| `RequestAlreadyCancelled()` | `0xc70f47d8` | -| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | -| `InvalidBid()` | `0xc6388ef7` | -| `MaxReAuctionCountReached()` | `0xf2b4388c` | -| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | -| `OnlyWatcherAllowed()` | `0xdf7d227c` | -| `InvalidPrecompileData()` | `0x320062c0` | -| `InvalidCallType()` | `0x39d2eb55` | -| `NotRequestHandler()` | `0x8f8cba5b` | -| `NotInvoker()` | `0x8a6353d1` | -| `NotPromiseResolver()` | `0x86d876b2` | -| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | -| `InsufficientFees()` | `0x8d53e553` | -| `RequestAlreadySettled()` | `0x66fad465` | -| `NoWriteRequest()` | `0x9dcd3065` | -| `AlreadyAssigned()` | `0x9688dc51` | -| `OnlyAppGateway()` | `0xfec944ea` | +| Error | Signature | +| --------------------------------------------- | ------------ | +| `ZeroAddress()` | `0xd92e233d` | +| `InvalidTransmitter()` | `0x58a70a0a` | +| `InvalidTokenAddress()` | `0x1eb00b06` | +| `InvalidSwitchboard()` | `0xf63c9e4d` | +| `SocketAlreadyInitialized()` | `0xc9500b00` | +| `NotSocket()` | `0xc59f8f7c` | +| `PlugNotFound()` | `0x5f1ac76a` | +| `ResolvingScheduleTooEarly()` | `0x207e8731` | +| `CallFailed()` | `0x3204506f` | +| `InvalidAppGateway()` | `0x82ded261` | +| `AppGatewayAlreadyCalled()` | `0xb224683f` | +| `InvalidCallerTriggered()` | `0x3292d247` | +| `InvalidPromise()` | `0x45f2d176` | +| `InvalidWatcherSignature()` | `0x5029f14f` | +| `NonceUsed()` | `0x1f6d5aef` | +| `AsyncModifierNotSet()` | `0xcae106f9` | +| `WatcherNotSet()` | `0x42d473a7` | +| `InvalidTarget()` | `0x82d5d76a` | +| `InvalidIndex()` | `0x63df8171` | +| `InvalidChainSlug()` | `0xbff6b106` | +| `InvalidPayloadSize()` | `0xfbdf7954` | +| `InvalidOnChainAddress()` | `0xb758c606` | +| `InvalidScheduleDelay()` | `0x9a993219` | +| `AuctionClosed()` | `0x36b6b46d` | +| `AuctionNotOpen()` | `0xf0460077` | +| `BidExceedsMaxFees()` | `0x4c923f3c` | +| `LowerBidAlreadyExists()` | `0xaaa1f709` | +| `RequestCountMismatch()` | `0x98bbcbff` | +| `InvalidAmount()` | `0x2c5211c6` | +| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | +| `InsufficientBalance()` | `0xf4d678b8` | +| `InvalidCaller()` | `0x48f5c3ed` | +| `InvalidGateway()` | `0xfc9dfe85` | +| `RequestAlreadyCancelled()` | `0xc70f47d8` | +| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | +| `InvalidBid()` | `0xc6388ef7` | +| `MaxReAuctionCountReached()` | `0xf2b4388c` | +| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | +| `OnlyWatcherAllowed()` | `0xdf7d227c` | +| `InvalidPrecompileData()` | `0x320062c0` | +| `InvalidCallType()` | `0x39d2eb55` | +| `NotRequestHandler()` | `0x8f8cba5b` | +| `NotInvoker()` | `0x8a6353d1` | +| `NotPromiseResolver()` | `0x86d876b2` | +| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | +| `InsufficientFees()` | `0x8d53e553` | +| `RequestAlreadySettled()` | `0x66fad465` | +| `NoWriteRequest()` | `0x9dcd3065` | +| `AlreadyAssigned()` | `0x9688dc51` | +| `OnlyAppGateway()` | `0xfec944ea` | | `NewMaxFeesLowerThanCurrent(uint256,uint256)` | `0x1345dda1` | -| `InvalidContract()` | `0x6eefed20` | -| `InvalidData()` | `0x5cb045db` | -| `InvalidSignature()` | `0x8baa579f` | -| `DeadlinePassed()` | `0x70f65caa` | +| `InvalidContract()` | `0x6eefed20` | +| `InvalidData()` | `0x5cb045db` | +| `InvalidSignature()` | `0x8baa579f` | +| `DeadlinePassed()` | `0x70f65caa` | From eab84a580d1029a7073a4e3d6eede51264a80916 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 23 Jun 2025 16:54:47 +0530 Subject: [PATCH 008/139] chore: dev deployment --- deployments/dev_addresses.json | 83 +++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 6e0444a6..e41f9235 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -1,44 +1,55 @@ { + "84532": { + "CCTPSwitchboard": "0xb2B779ab8FC851bCE986d25B2824933B0Cd101d9", + "ContractFactoryPlug": "0x2e0fE75Bd247d7441f279388CD0e3a77FEcddADf", + "FastSwitchboard": "0xaFFfaD81e6DDE509Bd83Ab2024225b2FF537BeA7", + "FeesPlug": "0x1dc20d27F06876cA74ee4e2E9a4724f06a4a5E54", + "Socket": "0x9B06e2Dae351ed8B1112C036e5c306E8fBe4C9c5", + "SocketBatcher": "0xd627BFe7d2fCAC1147c996a6F2CAaB2E1e1bD344", + "startBlock": 27234828 + }, "421614": { - "ContractFactoryPlug": "0x7b9928b01272b915050aDfcba7e0a11b22271BAd", - "FastSwitchboard": "0x2974E94c0d1323D3A24f7B4F924fbdB325Be1aa3", - "FeesPlug": "0xaFD76cADB518E7e5131991Fe4403e00297916957", - "Socket": "0xb7378ae43b135988C8a83dfD1AcD71Ff39381396", - "SocketBatcher": "0x60541d31Fda60163480CAb486be3762b5793B650", - "startBlock": 159641867 + "CCTPSwitchboard": "0x74A4aa989515b088A1aC33C5D59897f69cA66B91", + "ContractFactoryPlug": "0x25190648330361f35d00a0D41BD347de8E1B838C", + "FastSwitchboard": "0x39d21e679312Bf0e3681bd0254c587E3528dd2a3", + "FeesPlug": "0xe9BDa44a39F8d29eaF1956EB05442551794871f3", + "Socket": "0x86264607bAD260e9032add9e4E2DA74f71E354E0", + "SocketBatcher": "0x5B83E4104E37c7ECDf6Aeb62a4E204E4c63ac8D5", + "startBlock": 157984273 }, "7625382": { - "AddressResolver": "0x8161cDBa2d2fCE66307254AAC1d42966D4F5353E", - "AddressResolverImpl": "0x91e548d87768313C03da8405D01171b83912c430", - "AsyncDeployer": "0x025b308371dC1C5e337527f96BE46Ba6A12c774A", - "AsyncDeployerImpl": "0x80CFbD3B6134Fb2D2B7d21FC132a9F7c115e7B72", - "AuctionManager": "0xA40aFA1632328D84226084a4539B3869D2B68e28", - "AuctionManagerImpl": "0x42109F6212765ABeb589f9b2c14Bee4b8DB3e638", - "Configurations": "0x60185198097df249B504D5A164323eBF42B3764d", - "ConfigurationsImpl": "0x0d2646fC08af29A7799Af435c5ABBA1b020C4dC7", - "DeployForwarder": "0xdC51D652B8c3cCB3cAAB9C1E2704fD4D62E76433", - "DeployForwarderImpl": "0xCe95fca954a0BF43c299c79d5152f2c164C02b7A", - "ERC1967Factory": "0xb0364Fd8f158071831ac87E7EE2C792Ab509a524", - "FeesManager": "0x09F824Eae77f71279d73Ae24FEb2163FCe88B25D", - "FeesManagerImpl": "0x5b460B29750648f6D569Ed57139967BE589174F8", - "FeesPool": "0xc20Be67ef742202dc93A78aa741E7C3715eA1DFd", - "PromiseResolver": "0xcfFda1dF8668266E6A77809EcA9CCA8A632ecaF3", - "ReadPrecompile": "0x254Dc9e0623426A79F02D2001E367cd32B50aaaA", - "RequestHandler": "0x1FE7527a8620374B3Fdb101bA1D56eC46EC9a24A", - "RequestHandlerImpl": "0x3d9578B252ed1F5A66348Cc40E482dacc32Ae790", - "SchedulePrecompile": "0x7D6F2A4aDf7e5Cfcf9627CC7FCA1d39fD19C07fc", - "startBlock": 8355289, - "Watcher": "0xD5b30DC89D96ee7303Dc2726491996B46089F693", - "WatcherImpl": "0x872bb254118a2210e3C491918133F2ab4D7Bc362", - "WritePrecompile": "0x10eaDbd1a2787ebbF4Abe9b6D79e669C0c8E8B26", - "WritePrecompileImpl": "0xD3aEb53da0a72788C16eAf5a23a5aBae6708C073" + "AddressResolver": "0x67790E222c41b0E787C278e757b7c40f03Fa5709", + "AddressResolverImpl": "0x89C928379fED43B7117b852931e2968ce39C8380", + "AsyncDeployer": "0x1C70bc3043667e884222B8835E0Ae554eb512810", + "AsyncDeployerImpl": "0x09a762309c63a4e19cd3d822aA340Fe964Ba9C92", + "AuctionManager": "0xC12aDF88dfc116CAF88816d150FE498843dABEEe", + "AuctionManagerImpl": "0x55b76897b3BF6ED04188cbaa7DC21ae14b35D3eE", + "Configurations": "0x377431bD1A3321C401542C8B1EC6E0c23E125042", + "ConfigurationsImpl": "0xDe5DedAe6e17f906D1269D5e84BEfB06F3926310", + "DeployForwarder": "0xd48218b2DafF9063177b0c6Bae229ec6C5f086a9", + "DeployForwarderImpl": "0x8e178161BB3B36a28C15DFBe3142afF8757B8993", + "ERC1967Factory": "0x870fCA8803bEFd119B1317AFB6794F97af7e515e", + "FeesManager": "0x761A9024D267006061ec943d02e3949678906f3E", + "FeesManagerImpl": "0x29C583B64FD2d7b70f8F6253C2a28D60af364Cb5", + "FeesPool": "0x9De353dD1131aB4e502590D3a1832652FA316268", + "PromiseResolver": "0x73b1B3dF6C71e0aa912f9d6933920D4461ae9718", + "ReadPrecompile": "0x58f49313816c1876417EE53De8F5de047359fB2C", + "RequestHandler": "0x63a6D7096b5a2F5c9Ce7D8632A7A2034A85b7F01", + "RequestHandlerImpl": "0x593f4844ceEA828bC6d9D78A0ef7Ce64F42190dC", + "SchedulePrecompile": "0xF77d2059a66026Efac11334D30372429553CAaC3", + "startBlock": 8626651, + "Watcher": "0xe4D1B4B8c0eEE90ac1f5314e758446CBa201BBA8", + "WatcherImpl": "0x7726e559A5129A9174f89F7E2029f7212B66dD13", + "WritePrecompile": "0xd8be408E271EEe9d3D0f28305bB9b6003589E1A9", + "WritePrecompileImpl": "0xE24c4b0f67f566Fa558b3FE85f1780CD330f1F4D" }, "11155420": { - "ContractFactoryPlug": "0x0279A18d5FC235A92fB4ABd5F7e9258e78E27948", - "FastSwitchboard": "0x6b4EF1452265193798bfa3ef6D29421da9e7E222", - "FeesPlug": "0x5E175fD699E066D6536054198d57AF0De88C7c4E", - "Socket": "0xB260A4DD0952e9A5b5F6652019469F05Fb137dC5", - "SocketBatcher": "0xc320FC7b06D4491A9E7e6fa55a3305b12548519e", - "startBlock": 28568337 + "CCTPSwitchboard": "0xf9A93a92c0754084f6320f3fC1D54584C2e0439d", + "ContractFactoryPlug": "0xAA78A6c96DF690d30eF161490f6590fCAb8f4406", + "FastSwitchboard": "0x696d7d0Af367cFE3d3c56BD61ca16B3A0939618b", + "FeesPlug": "0xC6Fb338F2009B5AD1e1bbA2dd2c9f52e9dE2C91C", + "Socket": "0x4B5718c1f739A83EF5c75f64776f2c9D4D460B1D", + "SocketBatcher": "0xc9E18b73C1A575D8A5975754a01CD19BE8400037", + "startBlock": 28356082 } } From 2b98150c6cb64993971306fa83b47c1d338b5fe2 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 23 Jun 2025 23:02:14 +0530 Subject: [PATCH 009/139] fix: PR comments, cleanup --- contracts/protocol/SocketBatcher.sol | 35 +++----- .../protocol/interfaces/ICCTPSwitchboard.sol | 15 ++-- contracts/protocol/interfaces/ISocket.sol | 2 + .../protocol/switchboard/CCTPSwitchboard.sol | 87 +++++-------------- .../protocol/switchboard/FastSwitchboard.sol | 2 +- test/SetupTest.t.sol | 27 +++--- test/mock/MockSocket.sol | 2 + 7 files changed, 59 insertions(+), 111 deletions(-) diff --git a/contracts/protocol/SocketBatcher.sol b/contracts/protocol/SocketBatcher.sol index 7e2384bd..d9f12878 100644 --- a/contracts/protocol/SocketBatcher.sol +++ b/contracts/protocol/SocketBatcher.sol @@ -62,18 +62,17 @@ contract SocketBatcher is ISocketBatcher, Ownable { CCTPBatchParams calldata cctpParams_, address switchboard_ ) external payable returns (bool, bytes memory) { - bytes32 payloadId = _createPayloadId(execParams_.executeParams, switchboard_); - ICCTPSwitchboard(switchboard_).attest(payloadId, execParams_.digest, execParams_.proof); - - ICCTPSwitchboard(switchboard_).verifyAttestations( - cctpParams_.messages, - cctpParams_.attestations + bytes32 payloadId = createPayloadId( + execParams_.executeParams.requestCount, + execParams_.executeParams.batchCount, + execParams_.executeParams.payloadCount, + switchboard_, + socket__.chainSlug() ); - ICCTPSwitchboard(switchboard_).proveRemoteExecutions( - cctpParams_.previousPayloadIds, - payloadId, - execParams_.transmitterSignature, - execParams_.executeParams + ICCTPSwitchboard(switchboard_).attestVerifyAndProveExecutions( + execParams_, + cctpParams_, + payloadId ); (bool success, bytes memory returnData) = socket__.execute{value: msg.value}( execParams_.executeParams, @@ -89,20 +88,6 @@ contract SocketBatcher is ISocketBatcher, Ownable { return (success, returnData); } - function _createPayloadId( - ExecuteParams memory executeParams_, - address switchboard_ - ) internal view returns (bytes32) { - return - createPayloadId( - executeParams_.requestCount, - executeParams_.batchCount, - executeParams_.payloadCount, - switchboard_, - socket__.chainSlug() - ); - } - /** * @notice Rescues funds from the contract * @param token_ The address of the token to rescue diff --git a/contracts/protocol/interfaces/ICCTPSwitchboard.sol b/contracts/protocol/interfaces/ICCTPSwitchboard.sol index ac3bb40e..796ee602 100644 --- a/contracts/protocol/interfaces/ICCTPSwitchboard.sol +++ b/contracts/protocol/interfaces/ICCTPSwitchboard.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.21; import "./ISwitchboard.sol"; -import {ExecuteParams} from "../../utils/common/Structs.sol"; +import {ExecuteParams, CCTPExecutionParams, CCTPBatchParams} from "../../utils/common/Structs.sol"; /** * @title ISwitchboard @@ -10,13 +10,6 @@ import {ExecuteParams} from "../../utils/common/Structs.sol"; * digest is executed. */ interface ICCTPSwitchboard is ISwitchboard { - /** - * @notice Attests a payload - * @param digest_ The digest of the payload - * @param proof_ The proof of the payload - */ - function attest(bytes32 payloadId_, bytes32 digest_, bytes calldata proof_) external; - /** * @notice Syncs out a payload to the remote chains * @param payloadId_ The unique identifier for the payload @@ -59,4 +52,10 @@ interface ICCTPSwitchboard is ISwitchboard { bytes[] calldata messages_, bytes[] calldata attestations_ ) external; + + function attestVerifyAndProveExecutions( + CCTPExecutionParams calldata execParams_, + CCTPBatchParams calldata cctpParams_, + bytes32 payloadId_ + ) external; } diff --git a/contracts/protocol/interfaces/ISocket.sol b/contracts/protocol/interfaces/ISocket.sol index e27eaefd..e942ffed 100644 --- a/contracts/protocol/interfaces/ISocket.sol +++ b/contracts/protocol/interfaces/ISocket.sol @@ -80,4 +80,6 @@ interface ISocket { function payloadExecuted(bytes32 payloadId_) external view returns (ExecutionStatus); function chainSlug() external view returns (uint32); + + function payloadIdToDigest(bytes32 payloadId_) external view returns (bytes32); } diff --git a/contracts/protocol/switchboard/CCTPSwitchboard.sol b/contracts/protocol/switchboard/CCTPSwitchboard.sol index 8c0965d1..0a906451 100644 --- a/contracts/protocol/switchboard/CCTPSwitchboard.sol +++ b/contracts/protocol/switchboard/CCTPSwitchboard.sol @@ -3,35 +3,27 @@ pragma solidity ^0.8.21; import "./FastSwitchboard.sol"; import {ISocket} from "../interfaces/ISocket.sol"; -import {ExecuteParams, ExecutionStatus} from "../../utils/common/Structs.sol"; +import {ExecuteParams, ExecutionStatus, CCTPExecutionParams, CCTPBatchParams} from "../../utils/common/Structs.sol"; import {IMessageTransmitter} from "../interfaces/IMessageTransmitter.sol"; import {IMessageHandler} from "../interfaces/IMessageHandler.sol"; contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { struct RemoteEndpoint { - uint256 remoteChainId; - address remoteAddress; + bytes32 remoteAddress; uint32 remoteDomain; } + IMessageTransmitter public immutable messageTransmitter; // remoteChainSlug => remoteEndpoint mapping(uint32 => RemoteEndpoint) public remoteEndpoints; - // remoteDomain => remoteAddress - mapping(uint32 => address) public remoteAddresses; - mapping(bytes32 => bool) public isSyncedOut; - mapping(bytes32 => bytes32) public payloadIdToDigest; mapping(bytes32 => bytes32) public remoteExecutedDigests; mapping(bytes32 => bool) public isRemoteExecuted; - IMessageTransmitter public immutable messageTransmitter; - error RemoteExecutionNotFound(); - error DigestMismatch(); error PrevBatchDigestHashMismatch(); error NotAttested(); error NotExecuted(); - error InvalidDomain(); error InvalidSender(); error OnlyMessageTransmitter(); @@ -44,31 +36,13 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { messageTransmitter = IMessageTransmitter(messageTransmitter_); } - function attest(bytes32 payloadId_, bytes32 digest_, bytes calldata proof_) external { - address watcher = _recoverSigner( - keccak256(abi.encode(address(this), chainSlug, digest_)), - proof_ - ); - - if (isAttested[digest_]) revert AlreadyAttested(); - if (!_hasRole(WATCHER_ROLE, watcher)) revert WatcherNotFound(); - - isAttested[digest_] = true; - payloadIdToDigest[payloadId_] = digest_; - emit Attested(payloadId_, watcher); - } - function allowPacket(bytes32 digest_, bytes32 payloadId_) external view returns (bool) { // digest has enough attestations and is remote executed - return - payloadIdToDigest[payloadId_] == digest_ && - isAttested[digest_] && - isRemoteExecuted[payloadId_]; + return isAttested[digest_] && isRemoteExecuted[payloadId_]; } function syncOut(bytes32 payloadId_, uint32[] calldata remoteChainSlugs_) external { - bytes32 digest = payloadIdToDigest[payloadId_]; - + bytes32 digest = socket__.payloadIdToDigest(payloadId_); // not attested if (digest == bytes32(0) || !isAttested[digest]) revert NotAttested(); @@ -83,13 +57,7 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { bytes memory message = abi.encode(payloadId_, digest); for (uint256 i = 0; i < remoteChainSlugs_.length; i++) { RemoteEndpoint memory endpoint = remoteEndpoints[remoteChainSlugs_[i]]; - if (endpoint.remoteDomain == 0) revert InvalidDomain(); - - messageTransmitter.sendMessage( - endpoint.remoteDomain, - addressToBytes32(endpoint.remoteAddress), - message - ); + messageTransmitter.sendMessage(endpoint.remoteDomain, endpoint.remoteAddress, message); } } @@ -99,17 +67,14 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { bytes calldata messageBody ) external returns (bool) { if (msg.sender != address(messageTransmitter)) revert OnlyMessageTransmitter(); + if (remoteEndpoints[sourceDomain].remoteAddress != sender) revert InvalidSender(); (bytes32 payloadId, bytes32 digest) = abi.decode(messageBody, (bytes32, bytes32)); - if (remoteAddresses[sourceDomain] != bytes32ToAddress(sender)) { - revert InvalidSender(); - } - remoteExecutedDigests[payloadId] = digest; return true; } - function verifyAttestations(bytes[] calldata messages, bytes[] calldata attestations) external { + function verifyAttestations(bytes[] calldata messages, bytes[] calldata attestations) public { for (uint256 i = 0; i < messages.length; i++) { messageTransmitter.receiveMessage(messages[i], attestations[i]); } @@ -120,7 +85,7 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { bytes32 payloadId_, bytes calldata transmitterSignature_, ExecuteParams calldata executeParams_ - ) external { + ) public { // Calculate prevBatchDigestHash from stored remoteExecutedDigests bytes32 prevBatchDigestHash = bytes32(0); for (uint256 i = 0; i < previousPayloadIds_.length; i++) { @@ -148,11 +113,8 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { executeParams_ ); - bytes32 storedDigest = payloadIdToDigest[payloadId_]; // Verify the constructed digest matches the stored one - if (storedDigest == bytes32(0) || !isAttested[storedDigest]) revert NotAttested(); - if (constructedDigest != storedDigest) revert DigestMismatch(); - + if (!isAttested[constructedDigest]) revert NotAttested(); isRemoteExecuted[payloadId_] = true; } @@ -191,28 +153,27 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { function addRemoteEndpoint( uint32 remoteChainSlug_, - uint256 remoteChainId_, - address remoteAddress_, + bytes32 remoteAddress_, uint32 remoteDomain_ ) external onlyOwner { remoteEndpoints[remoteChainSlug_] = RemoteEndpoint({ - remoteChainId: remoteChainId_, remoteAddress: remoteAddress_, remoteDomain: remoteDomain_ }); - remoteAddresses[remoteDomain_] = remoteAddress_; } - function removeRemoteEndpoint(uint32 remoteChainSlug_) external onlyOwner { - uint32 remoteDomain = remoteEndpoints[remoteChainSlug_].remoteDomain; - delete remoteEndpoints[remoteChainSlug_]; - delete remoteAddresses[remoteDomain]; - } - - function addressToBytes32(address addr_) public pure returns (bytes32) { - return bytes32(uint256(uint160(addr_))); - } - function bytes32ToAddress(bytes32 addrBytes32_) public pure returns (address) { - return address(uint160(uint256(addrBytes32_))); + function attestVerifyAndProveExecutions( + CCTPExecutionParams calldata execParams_, + CCTPBatchParams calldata cctpParams_, + bytes32 payloadId_ + ) external { + attest(execParams_.digest, execParams_.proof); + verifyAttestations(cctpParams_.messages, cctpParams_.attestations); + proveRemoteExecutions( + cctpParams_.previousPayloadIds, + payloadId_, + execParams_.transmitterSignature, + execParams_.executeParams + ); } } diff --git a/contracts/protocol/switchboard/FastSwitchboard.sol b/contracts/protocol/switchboard/FastSwitchboard.sol index ee0679a4..8044cc38 100644 --- a/contracts/protocol/switchboard/FastSwitchboard.sol +++ b/contracts/protocol/switchboard/FastSwitchboard.sol @@ -39,7 +39,7 @@ contract FastSwitchboard is SwitchboardBase { * @param proof_ proof from watcher * @notice we are attesting a payload uniquely identified with digest. */ - function attest(bytes32 digest_, bytes calldata proof_) external { + function attest(bytes32 digest_, bytes calldata proof_) public virtual { if (isAttested[digest_]) revert AlreadyAttested(); address watcher = _recoverSigner( diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 4b6715d2..d0cd404f 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -70,7 +70,8 @@ contract SetupStore is Test { uint256 public payloadIdCounter; uint256 public triggerCounter; uint256 public asyncPromiseCounter; - + uint32 public optCCTPDomain = 2; + uint32 public arbCCTPDomain = 3; struct SocketContracts { uint32 chainSlug; Socket socket; @@ -129,15 +130,13 @@ contract DeploySetup is SetupStore { vm.startPrank(socketOwner); arbConfig.cctpSwitchboard.addRemoteEndpoint( optChainSlug, - optChainSlug, - address(optConfig.cctpSwitchboard), - optChainSlug + addressToBytes32(address(optConfig.cctpSwitchboard)), + optCCTPDomain ); optConfig.cctpSwitchboard.addRemoteEndpoint( arbChainSlug, - arbChainSlug, - address(arbConfig.cctpSwitchboard), - arbChainSlug + addressToBytes32(address(arbConfig.cctpSwitchboard)), + arbCCTPDomain ); vm.stopPrank(); // transfer eth to fees pool for native fee payouts @@ -1072,13 +1071,6 @@ contract WatcherSetup is AuctionSetup { return messages; } - function addressToBytes32(address addr_) internal pure returns (bytes32) { - return bytes32(uint256(uint160(addr_))); - } - function bytes32ToAddress(bytes32 addrBytes32_) internal pure returns (address) { - return address(uint160(uint256(addrBytes32_))); - } - function _resolvePromise(PromiseReturnData[] memory promiseReturnData) internal { watcherMultiCall( address(promiseResolver), @@ -1297,3 +1289,10 @@ contract AppGatewayBaseSetup is WatcherSetup { } } } + +function addressToBytes32(address addr_) pure returns (bytes32) { + return bytes32(uint256(uint160(addr_))); +} +function bytes32ToAddress(bytes32 addrBytes32_) pure returns (address) { + return address(uint160(uint256(addrBytes32_))); +} diff --git a/test/mock/MockSocket.sol b/test/mock/MockSocket.sol index 7ae53bfa..65a24240 100644 --- a/test/mock/MockSocket.sol +++ b/test/mock/MockSocket.sol @@ -24,6 +24,8 @@ contract MockSocket is ISocket { // plug => (appGateway, switchboard__) mapping(address => PlugConfig) internal _plugConfigs; + mapping(bytes32 => bytes32) public payloadIdToDigest; + function getPlugConfig( address plugAddress_ ) external view returns (bytes32 appGatewayId, address switchboard__) { From d831b3843da54876c03968c58c5084a2c9cecd33 Mon Sep 17 00:00:00 2001 From: Akash Date: Thu, 26 Jun 2025 15:20:35 +0530 Subject: [PATCH 010/139] feat: added RequestSettled, PlugAdded events for indexing --- src/enums.ts | 5 +++++ src/events.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/enums.ts b/src/enums.ts index 1c5879c9..a9bcceac 100644 --- a/src/enums.ts +++ b/src/enums.ts @@ -24,10 +24,15 @@ export enum Events { PromiseNotResolved = "PromiseNotResolved", MarkedRevert = "MarkedRevert", + // Configurations + PlugAdded = "PlugAdded", + // RequestHandler RequestSubmitted = "RequestSubmitted", RequestCancelled = "RequestCancelled", FeesIncreased = "FeesIncreased", + RequestSettled = "RequestSettled", + RequestCompletedWithErrors = "RequestCompletedWithErrors", // WritePrecompile WriteProofRequested = "WriteProofRequested", diff --git a/src/events.ts b/src/events.ts index 1d57f1aa..c70e5ffb 100644 --- a/src/events.ts +++ b/src/events.ts @@ -21,8 +21,12 @@ export const requestHandlerEvents = [ Events.RequestSubmitted, Events.FeesIncreased, Events.RequestCancelled, + Events.RequestSettled, + Events.RequestCompletedWithErrors, ]; +export const configurationsEvents = [Events.PlugAdded]; + export const writePrecompileEvents = [ Events.WriteProofRequested, Events.WriteProofUploaded, From 1db7c8bc14a285954c9c3b5572383e943eece54c Mon Sep 17 00:00:00 2001 From: Akash Date: Thu, 26 Jun 2025 15:20:51 +0530 Subject: [PATCH 011/139] fix: cctp remote endpoints --- Errors.md | 2 - FunctionSignatures.md | 62 +++++++++++++++---- .../protocol/switchboard/CCTPSwitchboard.sol | 15 +++-- hardhat-scripts/deploy/3.configureChains.ts | 12 ++-- hardhat-scripts/verify/verify.ts | 2 +- package.json | 2 +- 6 files changed, 70 insertions(+), 25 deletions(-) diff --git a/Errors.md b/Errors.md index a2a0fc42..3ee3e383 100644 --- a/Errors.md +++ b/Errors.md @@ -73,11 +73,9 @@ | Error | Signature | | ------------------------------- | ------------ | | `RemoteExecutionNotFound()` | `0xbd506972` | -| `DigestMismatch()` | `0x582e0907` | | `PrevBatchDigestHashMismatch()` | `0xc9864e9d` | | `NotAttested()` | `0x99efb890` | | `NotExecuted()` | `0xec84b1da` | -| `InvalidDomain()` | `0xeb127982` | | `InvalidSender()` | `0xddb5de5e` | | `OnlyMessageTransmitter()` | `0x935ac89c` | diff --git a/FunctionSignatures.md b/FunctionSignatures.md index c5445dae..3e54fa86 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -59,7 +59,7 @@ | `chainSlug` | `0xb349ba65` | | `completeOwnershipHandover` | `0xf04e283e` | | `connect` | `0xb3bde1aa` | -| `disableSwitchboard` | `0xe545b261` | +| `disableSwitchboard` | `0xc4d9a820` | | `enableSwitchboard` | `0xf97a498a` | | `execute` | `0xafa8b480` | | `getPlugConfig` | `0xf9778ee0` | @@ -86,18 +86,19 @@ ## SocketBatcher -| Function | Signature | -| ---------------------------- | ------------ | -| `attestAndExecute` | `0x66c7748a` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| ------------------------------ | ------------ | +| `attestAndExecute` | `0x66c7748a` | +| `attestCCTPAndProveAndExecute` | `0x6c5fd05f` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## SocketFeeManager @@ -472,6 +473,41 @@ | `watcherMultiCall` | `0x8021e82b` | | `watcher__` | `0x300bb063` | +## CCTPSwitchboard + +| Function | Signature | +| -------------------------------- | ------------ | +| `addRemoteEndpoint` | `0x7d396da5` | +| `allowPacket` | `0x21e9ec80` | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x63671b60` | +| `attestVerifyAndProveExecutions` | `0x3e9e97e2` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `chainSlugToRemoteEndpoint` | `0xa4500424` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `domainToRemoteEndpoint` | `0xc24964fe` | +| `grantRole` | `0x2f2ff15d` | +| `handleReceiveMessage` | `0x96abeb70` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `isRemoteExecuted` | `0x0cd97747` | +| `isSyncedOut` | `0x5ae5dfd6` | +| `messageTransmitter` | `0x7b04c181` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `proveRemoteExecutions` | `0xc36f2ca2` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `remoteExecutedDigests` | `0xecbf77d9` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `syncOut` | `0x69a60ff0` | +| `transferOwnership` | `0xf2fde38b` | +| `verifyAttestations` | `0x6f30514c` | + ## FastSwitchboard | Function | Signature | diff --git a/contracts/protocol/switchboard/CCTPSwitchboard.sol b/contracts/protocol/switchboard/CCTPSwitchboard.sol index 0a906451..63b39411 100644 --- a/contracts/protocol/switchboard/CCTPSwitchboard.sol +++ b/contracts/protocol/switchboard/CCTPSwitchboard.sol @@ -15,7 +15,10 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { IMessageTransmitter public immutable messageTransmitter; // remoteChainSlug => remoteEndpoint - mapping(uint32 => RemoteEndpoint) public remoteEndpoints; + mapping(uint32 => RemoteEndpoint) public chainSlugToRemoteEndpoint; + // remoteDomain => remoteEndpoint + mapping(uint32 => RemoteEndpoint) public domainToRemoteEndpoint; + mapping(bytes32 => bool) public isSyncedOut; mapping(bytes32 => bytes32) public remoteExecutedDigests; mapping(bytes32 => bool) public isRemoteExecuted; @@ -56,7 +59,7 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { bytes memory message = abi.encode(payloadId_, digest); for (uint256 i = 0; i < remoteChainSlugs_.length; i++) { - RemoteEndpoint memory endpoint = remoteEndpoints[remoteChainSlugs_[i]]; + RemoteEndpoint memory endpoint = chainSlugToRemoteEndpoint[remoteChainSlugs_[i]]; messageTransmitter.sendMessage(endpoint.remoteDomain, endpoint.remoteAddress, message); } } @@ -67,7 +70,7 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { bytes calldata messageBody ) external returns (bool) { if (msg.sender != address(messageTransmitter)) revert OnlyMessageTransmitter(); - if (remoteEndpoints[sourceDomain].remoteAddress != sender) revert InvalidSender(); + if (domainToRemoteEndpoint[sourceDomain].remoteAddress != sender) revert InvalidSender(); (bytes32 payloadId, bytes32 digest) = abi.decode(messageBody, (bytes32, bytes32)); remoteExecutedDigests[payloadId] = digest; @@ -156,7 +159,11 @@ contract CCTPSwitchboard is FastSwitchboard, IMessageHandler { bytes32 remoteAddress_, uint32 remoteDomain_ ) external onlyOwner { - remoteEndpoints[remoteChainSlug_] = RemoteEndpoint({ + chainSlugToRemoteEndpoint[remoteChainSlug_] = RemoteEndpoint({ + remoteAddress: remoteAddress_, + remoteDomain: remoteDomain_ + }); + domainToRemoteEndpoint[remoteDomain_] = RemoteEndpoint({ remoteAddress: remoteAddress_, remoteDomain: remoteDomain_ }); diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index d98ea557..58e3d48c 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -182,18 +182,22 @@ const addRemoteEndpointsToCCTPSwitchboard = async ( for (const remoteChainSlug of remoteChainSlugs) { const remoteSwitchboardAddress = addresses[remoteChainSlug]?.[Contracts.CCTPSwitchboard]; - const currentRemoteEndpoint = await switchboard.remoteEndpoints( + const currentRemoteEndpoint = await switchboard.chainSlugToRemoteEndpoint( remoteChainSlug ); if (currentRemoteEndpoint.remoteAddress == remoteSwitchboardAddress) { console.log(`Remote endpoint ${remoteChainSlug} already exists`); continue; } - + if (!remoteSwitchboardAddress) { + console.log( + `Remote switchboard address not found for ${remoteChainSlug}` + ); + continue; + } const registerTx = await switchboard.addRemoteEndpoint( remoteChainSlug, - remoteChainSlug, - remoteSwitchboardAddress, + `0x${remoteSwitchboardAddress.slice(2).padStart(64, "0")}`, CCTP_DOMAINS[remoteChainSlug], { ...(await overrides(chain)), diff --git a/hardhat-scripts/verify/verify.ts b/hardhat-scripts/verify/verify.ts index 9f6871ba..eaec585c 100644 --- a/hardhat-scripts/verify/verify.ts +++ b/hardhat-scripts/verify/verify.ts @@ -67,7 +67,7 @@ export const main = async () => { } await storeUnVerifiedParams(unverifiedChainParams, chain, mode); - await new Promise(resolve => setTimeout(resolve, 1000)); + await new Promise((resolve) => setTimeout(resolve, 1000)); retryCount++; if (unverifiedChainParams.length == 0) break; } diff --git a/package.json b/package.json index cc9063b6..644610ff 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.1.25", + "version": "1.1.28", "description": "socket protocol", "scripts": { "build": "yarn abi && tsc --project lib.tsconfig.json", From 913d6c935f01531f1f945a95ba9ba45660065fbc Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 27 Jun 2025 13:42:23 +0530 Subject: [PATCH 012/139] feat: replace function with calldata for onCompleteData --- contracts/evmx/base/AppGatewayBase.sol | 21 ++++++++++----------- contracts/evmx/fees/Credit.sol | 3 --- contracts/evmx/interfaces/IAppGateway.sol | 5 ----- contracts/evmx/watcher/RequestHandler.sol | 8 ++------ 4 files changed, 12 insertions(+), 25 deletions(-) diff --git a/contracts/evmx/base/AppGatewayBase.sol b/contracts/evmx/base/AppGatewayBase.sol index 5bcdb2db..cf534c7c 100644 --- a/contracts/evmx/base/AppGatewayBase.sol +++ b/contracts/evmx/base/AppGatewayBase.sol @@ -120,6 +120,12 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { IsPlug isPlug_, bytes memory initCallData_ ) internal { + onCompleteData = abi.encodeWithSelector( + this.onDeployComplete.selector, + watcher__().getCurrentRequestCount(), + abi.encode(chainSlug_) + ); + deployForwarder__().deploy( isPlug_, chainSlug_, @@ -128,7 +134,6 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { ); then(this.setAddress.selector, abi.encode(chainSlug_, contractId_)); - onCompleteData = abi.encode(chainSlug_, true); } /// @notice Sets the address for a deployed contract @@ -166,8 +171,7 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { return address(0); } - onChainAddress = IForwarder(forwarderAddresses[contractId_][chainSlug_]) - .getOnChainAddress(); + onChainAddress = IForwarder(forwarderAddresses[contractId_][chainSlug_]).getOnChainAddress(); } //////////////////////////////////////////////////////////////////////////////////////////////// @@ -362,15 +366,10 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { /// @param onCompleteData_ The on complete data /// @dev only payload delivery can call this /// @dev callback in pd promise to be called after all contracts are deployed - function onRequestComplete( - uint40, - bytes calldata onCompleteData_ - ) external override onlyWatcher { + function onDeployComplete(uint40, bytes calldata onCompleteData_) external onlyWatcher { if (onCompleteData_.length == 0) return; - (uint32 chainSlug, bool isDeploy) = abi.decode(onCompleteData_, (uint32, bool)); - if (isDeploy) { - initializeOnChain(chainSlug); - } + uint32 chainSlug = abi.decode(onCompleteData_, (uint32)); + initializeOnChain(chainSlug); } /// @notice Initializes the contract after deployment diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 4468d12f..31fb880d 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -313,9 +313,6 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AddressR signer = ECDSA.recover(digest, signature_); } - /// @notice hook called by watcher precompile when request is finished - function onRequestComplete(uint40, bytes memory) external {} - /// @notice hook to handle the revert while withdrawing credits /// @param payloadId_ The payload ID function handleRevert(bytes32 payloadId_) external { diff --git a/contracts/evmx/interfaces/IAppGateway.sol b/contracts/evmx/interfaces/IAppGateway.sol index 132e8c96..2689e0fb 100644 --- a/contracts/evmx/interfaces/IAppGateway.sol +++ b/contracts/evmx/interfaces/IAppGateway.sol @@ -15,11 +15,6 @@ interface IAppGateway { /// @return sbType_ The switchboard type function getOverrideParams() external view returns (OverrideParams memory, bytes32); - /// @notice Handles the request complete event - /// @param requestCount_ The request count - /// @param onCompleteData_ The on complete data - function onRequestComplete(uint40 requestCount_, bytes calldata onCompleteData_) external; - /// @notice Handles the revert event /// @param payloadId_ The payload id function handleRevert(bytes32 payloadId_) external; diff --git a/contracts/evmx/watcher/RequestHandler.sol b/contracts/evmx/watcher/RequestHandler.sol index f11ca0bf..c71b2e95 100644 --- a/contracts/evmx/watcher/RequestHandler.sol +++ b/contracts/evmx/watcher/RequestHandler.sol @@ -419,13 +419,9 @@ contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, Addres ); if (r.onCompleteData.length > 0) { - try - IAppGateway(r.appGateway).onRequestComplete(requestCount_, r.onCompleteData) - {} catch { - emit RequestCompletedWithErrors(requestCount_); - } + (bool success, ) = r.appGateway.call(r.onCompleteData); + if (!success) emit RequestCompletedWithErrors(requestCount_); } - emit RequestSettled(requestCount_, r.requestFeesDetails.winningBid.transmitter); } From cfc6f9b0905133e0c8a7b721b72b7f7afc8bc630 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 27 Jun 2025 13:44:30 +0530 Subject: [PATCH 013/139] fix: topics and signatures --- Errors.md | 185 ++++----- EventTopics.md | 391 +++++++++--------- FunctionSignatures.md | 932 +++++++++++++++++++++--------------------- 3 files changed, 756 insertions(+), 752 deletions(-) diff --git a/Errors.md b/Errors.md index 77179268..d40a6613 100644 --- a/Errors.md +++ b/Errors.md @@ -1,142 +1,143 @@ # Custom Error Codes + ## evmx/fees/FeesPool.sol -| Error | Signature | -| ------------------ | ------------ | +| Error | Signature | +|-------|-----------| | `TransferFailed()` | `0x90b8ec18` | ## evmx/helpers/AsyncPromise.sol -| Error | Signature | -| -------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `PromiseAlreadyResolved()` | `0x56b63537` | -| `OnlyInvoker()` | `0x74ed21f5` | -| `PromiseAlreadySetUp()` | `0x927c53d5` | -| `PromiseRevertFailed()` | `0x0175b9de` | -| `NotLatestPromise()` | `0x39ca95d3` | +| `OnlyInvoker()` | `0x74ed21f5` | +| `PromiseAlreadySetUp()` | `0x927c53d5` | +| `PromiseRevertFailed()` | `0x0175b9de` | +| `NotLatestPromise()` | `0x39ca95d3` | ## evmx/plugs/ContractFactoryPlug.sol -| Error | Signature | -| -------------------------------- | ------------ | -| `DeploymentFailed()` | `0x30116425` | +| Error | Signature | +|-------|-----------| +| `DeploymentFailed()` | `0x30116425` | | `ExecutionFailed(bytes32,bytes)` | `0xd255d8a3` | -| `information(bool,,bytes)` | `0x3a82a1f3` | +| `information(bool,,bytes)` | `0x3a82a1f3` | ## evmx/plugs/FeesPlug.sol -| Error | Signature | -| --------------------------------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientTokenBalance(address,uint256,uint256)` | `0xebd6ced9` | -| `InvalidDepositAmount()` | `0xfe9ba5cd` | -| `TokenNotWhitelisted(address)` | `0xea3bff2e` | +| `InvalidDepositAmount()` | `0xfe9ba5cd` | +| `TokenNotWhitelisted(address)` | `0xea3bff2e` | ## evmx/watcher/RequestHandler.sol -| Error | Signature | -| ----------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientMaxFees()` | `0x0e5bc492` | ## protocol/Socket.sol -| Error | Signature | -| ----------------------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `PayloadAlreadyExecuted(ExecutionStatus)` | `0xf4c54edd` | -| `VerificationFailed()` | `0x439cc0cd` | -| `LowGasLimit()` | `0xd38edae0` | -| `InsufficientMsgValue()` | `0x78f38f76` | +| `VerificationFailed()` | `0x439cc0cd` | +| `LowGasLimit()` | `0xd38edae0` | +| `InsufficientMsgValue()` | `0x78f38f76` | ## protocol/SocketConfig.sol -| Error | Signature | -| ------------------------------- | ------------ | -| `SwitchboardExists()` | `0x2dff8555` | +| Error | Signature | +|-------|-----------| +| `SwitchboardExists()` | `0x2dff8555` | | `SwitchboardExistsOrDisabled()` | `0x1c7d2487` | ## protocol/SocketFeeManager.sol -| Error | Signature | -| -------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientFees()` | `0x8d53e553` | -| `FeeTooLow()` | `0x732f9413` | +| `FeeTooLow()` | `0x732f9413` | ## protocol/SocketUtils.sol -| Error | Signature | -| -------------------- | ------------ | -| `OnlyOffChain()` | `0x9cbfe066` | +| Error | Signature | +|-------|-----------| +| `OnlyOffChain()` | `0x9cbfe066` | | `SimulationFailed()` | `0x2fbab3ac` | ## protocol/switchboard/FastSwitchboard.sol -| Error | Signature | -| ------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `AlreadyAttested()` | `0x35d90805` | | `WatcherNotFound()` | `0xa278e4ad` | ## utils/AccessControl.sol -| Error | Signature | -| ------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `NoPermit(bytes32)` | `0x962f6333` | ## utils/common/Errors.sol -| Error | Signature | -| --------------------------------------------- | ------------ | -| `ZeroAddress()` | `0xd92e233d` | -| `InvalidTransmitter()` | `0x58a70a0a` | -| `InvalidTokenAddress()` | `0x1eb00b06` | -| `InvalidSwitchboard()` | `0xf63c9e4d` | -| `SocketAlreadyInitialized()` | `0xc9500b00` | -| `NotSocket()` | `0xc59f8f7c` | -| `PlugNotFound()` | `0x5f1ac76a` | -| `ResolvingScheduleTooEarly()` | `0x207e8731` | -| `CallFailed()` | `0x3204506f` | -| `InvalidAppGateway()` | `0x82ded261` | -| `AppGatewayAlreadyCalled()` | `0xb224683f` | -| `InvalidCallerTriggered()` | `0x3292d247` | -| `InvalidPromise()` | `0x45f2d176` | -| `InvalidWatcherSignature()` | `0x5029f14f` | -| `NonceUsed()` | `0x1f6d5aef` | -| `AsyncModifierNotSet()` | `0xcae106f9` | -| `WatcherNotSet()` | `0x42d473a7` | -| `InvalidTarget()` | `0x82d5d76a` | -| `InvalidIndex()` | `0x63df8171` | -| `InvalidChainSlug()` | `0xbff6b106` | -| `InvalidPayloadSize()` | `0xfbdf7954` | -| `InvalidOnChainAddress()` | `0xb758c606` | -| `InvalidScheduleDelay()` | `0x9a993219` | -| `AuctionClosed()` | `0x36b6b46d` | -| `AuctionNotOpen()` | `0xf0460077` | -| `BidExceedsMaxFees()` | `0x4c923f3c` | -| `LowerBidAlreadyExists()` | `0xaaa1f709` | -| `RequestCountMismatch()` | `0x98bbcbff` | -| `InvalidAmount()` | `0x2c5211c6` | -| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | -| `InsufficientBalance()` | `0xf4d678b8` | -| `InvalidCaller()` | `0x48f5c3ed` | -| `InvalidGateway()` | `0xfc9dfe85` | -| `RequestAlreadyCancelled()` | `0xc70f47d8` | -| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | -| `InvalidBid()` | `0xc6388ef7` | -| `MaxReAuctionCountReached()` | `0xf2b4388c` | -| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | -| `OnlyWatcherAllowed()` | `0xdf7d227c` | -| `InvalidPrecompileData()` | `0x320062c0` | -| `InvalidCallType()` | `0x39d2eb55` | -| `NotRequestHandler()` | `0x8f8cba5b` | -| `NotInvoker()` | `0x8a6353d1` | -| `NotPromiseResolver()` | `0x86d876b2` | -| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | -| `InsufficientFees()` | `0x8d53e553` | -| `RequestAlreadySettled()` | `0x66fad465` | -| `NoWriteRequest()` | `0x9dcd3065` | -| `AlreadyAssigned()` | `0x9688dc51` | -| `OnlyAppGateway()` | `0xfec944ea` | +| Error | Signature | +|-------|-----------| +| `ZeroAddress()` | `0xd92e233d` | +| `InvalidTransmitter()` | `0x58a70a0a` | +| `InvalidTokenAddress()` | `0x1eb00b06` | +| `InvalidSwitchboard()` | `0xf63c9e4d` | +| `SocketAlreadyInitialized()` | `0xc9500b00` | +| `NotSocket()` | `0xc59f8f7c` | +| `PlugNotFound()` | `0x5f1ac76a` | +| `ResolvingScheduleTooEarly()` | `0x207e8731` | +| `CallFailed()` | `0x3204506f` | +| `InvalidAppGateway()` | `0x82ded261` | +| `AppGatewayAlreadyCalled()` | `0xb224683f` | +| `InvalidCallerTriggered()` | `0x3292d247` | +| `InvalidPromise()` | `0x45f2d176` | +| `InvalidWatcherSignature()` | `0x5029f14f` | +| `NonceUsed()` | `0x1f6d5aef` | +| `AsyncModifierNotSet()` | `0xcae106f9` | +| `WatcherNotSet()` | `0x42d473a7` | +| `InvalidTarget()` | `0x82d5d76a` | +| `InvalidIndex()` | `0x63df8171` | +| `InvalidChainSlug()` | `0xbff6b106` | +| `InvalidPayloadSize()` | `0xfbdf7954` | +| `InvalidOnChainAddress()` | `0xb758c606` | +| `InvalidScheduleDelay()` | `0x9a993219` | +| `AuctionClosed()` | `0x36b6b46d` | +| `AuctionNotOpen()` | `0xf0460077` | +| `BidExceedsMaxFees()` | `0x4c923f3c` | +| `LowerBidAlreadyExists()` | `0xaaa1f709` | +| `RequestCountMismatch()` | `0x98bbcbff` | +| `InvalidAmount()` | `0x2c5211c6` | +| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | +| `InsufficientBalance()` | `0xf4d678b8` | +| `InvalidCaller()` | `0x48f5c3ed` | +| `InvalidGateway()` | `0xfc9dfe85` | +| `RequestAlreadyCancelled()` | `0xc70f47d8` | +| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | +| `InvalidBid()` | `0xc6388ef7` | +| `MaxReAuctionCountReached()` | `0xf2b4388c` | +| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | +| `OnlyWatcherAllowed()` | `0xdf7d227c` | +| `InvalidPrecompileData()` | `0x320062c0` | +| `InvalidCallType()` | `0x39d2eb55` | +| `NotRequestHandler()` | `0x8f8cba5b` | +| `NotInvoker()` | `0x8a6353d1` | +| `NotPromiseResolver()` | `0x86d876b2` | +| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | +| `InsufficientFees()` | `0x8d53e553` | +| `RequestAlreadySettled()` | `0x66fad465` | +| `NoWriteRequest()` | `0x9dcd3065` | +| `AlreadyAssigned()` | `0x9688dc51` | +| `OnlyAppGateway()` | `0xfec944ea` | | `NewMaxFeesLowerThanCurrent(uint256,uint256)` | `0x1345dda1` | -| `InvalidContract()` | `0x6eefed20` | -| `InvalidData()` | `0x5cb045db` | -| `InvalidSignature()` | `0x8baa579f` | -| `DeadlinePassed()` | `0x70f65caa` | +| `InvalidContract()` | `0x6eefed20` | +| `InvalidData()` | `0x5cb045db` | +| `InvalidSignature()` | `0x8baa579f` | +| `DeadlinePassed()` | `0x70f65caa` | diff --git a/EventTopics.md b/EventTopics.md index c94cd569..bd78eac5 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -2,267 +2,270 @@ ## AuctionManager -| Event | Arguments | Topic | -| ---------------------------- | ------------------------------------------- | -------------------------------------------------------------------- | -| `AuctionEndDelaySecondsSet` | `(auctionEndDelaySeconds: uint256)` | `0xf38f0d9dc8459cf5426728c250d115196a4c065ebc1a6c29da24764a8c0da722` | -| `AuctionEnded` | `(requestCount: uint40, winningBid: tuple)` | `0xede4ec1efc469fac10dcb4930f70be4cd21f3700ed61c91967c19a7cd7c0d86e` | -| `AuctionRestarted` | `(requestCount: uint40)` | `0x071867b21946ec4655665f0d4515d3757a5a52f144c762ecfdfb11e1da542b82` | -| `AuctionStarted` | `(requestCount: uint40)` | `0xcd040613cf8ef0cfcaa3af0d711783e827a275fc647c116b74595bf17cb9364f` | -| `BidPlaced` | `(requestCount: uint40, bid: tuple)` | `0x7f79485e4c9aeea5d4899bc6f7c63b22ac1f4c01d2d28c801e94732fee657b5d` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `MaxReAuctionCountSet` | `(maxReAuctionCount: uint256)` | `0x2f6fadde7ab8ab83d21ab10c3bc09dde179f8696d47c4176581facf0c6f96bbf` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AuctionEndDelaySecondsSet` | `(auctionEndDelaySeconds: uint256)` | `0xf38f0d9dc8459cf5426728c250d115196a4c065ebc1a6c29da24764a8c0da722` | +| `AuctionEnded` | `(requestCount: uint40, winningBid: tuple)` | `0xede4ec1efc469fac10dcb4930f70be4cd21f3700ed61c91967c19a7cd7c0d86e` | +| `AuctionRestarted` | `(requestCount: uint40)` | `0x071867b21946ec4655665f0d4515d3757a5a52f144c762ecfdfb11e1da542b82` | +| `AuctionStarted` | `(requestCount: uint40)` | `0xcd040613cf8ef0cfcaa3af0d711783e827a275fc647c116b74595bf17cb9364f` | +| `BidPlaced` | `(requestCount: uint40, bid: tuple)` | `0x7f79485e4c9aeea5d4899bc6f7c63b22ac1f4c01d2d28c801e94732fee657b5d` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `MaxReAuctionCountSet` | `(maxReAuctionCount: uint256)` | `0x2f6fadde7ab8ab83d21ab10c3bc09dde179f8696d47c4176581facf0c6f96bbf` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## Socket -| Event | Arguments | Topic | -| ---------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `AppGatewayCallRequested` | `(triggerId: bytes32, appGatewayId: bytes32, switchboard: address, plug: address, overrides: bytes, payload: bytes)` | `0x5c88d65ab8ba22a57e582bd8ddfa9801cc0ca6be6cb3182baaedc705a612419e` | -| `ExecutionFailed` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x385334bc68a32c4d164625189adc7633e6074eb1b837fb4d11d768245151e4ce` | -| `ExecutionSuccess` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x324d63a433b21a12b90e79cd2ba736b2a5238be6165e03b750fa4a7d5193d5d9` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `PlugConnected` | `(plug: address, appGatewayId: bytes32, switchboard: address)` | `0x90c5924e27cfb6e3a688e729083681f30494ae2615ae14aac3bc807a0c436a88` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SocketFeeManagerUpdated` | `(oldSocketFeeManager: address, newSocketFeeManager: address)` | `0xdcb02e10d5220346a4638aa2826eaab1897306623bc40a427049e4ebd12255b4` | -| `SwitchboardAdded` | `(switchboard: address)` | `0x1595852923edfbbf906f09fc8523e4cfb022a194773c4d1509446b614146ee88` | -| `SwitchboardDisabled` | `(switchboard: address)` | `0x1b4ee41596b4e754e5665f01ed6122b356f7b36ea0a02030804fac7fa0fdddfc` | -| `SwitchboardEnabled` | `(switchboard: address)` | `0x6909a9974e3eec619bc479ba882d30a5ef1219b72ab1ce6a354516e91be317b8` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AppGatewayCallRequested` | `(triggerId: bytes32, appGatewayId: bytes32, switchboard: address, plug: address, overrides: bytes, payload: bytes)` | `0x5c88d65ab8ba22a57e582bd8ddfa9801cc0ca6be6cb3182baaedc705a612419e` | +| `ExecutionFailed` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x385334bc68a32c4d164625189adc7633e6074eb1b837fb4d11d768245151e4ce` | +| `ExecutionSuccess` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x324d63a433b21a12b90e79cd2ba736b2a5238be6165e03b750fa4a7d5193d5d9` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `PlugConnected` | `(plug: address, appGatewayId: bytes32, switchboard: address)` | `0x90c5924e27cfb6e3a688e729083681f30494ae2615ae14aac3bc807a0c436a88` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SocketFeeManagerUpdated` | `(oldSocketFeeManager: address, newSocketFeeManager: address)` | `0xdcb02e10d5220346a4638aa2826eaab1897306623bc40a427049e4ebd12255b4` | +| `SwitchboardAdded` | `(switchboard: address)` | `0x1595852923edfbbf906f09fc8523e4cfb022a194773c4d1509446b614146ee88` | +| `SwitchboardDisabled` | `(switchboard: address)` | `0x1b4ee41596b4e754e5665f01ed6122b356f7b36ea0a02030804fac7fa0fdddfc` | +| `SwitchboardEnabled` | `(switchboard: address)` | `0x6909a9974e3eec619bc479ba882d30a5ef1219b72ab1ce6a354516e91be317b8` | ## SocketBatcher -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## SocketFeeManager -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SocketFeesUpdated` | `(oldFees: uint256, newFees: uint256)` | `0xcbd4d756fb6198bbcc2e4013cce929f504ad46e9d97c543ef9a8dfea3e407053` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SocketFeesUpdated` | `(oldFees: uint256, newFees: uint256)` | `0xcbd4d756fb6198bbcc2e4013cce929f504ad46e9d97c543ef9a8dfea3e407053` | ## FeesManager -| Event | Arguments | Topic | -| ----------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `CreditsBlocked` | `(requestCount: uint40, consumeFrom: address, amount: uint256)` | `0xf037c15aef41440aa823cf1fdeaea332105d8b23d52557f6670189b5d76f1eed` | -| `CreditsTransferred` | `(from: address, to: address, amount: uint256)` | `0xed198cadddd93e734cbf04cb1c3226d9bafaeb504cedbd8ee36b830b0cb9e7a5` | -| `CreditsUnblocked` | `(requestCount: uint40, consumeFrom: address)` | `0x45db29ef2701319155cac058aa2f56ce1f73e0e238161d3db9f8c9a47655210d` | -| `CreditsUnblockedAndAssigned` | `(requestCount: uint40, consumeFrom: address, transmitter: address, amount: uint256)` | `0x38fd327622576a468e1b2818b00f50c8854703633ef8e583e1f31662888ffac2` | -| `CreditsUnwrapped` | `(consumeFrom: address, amount: uint256)` | `0xdcc9473b722b4c953617ab373840b365298a520bc7f20ce94fa7314f4a857774` | -| `CreditsWrapped` | `(consumeFrom: address, amount: uint256)` | `0x40246503613721eb4acf4020c6c56b6a16e5d08713316db0bea5210e8819c592` | -| `Deposited` | `(chainSlug: uint32, token: address, depositTo: address, creditAmount: uint256, nativeAmount: uint256)` | `0x72aedd284699bbd7a987e6942b824cfd6c627e354cb5a0760ac5768acd473f4a` | -| `FeesPlugSet` | `(chainSlug: uint32, feesPlug: address)` | `0xa8c4be32b96cca895f1f0f4684e6b377b2c4513bc35eb57a13afb6b5efb2c0ce` | -| `FeesPoolSet` | `(feesPool: address)` | `0xd07af3fd70b48ab3c077a8d45c3a288498d905d0e3d1e65bc171f6c2e890d8ef` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WithdrawFailed` | `(payloadId: bytes32)` | `0xea147eb2109f71b4bda9e57528ba08b84821087a31cb43a7851dc6ff743d9be7` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `CreditsBlocked` | `(requestCount: uint40, consumeFrom: address, amount: uint256)` | `0xf037c15aef41440aa823cf1fdeaea332105d8b23d52557f6670189b5d76f1eed` | +| `CreditsTransferred` | `(from: address, to: address, amount: uint256)` | `0xed198cadddd93e734cbf04cb1c3226d9bafaeb504cedbd8ee36b830b0cb9e7a5` | +| `CreditsUnblocked` | `(requestCount: uint40, consumeFrom: address)` | `0x45db29ef2701319155cac058aa2f56ce1f73e0e238161d3db9f8c9a47655210d` | +| `CreditsUnblockedAndAssigned` | `(requestCount: uint40, consumeFrom: address, transmitter: address, amount: uint256)` | `0x38fd327622576a468e1b2818b00f50c8854703633ef8e583e1f31662888ffac2` | +| `CreditsUnwrapped` | `(consumeFrom: address, amount: uint256)` | `0xdcc9473b722b4c953617ab373840b365298a520bc7f20ce94fa7314f4a857774` | +| `CreditsWrapped` | `(consumeFrom: address, amount: uint256)` | `0x40246503613721eb4acf4020c6c56b6a16e5d08713316db0bea5210e8819c592` | +| `Deposited` | `(chainSlug: uint32, token: address, depositTo: address, creditAmount: uint256, nativeAmount: uint256)` | `0x72aedd284699bbd7a987e6942b824cfd6c627e354cb5a0760ac5768acd473f4a` | +| `FeesPlugSet` | `(chainSlug: uint32, feesPlug: address)` | `0xa8c4be32b96cca895f1f0f4684e6b377b2c4513bc35eb57a13afb6b5efb2c0ce` | +| `FeesPoolSet` | `(feesPool: address)` | `0xd07af3fd70b48ab3c077a8d45c3a288498d905d0e3d1e65bc171f6c2e890d8ef` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WithdrawFailed` | `(payloadId: bytes32)` | `0xea147eb2109f71b4bda9e57528ba08b84821087a31cb43a7851dc6ff743d9be7` | ## FeesPool -| Event | Arguments | Topic | -| ---------------------------- | ----------------------------------------------- | -------------------------------------------------------------------- | -| `NativeDeposited` | `(from: address, amount: uint256)` | `0xb5d7700fb0cf415158b8db7cc7c39f0eab16a825c92e221404b4c8bb099b4bbb` | -| `NativeWithdrawn` | `(success: bool, to: address, amount: uint256)` | `0xa81f1c8490022ee829d2e1a231053f5dbecad46caee71f6ea38a9db663a3f12b` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `NativeDeposited` | `(from: address, amount: uint256)` | `0xb5d7700fb0cf415158b8db7cc7c39f0eab16a825c92e221404b4c8bb099b4bbb` | +| `NativeWithdrawn` | `(success: bool, to: address, amount: uint256)` | `0xa81f1c8490022ee829d2e1a231053f5dbecad46caee71f6ea38a9db663a3f12b` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## AddressResolver -| Event | Arguments | Topic | -| ------------------------------ | --------------------------------------------------- | -------------------------------------------------------------------- | -| `AsyncDeployerUpdated` | `(asyncDeployer_: address)` | `0x4df9cdd01544e8f6b0326650bc0b55611f47ce5ba2faa522d21fb675e9fc1f73` | -| `ContractAddressUpdated` | `(contractId_: bytes32, contractAddress_: address)` | `0xdf5ec2c15e11ce657bb21bc09c0b5ba95e315b4dba9934c6e311f47559babf28` | -| `DefaultAuctionManagerUpdated` | `(defaultAuctionManager_: address)` | `0x60f296739208a505ead7fb622df0f76b7791b824481b120a2300bdaf85e3e3d6` | -| `DeployForwarderUpdated` | `(deployForwarder_: address)` | `0x237b9bc9fef7508a02ca9ccca81f6965e500064a58024cae1218035da865fd2b` | -| `FeesManagerUpdated` | `(feesManager_: address)` | `0x94e67aa1341a65767dfde81e62fd265bfbade1f5744bfd3cd73f99a6eca0572a` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WatcherUpdated` | `(watcher_: address)` | `0xc13081d38d92b454cdb6ca20bbc65c12fa43a7a14a1529204ced5b6350052bb0` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AsyncDeployerUpdated` | `(asyncDeployer_: address)` | `0x4df9cdd01544e8f6b0326650bc0b55611f47ce5ba2faa522d21fb675e9fc1f73` | +| `ContractAddressUpdated` | `(contractId_: bytes32, contractAddress_: address)` | `0xdf5ec2c15e11ce657bb21bc09c0b5ba95e315b4dba9934c6e311f47559babf28` | +| `DefaultAuctionManagerUpdated` | `(defaultAuctionManager_: address)` | `0x60f296739208a505ead7fb622df0f76b7791b824481b120a2300bdaf85e3e3d6` | +| `DeployForwarderUpdated` | `(deployForwarder_: address)` | `0x237b9bc9fef7508a02ca9ccca81f6965e500064a58024cae1218035da865fd2b` | +| `FeesManagerUpdated` | `(feesManager_: address)` | `0x94e67aa1341a65767dfde81e62fd265bfbade1f5744bfd3cd73f99a6eca0572a` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WatcherUpdated` | `(watcher_: address)` | `0xc13081d38d92b454cdb6ca20bbc65c12fa43a7a14a1529204ced5b6350052bb0` | ## AsyncDeployer -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------------------- | -------------------------------------------------------------------- | -| `AsyncPromiseDeployed` | `(newAsyncPromise: address, salt: bytes32)` | `0xb6c5491cf83e09749b1a4dd6a9f07b0e925fcb0a915ac8c2b40e8ab28191c270` | -| `ForwarderDeployed` | `(newForwarder: address, salt: bytes32)` | `0x4dbbecb9cf9c8b93da9743a2b48ea52efe68d69230ab1c1b711891d9d223b29f` | -| `ImplementationUpdated` | `(contractName: string, newImplementation: address)` | `0xa1e41aa2c2f3f20d9b63ac06b634d2788768d6034f3d9192cdf7d07374bb16f4` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AsyncPromiseDeployed` | `(newAsyncPromise: address, salt: bytes32)` | `0xb6c5491cf83e09749b1a4dd6a9f07b0e925fcb0a915ac8c2b40e8ab28191c270` | +| `ForwarderDeployed` | `(newForwarder: address, salt: bytes32)` | `0x4dbbecb9cf9c8b93da9743a2b48ea52efe68d69230ab1c1b711891d9d223b29f` | +| `ImplementationUpdated` | `(contractName: string, newImplementation: address)` | `0xa1e41aa2c2f3f20d9b63ac06b634d2788768d6034f3d9192cdf7d07374bb16f4` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## AsyncPromise -| Event | Arguments | Topic | -| ------------- | ------------------- | -------------------------------------------------------------------- | +| Event | Arguments | Topic | +| ----- | --------- | ----- | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | ## DeployForwarder -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## Forwarder -| Event | Arguments | Topic | -| ------------- | ------------------- | -------------------------------------------------------------------- | +| Event | Arguments | Topic | +| ----- | --------- | ----- | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | ## ProxyFactory -| Event | Arguments | Topic | -| -------------- | ----------------------------------------------------------- | -------------------------------------------------------------------- | -| `AdminChanged` | `(proxy: address, admin: address)` | `0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f` | -| `Deployed` | `(proxy: address, implementation: address, admin: address)` | `0xc95935a66d15e0da5e412aca0ad27ae891d20b2fb91cf3994b6a3bf2b8178082` | -| `Upgraded` | `(proxy: address, implementation: address)` | `0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AdminChanged` | `(proxy: address, admin: address)` | `0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f` | +| `Deployed` | `(proxy: address, implementation: address, admin: address)` | `0xc95935a66d15e0da5e412aca0ad27ae891d20b2fb91cf3994b6a3bf2b8178082` | +| `Upgraded` | `(proxy: address, implementation: address)` | `0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7` | ## TestUSDC -| Event | Arguments | Topic | -| ---------- | ----------------------------------------------------- | -------------------------------------------------------------------- | +| Event | Arguments | Topic | +| ----- | --------- | ----- | | `Approval` | `(owner: address, spender: address, amount: uint256)` | `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` | -| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | +| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | ## ContractFactoryPlug -| Event | Arguments | Topic | -| ---------------------------- | --------------------------------------------------- | -------------------------------------------------------------------- | -| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | -| `Deployed` | `(addr: address, salt: bytes32, returnData: bytes)` | `0x1246c6f8fd9f4abc542c7c8c8f793cfcde6b67aed1976a38aa134fc24af2dfe3` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `Deployed` | `(addr: address, salt: bytes32, returnData: bytes)` | `0x1246c6f8fd9f4abc542c7c8c8f793cfcde6b67aed1976a38aa134fc24af2dfe3` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## FeesPlug -| Event | Arguments | Topic | -| ---------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | -| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256)` | `0xeb4e1b24b7fe377de69f80f7380bda5ba4b43176c6a4d300a3be9009c49f4228` | -| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | -| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256)` | `0xeb4e1b24b7fe377de69f80f7380bda5ba4b43176c6a4d300a3be9009c49f4228` | +| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | +| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | ## Configurations -| Event | Arguments | Topic | -| ---------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------- | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `IsValidPlugSet` | `(appGateway: address, chainSlug: uint32, plug: address, isValid: bool)` | `0x61cccc7387868fc741379c7acd9dd346e0ca2e5c067dc5b156fbbc55b1c2fcf5` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `PlugAdded` | `(appGatewayId: bytes32, chainSlug: uint32, plug: address)` | `0x7b3e14230a721c4737d275f9a63b92c44cb657bcfddbe6fe9b4d9cd9bd8d4a95` | -| `SocketSet` | `(chainSlug: uint32, socket: address)` | `0x5b13a5470e66a2ec5e9b32af5f9e23fe304864892918c60fffd22509ca73ac97` | -| `SwitchboardSet` | `(chainSlug: uint32, sbType: bytes32, switchboard: address)` | `0x6273f161f4a795e66ef3585d9b4442ef3796b32337157fdfb420b5281e4cf2e3` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `IsValidPlugSet` | `(appGateway: address, chainSlug: uint32, plug: address, isValid: bool)` | `0x61cccc7387868fc741379c7acd9dd346e0ca2e5c067dc5b156fbbc55b1c2fcf5` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `PlugAdded` | `(appGatewayId: bytes32, chainSlug: uint32, plug: address)` | `0x7b3e14230a721c4737d275f9a63b92c44cb657bcfddbe6fe9b4d9cd9bd8d4a95` | +| `SocketSet` | `(chainSlug: uint32, socket: address)` | `0x5b13a5470e66a2ec5e9b32af5f9e23fe304864892918c60fffd22509ca73ac97` | +| `SwitchboardSet` | `(chainSlug: uint32, sbType: bytes32, switchboard: address)` | `0x6273f161f4a795e66ef3585d9b4442ef3796b32337157fdfb420b5281e4cf2e3` | ## PromiseResolver -| Event | Arguments | Topic | -| -------------------- | ------------------------------------------------ | -------------------------------------------------------------------- | -| `MarkedRevert` | `(payloadId: bytes32, isRevertingOnchain: bool)` | `0xcf1fd844cb4d32cbebb5ca6ce4ac834fe98da3ddac44deb77fffd22ad933824c` | -| `PromiseNotResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0xbcf0d0c678940566e9e64f0c871439395bd5fb5c39bca3547b126fe6ee467937` | -| `PromiseResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0x1b1b5810494fb3e17f7c46547e6e67cd6ad3e6001ea6fb7d12ea0241ba13c4ba` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `MarkedRevert` | `(payloadId: bytes32, isRevertingOnchain: bool)` | `0xcf1fd844cb4d32cbebb5ca6ce4ac834fe98da3ddac44deb77fffd22ad933824c` | +| `PromiseNotResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0xbcf0d0c678940566e9e64f0c871439395bd5fb5c39bca3547b126fe6ee467937` | +| `PromiseResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0x1b1b5810494fb3e17f7c46547e6e67cd6ad3e6001ea6fb7d12ea0241ba13c4ba` | ## RequestHandler -| Event | Arguments | Topic | -| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `FeesIncreased` | `(requestCount: uint40, newMaxFees: uint256)` | `0xf258fca4e49b803ee2a4c2e33b6fcf18bc3982df21f111c00677025bf1ccbb6a` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RequestCancelled` | `(requestCount: uint40)` | `0xff191657769be72fc08def44c645014c60d18cb24b9ca05c9a33406a28253245` | -| `RequestCompletedWithErrors` | `(requestCount: uint40)` | `0xd8d9915dc14b5a29b66cb263e1ea1e99e60418fc21d97f0fbf09cae1281291e2` | -| `RequestSettled` | `(requestCount: uint40, winner: address)` | `0x1234f98acbe1548b214f4528461a5377f1e2349569c04caa59325e488e7d2aa4` | -| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0x762bac43d5d7689b8911c5654a9d5550804373cead33bc98282067e6166e518f` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `FeesIncreased` | `(requestCount: uint40, newMaxFees: uint256)` | `0xf258fca4e49b803ee2a4c2e33b6fcf18bc3982df21f111c00677025bf1ccbb6a` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RequestCancelled` | `(requestCount: uint40)` | `0xff191657769be72fc08def44c645014c60d18cb24b9ca05c9a33406a28253245` | +| `RequestCompletedWithErrors` | `(requestCount: uint40)` | `0xd8d9915dc14b5a29b66cb263e1ea1e99e60418fc21d97f0fbf09cae1281291e2` | +| `RequestSettled` | `(requestCount: uint40, winner: address)` | `0x1234f98acbe1548b214f4528461a5377f1e2349569c04caa59325e488e7d2aa4` | +| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0x762bac43d5d7689b8911c5654a9d5550804373cead33bc98282067e6166e518f` | ## Watcher -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | -| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | -| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | +| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | +| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | +| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | ## FastSwitchboard -| Event | Arguments | Topic | -| ---------------------------- | ----------------------------------------- | -------------------------------------------------------------------- | -| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## ReadPrecompile -| Event | Arguments | Topic | -| --------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `ReadFeesSet` | `(readFees: uint256)` | `0xc674cb6dde3a59f84dbf226832e606ffc54ac8a169e1568fc834c7813010f926` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `ReadFeesSet` | `(readFees: uint256)` | `0xc674cb6dde3a59f84dbf226832e606ffc54ac8a169e1568fc834c7813010f926` | | `ReadRequested` | `(transaction: tuple, readAtBlockNumber: uint256, payloadId: bytes32)` | `0x42d9c65d4f6e45462ae6206adb3e388e046b7daa1dc8699d9380cac72ff5db0b` | ## SchedulePrecompile -| Event | Arguments | Topic | -| ------------------------------ | ---------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | -| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | -| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | -| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256)` | `0xd099d3e3d0f0e2c9c40e0066affeea125aab71d763b7ab0a279ccec3dff70b64` | -| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | +| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | +| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | +| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256)` | `0xd099d3e3d0f0e2c9c40e0066affeea125aab71d763b7ab0a279ccec3dff70b64` | +| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | ## WritePrecompile -| Event | Arguments | Topic | -| ------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ChainMaxMsgValueLimitsUpdated` | `(chainSlug: uint32, maxMsgValueLimit: uint256)` | `0x439087d094fe7dacbba3f0c67032041952d8bd58a891e15af10ced28fed0eb91` | -| `ContractFactoryPlugSet` | `(chainSlug: uint32, contractFactoryPlug: address)` | `0x85bfa413b9e5e225278f51af2ac872988e0a9374263b118d963c50945ea888bb` | -| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `FeesSet` | `(writeFees: uint256)` | `0x3346af6da1932164d501f2ec28f8c5d686db5828a36b77f2da4332d89184fe7b` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WriteProofRequested` | `(transmitter: address, digest: bytes32, prevBatchDigestHash: bytes32, deadline: uint256, payloadParams: tuple)` | `0x3247df5b4e8df4ac60c2c1f803b404ee16bc9d84a6b7649865464a8a397b9acb` | -| `WriteProofUploaded` | `(payloadId: bytes32, proof: bytes)` | `0xd8fe3a99a88c9630360418877afdf14e3e79f0f25fee162aeb230633ea740156` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ChainMaxMsgValueLimitsUpdated` | `(chainSlug: uint32, maxMsgValueLimit: uint256)` | `0x439087d094fe7dacbba3f0c67032041952d8bd58a891e15af10ced28fed0eb91` | +| `ContractFactoryPlugSet` | `(chainSlug: uint32, contractFactoryPlug: address)` | `0x85bfa413b9e5e225278f51af2ac872988e0a9374263b118d963c50945ea888bb` | +| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `FeesSet` | `(writeFees: uint256)` | `0x3346af6da1932164d501f2ec28f8c5d686db5828a36b77f2da4332d89184fe7b` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WriteProofRequested` | `(transmitter: address, digest: bytes32, prevBatchDigestHash: bytes32, deadline: uint256, payloadParams: tuple)` | `0x3247df5b4e8df4ac60c2c1f803b404ee16bc9d84a6b7649865464a8a397b9acb` | +| `WriteProofUploaded` | `(payloadId: bytes32, proof: bytes)` | `0xd8fe3a99a88c9630360418877afdf14e3e79f0f25fee162aeb230633ea740156` | + diff --git a/FunctionSignatures.md b/FunctionSignatures.md index c5445dae..c62d285b 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -2,560 +2,560 @@ ## AuctionManager -| Function | Signature | -| ---------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `auctionEndDelaySeconds` | `0x9087dfdb` | -| `auctionManager` | `0xb0192f9a` | -| `auctionStatus` | `0xd7d5fbf6` | -| `bid` | `0xfcdf49c2` | -| `bidTimeout` | `0x94090d0b` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `consumeFrom` | `0x40dd78be` | -| `creationCodeWithArgs` | `0xc126dcc4` | -| `deployForwarder__` | `0xd4e3b034` | -| `endAuction` | `0x1212e653` | -| `evmxSlug` | `0x8bae77c2` | -| `expireBid` | `0x1dd5022c` | -| `feesManager__` | `0x70568b58` | -| `forwarderAddresses` | `0x5390fdcb` | -| `getOnChainAddress` | `0xb6abffd7` | -| `getOverrideParams` | `0x54f0a866` | -| `grantRole` | `0x2f2ff15d` | -| `handleRevert` | `0x44792f25` | -| `hasRole` | `0x91d14854` | -| `initialize` | `0x86891c9b` | -| `initializeOnChain` | `0x86f01739` | -| `isAsyncModifierSet` | `0xb69e0c4a` | -| `isValidPromise` | `0xb690b962` | -| `maxFees` | `0xe83e34b1` | -| `maxReAuctionCount` | `0xc367b376` | -| `onCompleteData` | `0xb52fa926` | -| `onRequestComplete` | `0x5ed1f959` | -| `overrideParams` | `0xec5490fe` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `auctionEndDelaySeconds` | `0x9087dfdb` | +| `auctionManager` | `0xb0192f9a` | +| `auctionStatus` | `0xd7d5fbf6` | +| `bid` | `0xfcdf49c2` | +| `bidTimeout` | `0x94090d0b` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `consumeFrom` | `0x40dd78be` | +| `creationCodeWithArgs` | `0xc126dcc4` | +| `deployForwarder__` | `0xd4e3b034` | +| `endAuction` | `0x1212e653` | +| `evmxSlug` | `0x8bae77c2` | +| `expireBid` | `0x1dd5022c` | +| `feesManager__` | `0x70568b58` | +| `forwarderAddresses` | `0x5390fdcb` | +| `getOnChainAddress` | `0xb6abffd7` | +| `getOverrideParams` | `0x54f0a866` | +| `grantRole` | `0x2f2ff15d` | +| `handleRevert` | `0x44792f25` | +| `hasRole` | `0x91d14854` | +| `initialize` | `0x86891c9b` | +| `initializeOnChain` | `0x86f01739` | +| `isAsyncModifierSet` | `0xb69e0c4a` | +| `isValidPromise` | `0xb690b962` | +| `maxFees` | `0xe83e34b1` | +| `maxReAuctionCount` | `0xc367b376` | +| `onCompleteData` | `0xb52fa926` | +| `onDeployComplete` | `0xfa3dbd1e` | +| `overrideParams` | `0xec5490fe` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `reAuctionCount` | `0x9b4b22d3` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `sbType` | `0x745de344` | -| `setAddress` | `0x85bf312c` | -| `setAuctionEndDelaySeconds` | `0x88606b1a` | -| `setMaxReAuctionCount` | `0x64c71403` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | -| `winningBids` | `0x9133f232` | +| `reAuctionCount` | `0x9b4b22d3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `sbType` | `0x745de344` | +| `setAddress` | `0x85bf312c` | +| `setAuctionEndDelaySeconds` | `0x88606b1a` | +| `setMaxReAuctionCount` | `0x64c71403` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | +| `winningBids` | `0x9133f232` | ## Socket -| Function | Signature | -| ---------------------------- | ------------ | -| `OFF_CHAIN_CALLER` | `0xcb2cb4f6` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `connect` | `0xb3bde1aa` | -| `disableSwitchboard` | `0xe545b261` | -| `enableSwitchboard` | `0xf97a498a` | -| `execute` | `0xafa8b480` | -| `getPlugConfig` | `0xf9778ee0` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isValidSwitchboard` | `0xb2d67675` | -| `maxCopyBytes` | `0x212249d4` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `OFF_CHAIN_CALLER` | `0xcb2cb4f6` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `connect` | `0xb3bde1aa` | +| `disableSwitchboard` | `0xc4d9a820` | +| `enableSwitchboard` | `0xf97a498a` | +| `execute` | `0xafa8b480` | +| `getPlugConfig` | `0xf9778ee0` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isValidSwitchboard` | `0xb2d67675` | +| `maxCopyBytes` | `0x212249d4` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadExecuted` | `0x3eaeac3d` | -| `payloadIdToDigest` | `0x7c8552b2` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setMaxCopyBytes` | `0x4fc7d6e9` | -| `setSocketFeeManager` | `0x25bd97e5` | -| `simulate` | `0x91bf8275` | -| `socketFeeManager` | `0xde5b8838` | -| `transferOwnership` | `0xf2fde38b` | -| `triggerCounter` | `0x8b0021de` | -| `version` | `0x54fd4d50` | +| `payloadExecuted` | `0x3eaeac3d` | +| `payloadIdToDigest` | `0x7c8552b2` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setMaxCopyBytes` | `0x4fc7d6e9` | +| `setSocketFeeManager` | `0x25bd97e5` | +| `simulate` | `0x91bf8275` | +| `socketFeeManager` | `0xde5b8838` | +| `transferOwnership` | `0xf2fde38b` | +| `triggerCounter` | `0x8b0021de` | +| `version` | `0x54fd4d50` | ## SocketBatcher -| Function | Signature | -| ---------------------------- | ------------ | -| `attestAndExecute` | `0x66c7748a` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `attestAndExecute` | `0x66c7748a` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## SocketFeeManager -| Function | Signature | -| ---------------------------- | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getMinSocketFees` | `0xd383b688` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getMinSocketFees` | `0xd383b688` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payAndCheckFees` | `0xd9d29ae3` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setSocketFees` | `0x47a406f6` | -| `socketFees` | `0xab1b33a8` | -| `transferOwnership` | `0xf2fde38b` | +| `payAndCheckFees` | `0xd9d29ae3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setSocketFees` | `0x47a406f6` | +| `socketFees` | `0xab1b33a8` | +| `transferOwnership` | `0xf2fde38b` | ## FeesManager -| Function | Signature | -| -------------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `approveAppGateway` | `0xa3b53d8b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `approveAppGateway` | `0xa3b53d8b` | | `approveAppGatewayWithSignature` | `0x94b649ec` | -| `approveAppGateways` | `0x86d23ab2` | -| `asyncDeployer__` | `0x2a39e801` | -| `blockCredits` | `0x9e434307` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployForwarder__` | `0xd4e3b034` | -| `deposit` | `0x5671d329` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `feesPlugs` | `0x23f5ee8a` | -| `feesPool` | `0x6b259690` | -| `getAvailableCredits` | `0xb065a8e5` | -| `handleRevert` | `0x44792f25` | -| `initialize` | `0xbf2c8539` | -| `isApproved` | `0xa389783e` | -| `isCreditSpendable` | `0x4f8990fd` | -| `isNonceUsed` | `0xcab7e8eb` | -| `onRequestComplete` | `0x5ed1f959` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestBlockedCredits` | `0xb62d25ac` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `sbType` | `0x745de344` | -| `setFeesPlug` | `0xeab75f36` | -| `setFeesPool` | `0xd6684588` | -| `tokenOnChainBalances` | `0x3b27866d` | -| `transferCredits` | `0xf1686c89` | -| `transferOwnership` | `0xf2fde38b` | -| `unblockAndAssignCredits` | `0x01958181` | -| `unblockCredits` | `0xa0b32314` | -| `unwrap` | `0x7647691d` | -| `userCredits` | `0x20babb92` | -| `watcher__` | `0x300bb063` | -| `withdrawCredits` | `0xcfc6dbd9` | -| `wrap` | `0x023276f0` | +| `approveAppGateways` | `0x86d23ab2` | +| `asyncDeployer__` | `0x2a39e801` | +| `blockCredits` | `0x9e434307` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployForwarder__` | `0xd4e3b034` | +| `deposit` | `0x5671d329` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `feesPlugs` | `0x23f5ee8a` | +| `feesPool` | `0x6b259690` | +| `getAvailableCredits` | `0xb065a8e5` | +| `handleRevert` | `0x44792f25` | +| `initialize` | `0xbf2c8539` | +| `isApproved` | `0xa389783e` | +| `isCreditSpendable` | `0x4f8990fd` | +| `isNonceUsed` | `0xcab7e8eb` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestBlockedCredits` | `0xb62d25ac` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `sbType` | `0x745de344` | +| `setFeesPlug` | `0xeab75f36` | +| `setFeesPool` | `0xd6684588` | +| `tokenOnChainBalances` | `0x3b27866d` | +| `transferCredits` | `0xf1686c89` | +| `transferOwnership` | `0xf2fde38b` | +| `unblockAndAssignCredits` | `0x01958181` | +| `unblockCredits` | `0xa0b32314` | +| `unwrap` | `0x7647691d` | +| `userCredits` | `0x20babb92` | +| `watcher__` | `0x300bb063` | +| `withdrawCredits` | `0xcfc6dbd9` | +| `wrap` | `0x023276f0` | ## FeesPool -| Function | Signature | -| ---------------------------- | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getBalance` | `0x12065fe0` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getBalance` | `0x12065fe0` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `revokeRole` | `0xd547741f` | -| `transferOwnership` | `0xf2fde38b` | -| `withdraw` | `0xf3fef3a3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `revokeRole` | `0xd547741f` | +| `transferOwnership` | `0xf2fde38b` | +| `withdraw` | `0xf3fef3a3` | ## AddressResolver -| Function | Signature | -| ---------------------------- | ------------ | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `contractAddresses` | `0xf689e892` | -| `defaultAuctionManager` | `0x8f27cdc6` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0xc4d66de8` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `contractAddresses` | `0xf689e892` | +| `defaultAuctionManager` | `0x8f27cdc6` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0xc4d66de8` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setAsyncDeployer` | `0xcb0ffff8` | -| `setContractAddress` | `0xe001f841` | -| `setDefaultAuctionManager` | `0xede8b4b5` | -| `setDeployForwarder` | `0xaeaee8a6` | -| `setFeesManager` | `0x1c89382a` | -| `setWatcher` | `0x24f48bc5` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setAsyncDeployer` | `0xcb0ffff8` | +| `setContractAddress` | `0xe001f841` | +| `setDefaultAuctionManager` | `0xede8b4b5` | +| `setDeployForwarder` | `0xaeaee8a6` | +| `setFeesManager` | `0x1c89382a` | +| `setWatcher` | `0x24f48bc5` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncDeployer -| Function | Signature | -| ------------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `asyncPromiseBeacon` | `0xc0fbc0ef` | -| `asyncPromiseCounter` | `0x97cdbf4c` | -| `asyncPromiseImplementation` | `0x59531b8d` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployAsyncPromiseContract` | `0x9851be0b` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `forwarderBeacon` | `0x945709ae` | -| `forwarderImplementation` | `0xe38d60a1` | -| `getAsyncPromiseAddress` | `0x104f39b4` | -| `getForwarderAddress` | `0x48c0b3e0` | -| `getOrDeployForwarderContract` | `0x0aa178de` | -| `initialize` | `0x485cc955` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `asyncPromiseBeacon` | `0xc0fbc0ef` | +| `asyncPromiseCounter` | `0x97cdbf4c` | +| `asyncPromiseImplementation` | `0x59531b8d` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployAsyncPromiseContract` | `0x9851be0b` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `forwarderBeacon` | `0x945709ae` | +| `forwarderImplementation` | `0xe38d60a1` | +| `getAsyncPromiseAddress` | `0x104f39b4` | +| `getForwarderAddress` | `0x48c0b3e0` | +| `getOrDeployForwarderContract` | `0x0aa178de` | +| `initialize` | `0x485cc955` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | | `setAsyncPromiseImplementation` | `0xeb506eab` | -| `setForwarderImplementation` | `0x83b1e974` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `setForwarderImplementation` | `0x83b1e974` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncPromise -| Function | Signature | -| ------------------- | ------------ | +| Function | Signature | +| -------- | --------- | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `callbackData` | `0xef44c272` | -| `callbackSelector` | `0x2764f92f` | +| `asyncDeployer__` | `0x2a39e801` | +| `callbackData` | `0xef44c272` | +| `callbackSelector` | `0x2764f92f` | | `deployForwarder__` | `0xd4e3b034` | -| `exceededMaxCopy` | `0xaf598c7c` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x0ece6089` | -| `localInvoker` | `0x45eb87f4` | +| `exceededMaxCopy` | `0xaf598c7c` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x0ece6089` | +| `localInvoker` | `0x45eb87f4` | | `markOnchainRevert` | `0xd0e7af1b` | -| `markResolved` | `0x822d5d1f` | -| `requestCount` | `0x5badbe4c` | -| `rescueFunds` | `0x6ccae054` | -| `returnData` | `0xebddbaf6` | -| `state` | `0xc19d93fb` | -| `then` | `0x0bf2ba15` | -| `watcher__` | `0x300bb063` | +| `markResolved` | `0x822d5d1f` | +| `requestCount` | `0x5badbe4c` | +| `rescueFunds` | `0x6ccae054` | +| `returnData` | `0xebddbaf6` | +| `state` | `0xc19d93fb` | +| `then` | `0x0bf2ba15` | +| `watcher__` | `0x300bb063` | ## DeployForwarder -| Function | Signature | -| ---------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deploy` | `0x940f11af` | -| `deployForwarder__` | `0xd4e3b034` | -| `deployerSwitchboardType` | `0xaa381f9a` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x6133f985` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deploy` | `0x940f11af` | +| `deployForwarder__` | `0xd4e3b034` | +| `deployerSwitchboardType` | `0xaa381f9a` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x6133f985` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `saltCounter` | `0xa04c6809` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `saltCounter` | `0xa04c6809` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## Forwarder -| Function | Signature | -| ------------------- | ------------ | +| Function | Signature | +| -------- | --------- | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `chainSlug` | `0xb349ba65` | +| `asyncDeployer__` | `0x2a39e801` | +| `chainSlug` | `0xb349ba65` | | `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getChainSlug` | `0x0b8c6568` | +| `feesManager__` | `0x70568b58` | +| `getChainSlug` | `0x0b8c6568` | | `getOnChainAddress` | `0x9da48789` | -| `initialize` | `0x647c576c` | -| `onChainAddress` | `0x8bd0b363` | -| `rescueFunds` | `0x6ccae054` | -| `watcher__` | `0x300bb063` | +| `initialize` | `0x647c576c` | +| `onChainAddress` | `0x8bd0b363` | +| `rescueFunds` | `0x6ccae054` | +| `watcher__` | `0x300bb063` | ## ProxyFactory -| Function | Signature | -| ----------------------------- | ------------ | -| `adminOf` | `0x2abbef15` | -| `changeAdmin` | `0x1acfd02a` | -| `deploy` | `0x545e7c61` | -| `deployAndCall` | `0x4314f120` | -| `deployDeterministic` | `0x3729f922` | -| `deployDeterministicAndCall` | `0xa97b90d5` | -| `initCodeHash` | `0xdb4c545e` | +| Function | Signature | +| -------- | --------- | +| `adminOf` | `0x2abbef15` | +| `changeAdmin` | `0x1acfd02a` | +| `deploy` | `0x545e7c61` | +| `deployAndCall` | `0x4314f120` | +| `deployDeterministic` | `0x3729f922` | +| `deployDeterministicAndCall` | `0xa97b90d5` | +| `initCodeHash` | `0xdb4c545e` | | `predictDeterministicAddress` | `0x5414dff0` | -| `upgrade` | `0x99a88ec4` | -| `upgradeAndCall` | `0x9623609d` | +| `upgrade` | `0x99a88ec4` | +| `upgradeAndCall` | `0x9623609d` | ## TestUSDC -| Function | Signature | -| ------------------ | ------------ | +| Function | Signature | +| -------- | --------- | | `DOMAIN_SEPARATOR` | `0x3644e515` | -| `allowance` | `0xdd62ed3e` | -| `approve` | `0x095ea7b3` | -| `balanceOf` | `0x70a08231` | -| `decimals` | `0x313ce567` | -| `mint` | `0x40c10f19` | -| `name` | `0x06fdde03` | -| `nonces` | `0x7ecebe00` | -| `owner` | `0x8da5cb5b` | -| `permit` | `0xd505accf` | -| `symbol` | `0x95d89b41` | -| `totalSupply` | `0x18160ddd` | -| `transfer` | `0xa9059cbb` | -| `transferFrom` | `0x23b872dd` | +| `allowance` | `0xdd62ed3e` | +| `approve` | `0x095ea7b3` | +| `balanceOf` | `0x70a08231` | +| `decimals` | `0x313ce567` | +| `mint` | `0x40c10f19` | +| `name` | `0x06fdde03` | +| `nonces` | `0x7ecebe00` | +| `owner` | `0x8da5cb5b` | +| `permit` | `0xd505accf` | +| `symbol` | `0x95d89b41` | +| `totalSupply` | `0x18160ddd` | +| `transfer` | `0xa9059cbb` | +| `transferFrom` | `0x23b872dd` | ## ContractFactoryPlug -| Function | Signature | -| ---------------------------- | ------------ | -| `appGatewayId` | `0x1c335f49` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `connectSocket` | `0x258d19c8` | -| `deployContract` | `0xa0695389` | -| `getAddress` | `0x94ca2cb5` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `initSocket` | `0xa07d8545` | -| `isSocketInitialized` | `0x9a7d9a9b` | -| `overrides` | `0x4a85f041` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `appGatewayId` | `0x1c335f49` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `connectSocket` | `0x258d19c8` | +| `deployContract` | `0xa0695389` | +| `getAddress` | `0x94ca2cb5` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `initSocket` | `0xa07d8545` | +| `isSocketInitialized` | `0x9a7d9a9b` | +| `overrides` | `0x4a85f041` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## Configurations -| Function | Signature | -| ---------------------------- | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getPlugConfigs` | `0x8a028c38` | -| `initialize` | `0x485cc955` | -| `isValidPlug` | `0xec8aef74` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getPlugConfigs` | `0x8a028c38` | +| `initialize` | `0x485cc955` | +| `isValidPlug` | `0xec8aef74` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setAppGatewayConfigs` | `0xd137fcbb` | -| `setIsValidPlug` | `0xf41332b0` | -| `setSocket` | `0x075c40be` | -| `setSwitchboard` | `0x61706f1e` | -| `sockets` | `0xb44a23ab` | -| `switchboards` | `0xaa539546` | -| `transferOwnership` | `0xf2fde38b` | -| `verifyConnections` | `0xa53b6fad` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setAppGatewayConfigs` | `0xd137fcbb` | +| `setIsValidPlug` | `0xf41332b0` | +| `setSocket` | `0x075c40be` | +| `setSwitchboard` | `0x61706f1e` | +| `sockets` | `0xb44a23ab` | +| `switchboards` | `0xaa539546` | +| `transferOwnership` | `0xf2fde38b` | +| `verifyConnections` | `0xa53b6fad` | +| `watcher__` | `0x300bb063` | ## PromiseResolver -| Function | Signature | -| ----------------- | ------------ | -| `markRevert` | `0x56501015` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| -------- | --------- | +| `markRevert` | `0x56501015` | +| `rescueFunds` | `0x6ccae054` | | `resolvePromises` | `0xbf8484b8` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## RequestHandler -| Function | Signature | -| ------------------------------ | ------------ | -| `addressResolver__` | `0x6a750469` | -| `assignTransmitter` | `0xae5e9c48` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x3b5fd6fb` | -| `cancelRequestForReverts` | `0x82970278` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getBatchPayloadIds` | `0xfd83cd1f` | -| `getPayload` | `0xb48fd0fe` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequest` | `0xcf39abf6` | -| `getRequestBatchIds` | `0xe138fadb` | -| `handleRevert` | `0xcc88d3f9` | -| `increaseFees` | `0x10205541` | -| `initialize` | `0x485cc955` | -| `nextBatchCount` | `0x333a3963` | -| `nextRequestCount` | `0xfef72893` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadCounter` | `0x550ce1d5` | -| `precompiles` | `0x9932450b` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setPrecompile` | `0x122e0042` | -| `setRequestPayloadCountLimit` | `0x8526582b` | -| `submitRequest` | `0xbb299a2c` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `assignTransmitter` | `0xae5e9c48` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x3b5fd6fb` | +| `cancelRequestForReverts` | `0x82970278` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `getBatchPayloadIds` | `0xfd83cd1f` | +| `getPayload` | `0xb48fd0fe` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequest` | `0xcf39abf6` | +| `getRequestBatchIds` | `0xe138fadb` | +| `handleRevert` | `0xcc88d3f9` | +| `increaseFees` | `0x10205541` | +| `initialize` | `0x485cc955` | +| `nextBatchCount` | `0x333a3963` | +| `nextRequestCount` | `0xfef72893` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `payloadCounter` | `0x550ce1d5` | +| `precompiles` | `0x9932450b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setPrecompile` | `0x122e0042` | +| `setRequestPayloadCountLimit` | `0x8526582b` | +| `submitRequest` | `0xbb299a2c` | +| `transferOwnership` | `0xf2fde38b` | | `updateRequestAndProcessBatch` | `0x46464471` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## Watcher -| Function | Signature | -| ---------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `appGatewayTemp` | `0x1394c029` | -| `asyncDeployer__` | `0x2a39e801` | -| `callAppGateways` | `0x0050bef1` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x50ad0779` | -| `clearQueue` | `0xf22cb874` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `configurations__` | `0x52a3bbeb` | -| `deployForwarder__` | `0xd4e3b034` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `getCurrentRequestCount` | `0x5715abbb` | -| `getPayloadParams` | `0xae5eeb77` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequestParams` | `0x71263d0d` | -| `increaseFees` | `0xe9b304da` | -| `initialize` | `0xaaf7fc1a` | -| `isAppGatewayCalled` | `0xa79da6c7` | -| `isNonceUsed` | `0x5d00bb12` | -| `isWatcher` | `0x84785ecd` | -| `latestAsyncPromise` | `0xb8a8ba52` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `appGatewayTemp` | `0x1394c029` | +| `asyncDeployer__` | `0x2a39e801` | +| `callAppGateways` | `0x0050bef1` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x50ad0779` | +| `clearQueue` | `0xf22cb874` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `configurations__` | `0x52a3bbeb` | +| `deployForwarder__` | `0xd4e3b034` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `getCurrentRequestCount` | `0x5715abbb` | +| `getPayloadParams` | `0xae5eeb77` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequestParams` | `0x71263d0d` | +| `increaseFees` | `0xe9b304da` | +| `initialize` | `0xaaf7fc1a` | +| `isAppGatewayCalled` | `0xa79da6c7` | +| `isNonceUsed` | `0x5d00bb12` | +| `isWatcher` | `0x84785ecd` | +| `latestAsyncPromise` | `0xb8a8ba52` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadQueue` | `0x74f00ffb` | -| `promiseResolver__` | `0xdee152be` | -| `queue` | `0xf03ca7f7` | -| `queueAndSubmit` | `0xf0fb9665` | -| `renounceOwnership` | `0x715018a6` | -| `requestHandler__` | `0x55184561` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0xa58c6fc5` | -| `setCoreContracts` | `0xefa891c4` | -| `setIsValidPlug` | `0x7fc82ff6` | -| `setTriggerFees` | `0xaeb30511` | -| `submitRequest` | `0x4890b5ef` | -| `transferOwnership` | `0xf2fde38b` | -| `triggerFees` | `0x73f76aec` | -| `triggerFromChainSlug` | `0xd12b4f12` | -| `triggerFromPlug` | `0x3b847d12` | -| `watcherMultiCall` | `0x8021e82b` | -| `watcher__` | `0x300bb063` | +| `payloadQueue` | `0x74f00ffb` | +| `promiseResolver__` | `0xdee152be` | +| `queue` | `0xf03ca7f7` | +| `queueAndSubmit` | `0xf0fb9665` | +| `renounceOwnership` | `0x715018a6` | +| `requestHandler__` | `0x55184561` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0xa58c6fc5` | +| `setCoreContracts` | `0xefa891c4` | +| `setIsValidPlug` | `0x7fc82ff6` | +| `setTriggerFees` | `0xaeb30511` | +| `submitRequest` | `0x4890b5ef` | +| `transferOwnership` | `0xf2fde38b` | +| `triggerFees` | `0x73f76aec` | +| `triggerFromChainSlug` | `0xd12b4f12` | +| `triggerFromPlug` | `0x3b847d12` | +| `watcherMultiCall` | `0x8021e82b` | +| `watcher__` | `0x300bb063` | ## FastSwitchboard -| Function | Signature | -| ---------------------------- | ------------ | -| `allowPayload` | `0x31c23f66` | -| `attest` | `0x63671b60` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isAttested` | `0xc13c2396` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x63671b60` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## ReadPrecompile -| Function | Signature | -| ------------------------------ | ------------ | -| `expiryTime` | `0x99bc0aea` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x1d5e1d98` | -| `readFees` | `0xe06357a2` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0xea92e825` | -| `setExpiryTime` | `0x30fc4cff` | -| `setFees` | `0x3d18678e` | +| Function | Signature | +| -------- | --------- | +| `expiryTime` | `0x99bc0aea` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `handlePayload` | `0x1d5e1d98` | +| `readFees` | `0xe06357a2` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0xea92e825` | +| `setExpiryTime` | `0x30fc4cff` | +| `setFees` | `0x3d18678e` | | `validateAndGetPrecompileData` | `0xab172aab` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## SchedulePrecompile -| Function | Signature | -| ------------------------------ | ------------ | -| `expiryTime` | `0x99bc0aea` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x1d5e1d98` | -| `maxScheduleDelayInSeconds` | `0x3ef01cdb` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0xea92e825` | -| `scheduleCallbackFees` | `0x4c5b6007` | -| `scheduleFeesPerSecond` | `0x852a74c1` | -| `setExpiryTime` | `0x30fc4cff` | +| Function | Signature | +| -------- | --------- | +| `expiryTime` | `0x99bc0aea` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `handlePayload` | `0x1d5e1d98` | +| `maxScheduleDelayInSeconds` | `0x3ef01cdb` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0xea92e825` | +| `scheduleCallbackFees` | `0x4c5b6007` | +| `scheduleFeesPerSecond` | `0x852a74c1` | +| `setExpiryTime` | `0x30fc4cff` | | `setMaxScheduleDelayInSeconds` | `0x12953318` | -| `setScheduleCallbackFees` | `0xec8fd71e` | -| `setScheduleFeesPerSecond` | `0x28e59e57` | +| `setScheduleCallbackFees` | `0xec8fd71e` | +| `setScheduleFeesPerSecond` | `0x28e59e57` | | `validateAndGetPrecompileData` | `0xab172aab` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## WritePrecompile -| Function | Signature | -| ------------------------------ | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainMaxMsgValueLimit` | `0x01d1e126` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `contractFactoryPlugs` | `0x35426631` | -| `digestHashes` | `0xd1a862bf` | -| `expiryTime` | `0x99bc0aea` | -| `getDigest` | `0xdd4bf97b` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `getPrevBatchDigestHash` | `0x372863a1` | -| `handlePayload` | `0x1d5e1d98` | -| `initialize` | `0xeb990c59` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0xea92e825` | -| `setContractFactoryPlugs` | `0xc067b6dd` | -| `setExpiryTime` | `0x30fc4cff` | -| `setFees` | `0x3d18678e` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainMaxMsgValueLimit` | `0x01d1e126` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `contractFactoryPlugs` | `0x35426631` | +| `digestHashes` | `0xd1a862bf` | +| `expiryTime` | `0x99bc0aea` | +| `getDigest` | `0xdd4bf97b` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `getPrevBatchDigestHash` | `0x372863a1` | +| `handlePayload` | `0x1d5e1d98` | +| `initialize` | `0xeb990c59` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0xea92e825` | +| `setContractFactoryPlugs` | `0xc067b6dd` | +| `setExpiryTime` | `0x30fc4cff` | +| `setFees` | `0x3d18678e` | +| `transferOwnership` | `0xf2fde38b` | | `updateChainMaxMsgValueLimits` | `0x6a7aa6ac` | -| `uploadProof` | `0x81b48fcf` | +| `uploadProof` | `0x81b48fcf` | | `validateAndGetPrecompileData` | `0xab172aab` | -| `watcherProofs` | `0x3fa3166b` | -| `watcher__` | `0x300bb063` | -| `writeFees` | `0x5c664aeb` | +| `watcherProofs` | `0x3fa3166b` | +| `watcher__` | `0x300bb063` | +| `writeFees` | `0x5c664aeb` | + From 31e4f5accab277ec957ff746775310fe13796057 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 27 Jun 2025 14:02:40 +0530 Subject: [PATCH 014/139] fix: tests --- test/apps/Counter.t.sol | 10 ++++++---- test/apps/app-gateways/counter/CounterAppGateway.sol | 9 +++++++++ .../app-gateways/super-token/SuperTokenAppGateway.sol | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/test/apps/Counter.t.sol b/test/apps/Counter.t.sol index e0949f07..728e85f4 100644 --- a/test/apps/Counter.t.sol +++ b/test/apps/Counter.t.sol @@ -96,11 +96,13 @@ contract CounterTest is AppGatewayBaseSetup { instances[1] = optCounterForwarder; counterGateway.incrementCounters(instances); - uint32[] memory chains = new uint32[](2); - chains[0] = arbChainSlug; - chains[1] = optChainSlug; - + bool incremented = counterGateway.incremented(); + assertEq(incremented, false); executeRequest(); + + incremented = counterGateway.incremented(); + assertEq(incremented, true); + assertEq(Counter(arbCounter).counter(), arbCounterBefore + 1); assertEq(Counter(optCounter).counter(), optCounterBefore + 1); } diff --git a/test/apps/app-gateways/counter/CounterAppGateway.sol b/test/apps/app-gateways/counter/CounterAppGateway.sol index 41666c9b..8615c82c 100644 --- a/test/apps/app-gateways/counter/CounterAppGateway.sol +++ b/test/apps/app-gateways/counter/CounterAppGateway.sol @@ -13,6 +13,8 @@ contract CounterAppGateway is AppGatewayBase, Ownable { uint256 public arbCounter; uint256 public optCounter; + bool public incremented; + event CounterScheduleResolved(uint256 creationTimestamp, uint256 executionTimestamp); constructor(address addressResolver_, uint256 fees_) { @@ -53,10 +55,17 @@ contract CounterAppGateway is AppGatewayBase, Ownable { } function incrementCounters(address[] memory instances_) public async { + incremented = false; // the increase function is called on given list of instances for (uint256 i = 0; i < instances_.length; i++) { ICounter(instances_[i]).increase(); } + + onCompleteData = abi.encodeWithSelector(this.onIncrementComplete.selector); + } + + function onIncrementComplete() public { + incremented = true; } // for testing purposes diff --git a/test/apps/app-gateways/super-token/SuperTokenAppGateway.sol b/test/apps/app-gateways/super-token/SuperTokenAppGateway.sol index 0e835b7e..e50b0cb8 100644 --- a/test/apps/app-gateways/super-token/SuperTokenAppGateway.sol +++ b/test/apps/app-gateways/super-token/SuperTokenAppGateway.sol @@ -56,7 +56,7 @@ contract SuperTokenAppGateway is AppGatewayBase, Ownable { } // no need to call this directly, will be called automatically after all contracts are deployed. - // check AppGatewayBase._deploy and AppGatewayBase.onRequestComplete + // check AppGatewayBase._deploy and AppGatewayBase.onDeployComplete function initializeOnChain(uint32) public pure override { return; } From 523388ad730855d0923054b500e41920633be07e Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 27 Jun 2025 15:36:29 +0530 Subject: [PATCH 015/139] fix: add tryCall --- contracts/evmx/helpers/AsyncDeployer.sol | 5 ++++- contracts/evmx/watcher/RequestHandler.sol | 5 ++++- contracts/evmx/watcher/Watcher.sol | 9 ++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/contracts/evmx/helpers/AsyncDeployer.sol b/contracts/evmx/helpers/AsyncDeployer.sol index 735d3241..97b1df48 100644 --- a/contracts/evmx/helpers/AsyncDeployer.sol +++ b/contracts/evmx/helpers/AsyncDeployer.sol @@ -10,6 +10,7 @@ import {Forwarder} from "./Forwarder.sol"; import {AsyncPromise} from "./AsyncPromise.sol"; import {AddressResolverUtil} from "./AddressResolverUtil.sol"; import "../../utils/RescueFundsLib.sol"; +import "solady/utils/LibCall.sol"; abstract contract AsyncDeployerStorage is IAsyncDeployer { // slots [0-49] reserved for gap @@ -39,6 +40,8 @@ abstract contract AsyncDeployerStorage is IAsyncDeployer { /// @title AsyncDeployer Contract /// @notice This contract is responsible for deploying Forwarder and AsyncPromise contracts. contract AsyncDeployer is AsyncDeployerStorage, Initializable, AddressResolverUtil, Ownable { + using LibCall for address; + constructor() { _disableInitializers(); // disable for implementation } @@ -157,7 +160,7 @@ contract AsyncDeployer is AsyncDeployerStorage, Initializable, AddressResolverUt address proxy = LibClone.deployDeterministicERC1967BeaconProxy(beacon_, salt_); // Explicitly initialize after deployment - (bool success, ) = proxy.call(initData_); + (bool success, , ) = proxy.tryCall(0, gasleft(), 0, initData_); require(success, "Initialization failed"); return proxy; diff --git a/contracts/evmx/watcher/RequestHandler.sol b/contracts/evmx/watcher/RequestHandler.sol index c71b2e95..798f1e2f 100644 --- a/contracts/evmx/watcher/RequestHandler.sol +++ b/contracts/evmx/watcher/RequestHandler.sol @@ -11,6 +11,7 @@ import "../interfaces/IAppGateway.sol"; import "../interfaces/IPromise.sol"; import "../interfaces/IRequestHandler.sol"; import "../../utils/RescueFundsLib.sol"; +import "solady/utils/LibCall.sol"; abstract contract RequestHandlerStorage is IRequestHandler { // slots [0-49] reserved for gap @@ -60,6 +61,8 @@ abstract contract RequestHandlerStorage is IRequestHandler { /// @notice Contract that handles request processing and management, including request submission, batch processing, and request lifecycle management /// @dev Handles request submission, batch processing, transmitter assignment, request cancellation and settlement contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, AddressResolverUtil { + using LibCall for address; + error InsufficientMaxFees(); event RequestSubmitted( @@ -419,7 +422,7 @@ contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, Addres ); if (r.onCompleteData.length > 0) { - (bool success, ) = r.appGateway.call(r.onCompleteData); + (bool success, , ) = r.appGateway.tryCall(0, gasleft(), 0, r.onCompleteData); if (!success) emit RequestCompletedWithErrors(requestCount_); } emit RequestSettled(requestCount_, r.requestFeesDetails.winningBid.transmitter); diff --git a/contracts/evmx/watcher/Watcher.sol b/contracts/evmx/watcher/Watcher.sol index 7dbaa28b..21ebb2d2 100644 --- a/contracts/evmx/watcher/Watcher.sol +++ b/contracts/evmx/watcher/Watcher.sol @@ -5,6 +5,8 @@ import "./Trigger.sol"; import "../interfaces/IPromise.sol"; contract Watcher is Trigger { + using LibCall for address; + constructor() { _disableInitializers(); // disable for implementation } @@ -184,7 +186,12 @@ contract Watcher is Trigger { ); // call the contract - (bool success, ) = params_[i].contractAddress.call(params_[i].data); + (bool success, , ) = params_[i].contractAddress.tryCall( + 0, + gasleft(), + 0, + params_[i].data + ); if (!success) revert CallFailed(); } } From 6d548ca5aae1dc43569b1db88bda7164304d6d1b Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 27 Jun 2025 17:18:40 +0530 Subject: [PATCH 016/139] fix: fees manager as app gateway --- contracts/evmx/base/AppGatewayBase.sol | 4 ++-- contracts/evmx/fees/Credit.sol | 25 ++++++++++++++----------- contracts/evmx/fees/FeesManager.sol | 5 +++-- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/contracts/evmx/base/AppGatewayBase.sol b/contracts/evmx/base/AppGatewayBase.sol index cf534c7c..06878f2e 100644 --- a/contracts/evmx/base/AppGatewayBase.sol +++ b/contracts/evmx/base/AppGatewayBase.sol @@ -366,7 +366,7 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { /// @param onCompleteData_ The on complete data /// @dev only payload delivery can call this /// @dev callback in pd promise to be called after all contracts are deployed - function onDeployComplete(uint40, bytes calldata onCompleteData_) external onlyWatcher { + function onDeployComplete(uint40, bytes calldata onCompleteData_) external virtual onlyWatcher { if (onCompleteData_.length == 0) return; uint32 chainSlug = abi.decode(onCompleteData_, (uint32)); initializeOnChain(chainSlug); @@ -380,5 +380,5 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { /// @notice hook to handle the revert in callbacks or onchain executions /// @dev can be overridden by the app gateway to add custom logic /// @param payloadId_ The payload ID - function handleRevert(bytes32 payloadId_) external override onlyPromises {} + function handleRevert(bytes32 payloadId_) external virtual onlyPromises {} } diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 31fb880d..c8c50b05 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -14,6 +14,7 @@ import {AddressResolverUtil} from "../helpers/AddressResolverUtil.sol"; import {NonceUsed, InvalidAmount, InsufficientCreditsAvailable, InsufficientBalance, InvalidChainSlug, NotRequestHandler} from "../../utils/common/Errors.sol"; import {WRITE} from "../../utils/common/Constants.sol"; import "../../utils/RescueFundsLib.sol"; +import "../base/AppGatewayBase.sol"; abstract contract FeesManagerStorage is IFeesManager { // slots [0-49] reserved for gap @@ -27,7 +28,7 @@ abstract contract FeesManagerStorage is IFeesManager { // slot 51 /// @notice switchboard type - bytes32 public sbType; + bytes32 public deprecatedSbType; // slot 52 /// @notice user credits => stores fees for user, app gateway, transmitters and watcher precompile @@ -63,11 +64,17 @@ abstract contract FeesManagerStorage is IFeesManager { uint256[50] _gap_after; // slots [108-157] 50 slots reserved for address resolver util + // 9 slots for app gateway base } /// @title UserUtils /// @notice Contract for managing user utils -abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AddressResolverUtil { +abstract contract Credit is + FeesManagerStorage, + Initializable, + Ownable, + AppGatewayBase +{ /// @notice Emitted when fees deposited are updated /// @param chainSlug The chain identifier /// @param token The token address @@ -276,11 +283,9 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AddressR address consumeFrom_, uint256 maxFees_, bytes memory payload_ - ) internal { - OverrideParams memory overrideParams; - overrideParams.callType = WRITE; - overrideParams.writeFinality = WriteFinality.LOW; - // todo: can add gas limit here + ) internal async { + _setMaxFees(maxFees_); + _setOverrides(consumeFrom_); QueueParams memory queueParams; queueParams.overrideParams = overrideParams; @@ -290,9 +295,7 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AddressR payload: payload_ }); queueParams.switchboardType = sbType; - - // queue and create request - watcher__().queueAndSubmit(queueParams, maxFees_, address(0), consumeFrom_, bytes("")); + watcher__().queue(queueParams, address(this)); } function _getFeesPlugAddress(uint32 chainSlug_) internal view returns (address) { @@ -315,7 +318,7 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AddressR /// @notice hook to handle the revert while withdrawing credits /// @param payloadId_ The payload ID - function handleRevert(bytes32 payloadId_) external { + function handleRevert(bytes32 payloadId_) external override { if (watcher__().getPayloadParams(payloadId_).asyncPromise != msg.sender) return; emit WithdrawFailed(payloadId_); } diff --git a/contracts/evmx/fees/FeesManager.sol b/contracts/evmx/fees/FeesManager.sol index 306b27c2..da3b29b9 100644 --- a/contracts/evmx/fees/FeesManager.sol +++ b/contracts/evmx/fees/FeesManager.sol @@ -48,12 +48,13 @@ contract FeesManager is Credit { address feesPool_, address owner_, bytes32 sbType_ - ) public reinitializer(1) { + ) public reinitializer(2) { evmxSlug = evmxSlug_; sbType = sbType_; feesPool = IFeesPool(feesPool_); - _setAddressResolver(addressResolver_); + _initializeOwner(owner_); + _initializeAppGateway(addressResolver_); } /////////////////////// FEES MANAGEMENT /////////////////////// From b4071085eb7fd6365612e5285cd25d884ff619c4 Mon Sep 17 00:00:00 2001 From: Gregory The Dev Date: Thu, 3 Jul 2025 13:45:01 +0200 Subject: [PATCH 017/139] fix: lost letter --- contracts/evmx/watcher/precompiles/WritePrecompile.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index be56971f..6bc8192b 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -155,7 +155,7 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc { ( address appGateway, - Transaction memory transaction,– + Transaction memory transaction, , uint256 gasLimit, uint256 value, From 74babcced3daeea3efcceb94929ed3b66efefd7f Mon Sep 17 00:00:00 2001 From: Akash Date: Fri, 4 Jul 2025 14:16:14 +0530 Subject: [PATCH 018/139] feat: merged dev into cctp --- contracts/protocol/SocketBatcher.sol | 2 +- test/SetupTest.t.sol | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/protocol/SocketBatcher.sol b/contracts/protocol/SocketBatcher.sol index d9f12878..8268fe65 100644 --- a/contracts/protocol/SocketBatcher.sol +++ b/contracts/protocol/SocketBatcher.sol @@ -66,7 +66,7 @@ contract SocketBatcher is ISocketBatcher, Ownable { execParams_.executeParams.requestCount, execParams_.executeParams.batchCount, execParams_.executeParams.payloadCount, - switchboard_, + bytes32(uint256(uint160(address(switchboard_)))), socket__.chainSlug() ); ICCTPSwitchboard(switchboard_).attestVerifyAndProveExecutions( diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 845aa0a8..32123840 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -984,7 +984,7 @@ contract WatcherSetup is AuctionSetup { refundAddress: transmitterEOA }), cctpBatchParams, - fromBytes32Format(address(getSocketConfig(chainSlug).cctpSwitchboard)) + address(getSocketConfig(chainSlug).cctpSwitchboard) ); } @@ -1106,8 +1106,8 @@ contract WatcherSetup is AuctionSetup { // deployed on a chain. for ex, vault on source, and supertoken on destination. uint256 validPlugCount = 0; for (uint i = 0; i < contractIds_.length; i++) { - address plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); - if (plug != address(0)) { + bytes32 plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); + if (plug != bytes32(0)) { validPlugCount++; } } @@ -1117,15 +1117,15 @@ contract WatcherSetup is AuctionSetup { uint256 configIndex = 0; for (uint i = 0; i < contractIds_.length; i++) { - address plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); - address switchboard = configurations.switchboards(chainSlug_, appGateway_.sbType()); - if (plug != address(0)) { + bytes32 plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); + bytes32 switchboard = configurations.switchboards(chainSlug_, appGateway_.sbType()); + if (plug != bytes32(0)) { configs[configIndex] = AppGatewayConfig({ plug: plug, chainSlug: chainSlug_, plugConfig: PlugConfigGeneric({ appGatewayId: toBytes32Format(address(appGateway_)), - switchboard: toBytes32Format(address(switchboard)) + switchboard: switchboard }) }); configIndex++; From 9c4713013d41c632fbcef115e36c5f041cc9ec3e Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 16 Jul 2025 19:10:45 +0530 Subject: [PATCH 019/139] feat: msg sb --- .../protocol/interfaces/ISwitchboard.sol | 7 - .../switchboard/MessageSwitchboard.sol | 236 ++++++++++++++++++ 2 files changed, 236 insertions(+), 7 deletions(-) create mode 100644 contracts/protocol/switchboard/MessageSwitchboard.sol diff --git a/contracts/protocol/interfaces/ISwitchboard.sol b/contracts/protocol/interfaces/ISwitchboard.sol index 4f1095ea..08db11bb 100644 --- a/contracts/protocol/interfaces/ISwitchboard.sol +++ b/contracts/protocol/interfaces/ISwitchboard.sol @@ -14,11 +14,4 @@ interface ISwitchboard { * @return A boolean indicating whether the payloads is allowed to go through the switchboard or not. */ function allowPayload(bytes32 digest_, bytes32 payloadId_) external view returns (bool); - - /** - * @notice Attests a payload - * @param digest_ The digest of the payload - * @param proof_ The proof of the payload - */ - function attest(bytes32 digest_, bytes calldata proof_) external; } diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol new file mode 100644 index 00000000..26b481ad --- /dev/null +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -0,0 +1,236 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import "./SwitchboardBase.sol"; +import {WATCHER_ROLE} from "../../utils/common/AccessRoles.sol"; +import {toBytes32Format} from "../../utils/common/Converters.sol"; +import {createPayloadId} from "../../utils/common/IdUtils.sol"; +import {DigestParams} from "../../utils/common/Structs.sol"; +import {WRITE} from "../../utils/common/Constants.sol"; + +/** + * @title MessageSwitchboard contract + * @dev This contract implements a message switchboard that enables payload attestations from watchers + */ +contract MessageSwitchboard is SwitchboardBase { + // used to track if watcher have attested a payload + // payloadId => isAttested + mapping(bytes32 => bool) public isAttested; + + // sibling mappings for outbound journey + // chainSlug => siblingSocket + mapping(uint32 => bytes32) public siblingSockets; + // chainSlug => siblingSwitchboard + mapping(uint32 => bytes32) public siblingSwitchboards; + // chainSlug => address => siblingPlug + mapping(uint32 => mapping(address => bytes32)) public siblingPlugs; + + // payload counter for generating unique payload IDs + uint40 public payloadCounter; + + // Constant appGatewayId used on all chains + bytes32 constant APP_GATEWAY_ID = + 0xdeadbeefcafebabe1234567890abcdef1234567890abcdef1234567890abcdef; + + // Error emitted when a payload is already attested by watcher. + error AlreadyAttested(); + // Error emitted when watcher is not valid + error WatcherNotFound(); + // Error emitted when sibling not found + error SiblingNotFound(); + // Error emitted when invalid target verification + error InvalidTargetVerification(); + + // Event emitted when watcher attests a payload + event Attested(bytes32 payloadId_, address watcher); + // Event emitted when trigger is processed + event TriggerProcessed( + bytes32 payloadId, + bytes32 digest, + bytes32 dstPlug, + uint32 dstChainSlug, + bytes payload + ); + // Event emitted when sibling is registered + event SiblingRegistered(uint32 chainSlug, address plugAddress, bytes32 siblingPlug); + + // Event emitted when sibling config is set + event SiblingConfigSet(uint32 chainSlug, bytes32 socket, bytes32 switchboard); + + /** + * @dev Constructor function for the MessageSwitchboard contract + * @param chainSlug_ Chain slug of the chain where the contract is deployed + * @param socket_ Socket contract address + * @param owner_ Owner of the contract + */ + constructor( + uint32 chainSlug_, + ISocket socket_, + address owner_ + ) SwitchboardBase(chainSlug_, socket_, owner_) {} + + /** + * @dev Function to register sibling addresses for a chain (admin only) + * @param chainSlug_ Chain slug of the sibling chain + * @param socket_ Sibling socket address + * @param switchboard_ Sibling switchboard address + */ + function setSiblingConfig( + uint32 chainSlug_, + bytes32 socket_, + bytes32 switchboard_ + ) external onlyOwner { + siblingSockets[chainSlug_] = socket_; + siblingSwitchboards[chainSlug_] = switchboard_; + + emit SiblingConfigSet(chainSlug_, socket_, switchboard_); + } + + /** + * @dev Function for plugs to register their own siblings + * @param chainSlug_ Chain slug of the sibling chain + * @param siblingPlug_ Sibling plug address + */ + function registerSibling(uint32 chainSlug_, bytes32 siblingPlug_) external { + if ( + siblingSockets[chainSlug_] == bytes32(0) || + siblingSwitchboards[chainSlug_] == bytes32(0) + ) { + revert SiblingNotFound(); + } + + // Register the sibling for the calling plug + siblingPlugs[chainSlug_][msg.sender] = siblingPlug_; + emit SiblingRegistered(chainSlug_, msg.sender, siblingPlug_); + } + + /** + * @dev Function to process trigger and create payload + * @param socketCounter_ Socket counter + * @param plug_ Source plug address + * @param triggerId_ Trigger ID from socket + * @param payload_ Payload data + * @param overrides_ Override parameters including dstChainSlug and gasLimit + */ + function processTrigger( + uint40 socketCounter_, + address plug_, + bytes32 triggerId_, + bytes calldata payload_, + bytes calldata overrides_ + ) external returns (bytes32 payloadId, bytes32 digest) { + (uint32 dstChainSlug, uint256 gasLimit, uint256 value) = abi.decode( + overrides_, + (uint32, uint256, uint256) + ); + + bytes32 dstSocket = siblingSockets[dstChainSlug]; + bytes32 dstSwitchboard = siblingSwitchboards[dstChainSlug]; + bytes32 dstPlug = siblingPlugs[dstChainSlug][plug_]; + + if (dstSocket == bytes32(0) || dstSwitchboard == bytes32(0) || dstPlug == bytes32(0)) { + revert SiblingNotFound(); + } + + payloadId = createPayloadId( + 0, + socketCounter_, + payloadCounter++, + dstSwitchboard, + dstChainSlug + ); + + // Create digest with new structure + bytes memory extraData = abi.encodePacked(chainSlug, toBytes32Format(plug_)); + digest = _createDigest( + dstSocket, + address(0), + payloadId, + block.timestamp + 3600, + WRITE, + gasLimit, + value, + dstPlug, + APP_GATEWAY_ID, + triggerId_, + payload_, + extraData + ); + + emit TriggerProcessed(payloadId, digest, dstPlug, dstChainSlug, payload_); + } + + /** + * @dev Function to attest a payload with enhanced verification + * @param digest_ Full unhashed digest parameters + * @param proof_ proof from watcher + * @notice Enhanced attestation that verifies target with srcChainSlug and srcPlug + */ + function attest(DigestParams calldata digest_, bytes calldata proof_) public { + if (isAttested[digest_.payloadId]) revert AlreadyAttested(); + (uint32 srcChainSlug, bytes32 srcPlug) = abi.decode(digest_.extraData, (uint32, bytes32)); + + if (siblingPlugs[srcChainSlug][address(uint160(uint256(srcPlug)))] != digest_.target) { + revert InvalidTargetVerification(); + } + + address watcher = _recoverSigner( + keccak256( + abi.encodePacked(toBytes32Format(address(this)), chainSlug, digest_.payloadId) + ), + proof_ + ); + if (!_hasRole(WATCHER_ROLE, watcher)) revert WatcherNotFound(); + + isAttested[digest_.payloadId] = true; + emit Attested(digest_.payloadId, watcher); + } + + /** + * @inheritdoc ISwitchboard + */ + function allowPayload(bytes32 digest_, bytes32) external view override returns (bool) { + // digest has enough attestations + return isAttested[digest_]; + } + + function registerSwitchboard() external onlyOwner { + socket__.registerSwitchboard(); + } + + /** + * @dev Internal function to create digest from parameters + */ + function _createDigest( + bytes32 socket_, + address transmitter_, + bytes32 payloadId_, + uint256 deadline_, + bytes4 callType_, + uint256 gasLimit_, + uint256 value_, + bytes32 target_, + bytes32 appGatewayId_, + bytes32 prevDigestHash_, + bytes calldata payload_, + bytes memory extraData_ + ) internal pure returns (bytes32) { + return + keccak256( + abi.encodePacked( + socket_, + transmitter_, + payloadId_, + deadline_, + callType_, + gasLimit_, + value_, + payload_, + target_, + appGatewayId_, + prevDigestHash_, + extraData_ + ) + ); + } +} From 5bca6d22aad80ef34e8cbdff0fd77c67b396262d Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 16 Jul 2025 19:20:13 +0530 Subject: [PATCH 020/139] feat: socket changes --- contracts/protocol/Socket.sol | 16 ++++++++++++++-- contracts/protocol/interfaces/ISwitchboard.sol | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index b5e8bb17..2a8434d2 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -2,6 +2,8 @@ pragma solidity ^0.8.21; import "./SocketUtils.sol"; + +import "./interfaces/ISwitchboard.sol"; import {WRITE} from "../utils/common/Constants.sol"; import {createPayloadId} from "../utils/common/IdUtils.sol"; @@ -186,15 +188,25 @@ contract Socket is SocketUtils { // sends the trigger to connected app gateway if (plugConfig.appGatewayId == bytes32(0)) revert PlugNotFound(); + // Get overrides from plug + bytes memory plugOverrides = IPlug(msg.sender).overrides(); + // creates a unique ID for the message triggerId = _encodeTriggerId(); + // Call processTrigger on switchboard + ISwitchboard(plugConfig.switchboard).processTrigger{value: msg.value}( + triggerId, + msg.sender, + msg.data, + plugOverrides + ); + emit AppGatewayCallRequested( triggerId, plugConfig.appGatewayId, toBytes32Format(plugConfig.switchboard), toBytes32Format(plug_), - // gets the overrides from the plug - IPlug(plug_).overrides(), + plugOverrides, msg.data ); } diff --git a/contracts/protocol/interfaces/ISwitchboard.sol b/contracts/protocol/interfaces/ISwitchboard.sol index 08db11bb..a74a0de1 100644 --- a/contracts/protocol/interfaces/ISwitchboard.sol +++ b/contracts/protocol/interfaces/ISwitchboard.sol @@ -14,4 +14,18 @@ interface ISwitchboard { * @return A boolean indicating whether the payloads is allowed to go through the switchboard or not. */ function allowPayload(bytes32 digest_, bytes32 payloadId_) external view returns (bool); + + /** + * @notice Processes a trigger and creates payload + * @param triggerId_ Trigger ID from socket + * @param plug_ Source plug address + * @param payload_ Payload data + * @param overrides_ Overrides for the trigger + */ + function processTrigger( + bytes32 triggerId_, + address plug_, + bytes calldata payload_, + bytes calldata overrides_ + ) external payable; } From fd71193120704eb26e3f53633555c179d4381e5e Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 16 Jul 2025 19:25:41 +0530 Subject: [PATCH 021/139] feat: msg plug base --- contracts/protocol/base/MessagePlugBase.sol | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 contracts/protocol/base/MessagePlugBase.sol diff --git a/contracts/protocol/base/MessagePlugBase.sol b/contracts/protocol/base/MessagePlugBase.sol new file mode 100644 index 00000000..28432794 --- /dev/null +++ b/contracts/protocol/base/MessagePlugBase.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import {PlugBase} from "./PlugBase.sol"; +import {ISwitchboard} from "../interfaces/ISwitchboard.sol"; + +interface IMessageSwitchboard is ISwitchboard { + function registerSibling(uint32 chainSlug_, bytes32 siblingPlug_) external; +} + +/// @title MessagePlugBase +/// @notice Abstract contract for message plugs in the updated protocol +/// @dev This contract contains helpers for socket connection, disconnection, and overrides +/// Uses constant appGatewayId (0xaaaaa) for all chains +abstract contract MessagePlugBase is PlugBase { + error NotSupported(); + + /// @notice Initializes the socket with the new protocol + function initSocket(bytes32, address, address) external override socketInitializer { + revert("Not Supported"); + } + + /// @notice Registers a sibling plug for a specific chain + /// @param chainSlug_ Chain slug of the sibling chain + /// @param siblingPlug_ Address of the sibling plug on the destination chain + function registerSibling(uint32 chainSlug_, bytes32 siblingPlug_) public { + // Call the switchboard to register the sibling + (, address switchboardAddress) = socket__.getPlugConfig(address(this)); + IMessageSwitchboard(switchboardAddress).registerSibling(chainSlug_, siblingPlug_); + } +} From 8d85de226bf9b7be85fe2d674033ea415bc45572 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 16 Jul 2025 19:33:43 +0530 Subject: [PATCH 022/139] fix: build --- contracts/protocol/Socket.sol | 2 +- contracts/protocol/SocketBatcher.sol | 6 +++++- contracts/protocol/interfaces/ISwitchboard.sol | 2 +- contracts/protocol/switchboard/FastSwitchboard.sol | 9 +++++++++ contracts/protocol/switchboard/MessageSwitchboard.sol | 11 +++++------ 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index 2a8434d2..29d923bc 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -195,8 +195,8 @@ contract Socket is SocketUtils { triggerId = _encodeTriggerId(); // Call processTrigger on switchboard ISwitchboard(plugConfig.switchboard).processTrigger{value: msg.value}( - triggerId, msg.sender, + triggerId, msg.data, plugOverrides ); diff --git a/contracts/protocol/SocketBatcher.sol b/contracts/protocol/SocketBatcher.sol index 8268fe65..19a3db8b 100644 --- a/contracts/protocol/SocketBatcher.sol +++ b/contracts/protocol/SocketBatcher.sol @@ -10,6 +10,10 @@ import "../utils/RescueFundsLib.sol"; import {ExecuteParams, TransmissionParams, CCTPBatchParams, CCTPExecutionParams} from "../utils/common/Structs.sol"; import {createPayloadId} from "../utils/common/IdUtils.sol"; +interface IFastSwitchboard is ISwitchboard { + function attest(bytes32 digest_, bytes calldata proof_) external; +} + /** * @title SocketBatcher * @notice The SocketBatcher contract is responsible for batching payloads and transmitting them to the destination chain @@ -44,7 +48,7 @@ contract SocketBatcher is ISocketBatcher, Ownable { bytes calldata transmitterSignature_, address refundAddress_ ) external payable returns (bool, bytes memory) { - ISwitchboard(switchboard_).attest(digest_, proof_); + IFastSwitchboard(switchboard_).attest(digest_, proof_); return socket__.execute{value: msg.value}( executeParams_, diff --git a/contracts/protocol/interfaces/ISwitchboard.sol b/contracts/protocol/interfaces/ISwitchboard.sol index a74a0de1..3434cd45 100644 --- a/contracts/protocol/interfaces/ISwitchboard.sol +++ b/contracts/protocol/interfaces/ISwitchboard.sol @@ -23,8 +23,8 @@ interface ISwitchboard { * @param overrides_ Overrides for the trigger */ function processTrigger( - bytes32 triggerId_, address plug_, + bytes32 triggerId_, bytes calldata payload_, bytes calldata overrides_ ) external payable; diff --git a/contracts/protocol/switchboard/FastSwitchboard.sol b/contracts/protocol/switchboard/FastSwitchboard.sol index 7ec6fef5..fdd409ca 100644 --- a/contracts/protocol/switchboard/FastSwitchboard.sol +++ b/contracts/protocol/switchboard/FastSwitchboard.sol @@ -64,4 +64,13 @@ contract FastSwitchboard is SwitchboardBase { function registerSwitchboard() external onlyOwner { socket__.registerSwitchboard(); } + + function processTrigger( + address plug_, + bytes32 triggerId_, + bytes calldata payload_, + bytes calldata overrides_ + ) external payable { + revert("Not implemented"); + } } diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol index 26b481ad..1b1c89b5 100644 --- a/contracts/protocol/switchboard/MessageSwitchboard.sol +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -106,19 +106,17 @@ contract MessageSwitchboard is SwitchboardBase { /** * @dev Function to process trigger and create payload - * @param socketCounter_ Socket counter * @param plug_ Source plug address * @param triggerId_ Trigger ID from socket * @param payload_ Payload data * @param overrides_ Override parameters including dstChainSlug and gasLimit */ function processTrigger( - uint40 socketCounter_, address plug_, bytes32 triggerId_, bytes calldata payload_, bytes calldata overrides_ - ) external returns (bytes32 payloadId, bytes32 digest) { + ) external payable override { (uint32 dstChainSlug, uint256 gasLimit, uint256 value) = abi.decode( overrides_, (uint32, uint256, uint256) @@ -132,9 +130,10 @@ contract MessageSwitchboard is SwitchboardBase { revert SiblingNotFound(); } - payloadId = createPayloadId( + uint64 socketCounter = uint64(uint256(triggerId_)); + bytes32 payloadId = createPayloadId( 0, - socketCounter_, + uint40(socketCounter), payloadCounter++, dstSwitchboard, dstChainSlug @@ -142,7 +141,7 @@ contract MessageSwitchboard is SwitchboardBase { // Create digest with new structure bytes memory extraData = abi.encodePacked(chainSlug, toBytes32Format(plug_)); - digest = _createDigest( + bytes32 digest = _createDigest( dstSocket, address(0), payloadId, From 7e09d34f566ca3beb9ad185fea91d959a5f0335f Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 17 Jul 2025 17:36:59 +0530 Subject: [PATCH 023/139] feat: pack counts in payload id --- contracts/utils/common/IdUtils.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/utils/common/IdUtils.sol b/contracts/utils/common/IdUtils.sol index 6490ad04..332c582e 100644 --- a/contracts/utils/common/IdUtils.sol +++ b/contracts/utils/common/IdUtils.sol @@ -15,8 +15,8 @@ function createPayloadId( bytes32 switchboard_, uint32 chainSlug_ ) pure returns (bytes32) { - return - keccak256( - abi.encodePacked(requestCount_, batchCount_, payloadCount_, chainSlug_, switchboard_) - ); + uint256 payloadCounter = (uint256(requestCount_) << 40) | + (uint256(batchCount_) << 24) | + uint256(payloadCount_); + return keccak256(abi.encodePacked(payloadCounter, chainSlug_, switchboard_)); } From 548539ba9ccb2bb34125d7b2b61dce344e20b3be Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 17 Jul 2025 17:37:32 +0530 Subject: [PATCH 024/139] fiz: payable fallback --- contracts/protocol/Socket.sol | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index 29d923bc..b36b127c 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.21; import "./SocketUtils.sol"; -import "./interfaces/ISwitchboard.sol"; import {WRITE} from "../utils/common/Constants.sol"; import {createPayloadId} from "../utils/common/IdUtils.sol"; @@ -213,9 +212,13 @@ contract Socket is SocketUtils { /// @notice Fallback function that forwards all calls to Socket's callAppGateway /// @dev The calldata is passed as-is to the gateways - /// @dev if ETH sent with the call, it will revert - fallback(bytes calldata) external returns (bytes memory) { + fallback(bytes calldata) external payable returns (bytes memory) { // return the trigger id return abi.encode(_triggerAppGateway(msg.sender)); } + + /// @notice Receive function that forwards all calls to Socket's callAppGateway + receive() external payable { + // todo: handle receive + } } From d367f016727a09dfab6b6b19d4effa1cf6ce312a Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 17 Jul 2025 17:37:59 +0530 Subject: [PATCH 025/139] fix: process trigger in fast sb --- contracts/protocol/switchboard/FastSwitchboard.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contracts/protocol/switchboard/FastSwitchboard.sol b/contracts/protocol/switchboard/FastSwitchboard.sol index fdd409ca..2eaf66fa 100644 --- a/contracts/protocol/switchboard/FastSwitchboard.sol +++ b/contracts/protocol/switchboard/FastSwitchboard.sol @@ -70,7 +70,5 @@ contract FastSwitchboard is SwitchboardBase { bytes32 triggerId_, bytes calldata payload_, bytes calldata overrides_ - ) external payable { - revert("Not implemented"); - } + ) external payable {} } From c098faff417072eed32a054b5efd0db35b162bba Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 17 Jul 2025 22:44:39 +0530 Subject: [PATCH 026/139] fix: add fees --- contracts/protocol/Socket.sol | 7 +- .../switchboard/MessageSwitchboard.sol | 151 +++++++++++------- test/mock/MockFastSwitchboard.sol | 7 + 3 files changed, 105 insertions(+), 60 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index b36b127c..553c51f7 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -184,15 +184,12 @@ contract Socket is SocketUtils { PlugConfigEvm memory plugConfig = _plugConfigs[plug_]; // if no sibling plug is found for the given chain slug, revert - // sends the trigger to connected app gateway if (plugConfig.appGatewayId == bytes32(0)) revert PlugNotFound(); - // Get overrides from plug bytes memory plugOverrides = IPlug(msg.sender).overrides(); - - // creates a unique ID for the message triggerId = _encodeTriggerId(); - // Call processTrigger on switchboard + + // todo: need gas limit? ISwitchboard(plugConfig.switchboard).processTrigger{value: msg.value}( msg.sender, triggerId, diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol index 1b1c89b5..09418258 100644 --- a/contracts/protocol/switchboard/MessageSwitchboard.sol +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -28,6 +28,9 @@ contract MessageSwitchboard is SwitchboardBase { // payload counter for generating unique payload IDs uint40 public payloadCounter; + // switchboard fees mapping: chainSlug => fee amount + mapping(uint32 => uint256) public switchboardFees; + // Constant appGatewayId used on all chains bytes32 constant APP_GATEWAY_ID = 0xdeadbeefcafebabe1234567890abcdef1234567890abcdef1234567890abcdef; @@ -40,6 +43,8 @@ contract MessageSwitchboard is SwitchboardBase { error SiblingNotFound(); // Error emitted when invalid target verification error InvalidTargetVerification(); + // Error emitted when value is not equal to msg.value + error InvalidValue(); // Event emitted when watcher attests a payload event Attested(bytes32 payloadId_, address watcher); @@ -56,6 +61,8 @@ contract MessageSwitchboard is SwitchboardBase { // Event emitted when sibling config is set event SiblingConfigSet(uint32 chainSlug, bytes32 socket, bytes32 switchboard); + // Event emitted when switchboard fees are set + event SwitchboardFeesSet(uint32 chainSlug, uint256 feeAmount); /** * @dev Constructor function for the MessageSwitchboard contract @@ -122,46 +129,73 @@ contract MessageSwitchboard is SwitchboardBase { (uint32, uint256, uint256) ); - bytes32 dstSocket = siblingSockets[dstChainSlug]; - bytes32 dstSwitchboard = siblingSwitchboards[dstChainSlug]; - bytes32 dstPlug = siblingPlugs[dstChainSlug][plug_]; + if (value != msg.value) revert InvalidValue(); + _validateSibling(dstChainSlug, plug_); + + (bytes32 digest, bytes32 payloadId) = _createDigestAndPayloadId( + dstChainSlug, + plug_, + gasLimit, + value, + triggerId_, + payload_ + ); + + emit TriggerProcessed( + payloadId, + digest, + siblingPlugs[dstChainSlug][plug_], + dstChainSlug, + payload_ + ); + } + + function _validateSibling(uint32 dstChainSlug_, address plug_) internal view { + bytes32 dstSocket = siblingSockets[dstChainSlug_]; + bytes32 dstSwitchboard = siblingSwitchboards[dstChainSlug_]; + bytes32 dstPlug = siblingPlugs[dstChainSlug_][plug_]; if (dstSocket == bytes32(0) || dstSwitchboard == bytes32(0) || dstPlug == bytes32(0)) { revert SiblingNotFound(); } + } - uint64 socketCounter = uint64(uint256(triggerId_)); - bytes32 payloadId = createPayloadId( - 0, - uint40(socketCounter), + function _createDigestAndPayloadId( + uint32 dstChainSlug_, + address plug_, + uint256 gasLimit_, + uint256 value_, + bytes32 triggerId_, + bytes calldata payload_ + ) internal returns (bytes32 digest, bytes32 payloadId) { + payloadId = createPayloadId( + chainSlug, + uint40(uint64(uint256(triggerId_))), payloadCounter++, - dstSwitchboard, - dstChainSlug - ); - - // Create digest with new structure - bytes memory extraData = abi.encodePacked(chainSlug, toBytes32Format(plug_)); - bytes32 digest = _createDigest( - dstSocket, - address(0), - payloadId, - block.timestamp + 3600, - WRITE, - gasLimit, - value, - dstPlug, - APP_GATEWAY_ID, - triggerId_, - payload_, - extraData + siblingSwitchboards[dstChainSlug_], + dstChainSlug_ ); - emit TriggerProcessed(payloadId, digest, dstPlug, dstChainSlug, payload_); + DigestParams memory digestParams = DigestParams({ + socket: siblingSockets[dstChainSlug_], + transmitter: address(0), + payloadId: payloadId, + deadline: block.timestamp + 3600, + callType: WRITE, + gasLimit: gasLimit_, + value: value_, + payload: payload_, + target: siblingPlugs[dstChainSlug_][plug_], + appGatewayId: APP_GATEWAY_ID, + prevBatchDigestHash: triggerId_, + extraData: abi.encodePacked(chainSlug, toBytes32Format(plug_)) + }); + digest = _createDigest(digestParams); } /** * @dev Function to attest a payload with enhanced verification - * @param digest_ Full unhashed digest parameters + * @param digest_ Full un-hashed digest parameters * @param proof_ proof from watcher * @notice Enhanced attestation that verifies target with srcChainSlug and srcPlug */ @@ -181,7 +215,8 @@ contract MessageSwitchboard is SwitchboardBase { ); if (!_hasRole(WATCHER_ROLE, watcher)) revert WatcherNotFound(); - isAttested[digest_.payloadId] = true; + bytes32 digest = _createDigest(digest_); + isAttested[digest] = true; emit Attested(digest_.payloadId, watcher); } @@ -197,38 +232,44 @@ contract MessageSwitchboard is SwitchboardBase { socket__.registerSwitchboard(); } + /** + * @dev Function to set switchboard fees for a specific chain (admin only) + * @param chainSlug_ Chain slug for which to set the fee + * @param feeAmount_ Fee amount in wei + */ + function setSwitchboardFees(uint32 chainSlug_, uint256 feeAmount_) external onlyOwner { + switchboardFees[chainSlug_] = feeAmount_; + emit SwitchboardFeesSet(chainSlug_, feeAmount_); + } + + /** + * @dev Function to get switchboard fees for a specific chain + * @param chainSlug_ Chain slug for which to get the fee + * @return feeAmount Fee amount in wei + */ + function getSwitchboardFees(uint32 chainSlug_) external view returns (uint256 feeAmount) { + return switchboardFees[chainSlug_]; + } + /** * @dev Internal function to create digest from parameters */ - function _createDigest( - bytes32 socket_, - address transmitter_, - bytes32 payloadId_, - uint256 deadline_, - bytes4 callType_, - uint256 gasLimit_, - uint256 value_, - bytes32 target_, - bytes32 appGatewayId_, - bytes32 prevDigestHash_, - bytes calldata payload_, - bytes memory extraData_ - ) internal pure returns (bytes32) { + function _createDigest(DigestParams memory digest_) internal pure returns (bytes32) { return keccak256( abi.encodePacked( - socket_, - transmitter_, - payloadId_, - deadline_, - callType_, - gasLimit_, - value_, - payload_, - target_, - appGatewayId_, - prevDigestHash_, - extraData_ + digest_.socket, + digest_.transmitter, + digest_.payloadId, + digest_.deadline, + digest_.callType, + digest_.gasLimit, + digest_.value, + digest_.payload, + digest_.target, + digest_.appGatewayId, + digest_.prevBatchDigestHash, + digest_.extraData ) ); } diff --git a/test/mock/MockFastSwitchboard.sol b/test/mock/MockFastSwitchboard.sol index 284e88ca..3f033f9f 100644 --- a/test/mock/MockFastSwitchboard.sol +++ b/test/mock/MockFastSwitchboard.sol @@ -32,4 +32,11 @@ contract MockFastSwitchboard is ISwitchboard { function registerSwitchboard() external { socket__.registerSwitchboard(); } + + function processTrigger( + address plug_, + bytes32 triggerId_, + bytes calldata payload_, + bytes calldata overrides_ + ) external payable override {} } From 3b3023d39cf7236cd2b1298b692b217e75ccd754 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 18 Jul 2025 13:19:17 +0530 Subject: [PATCH 027/139] fix: contract bugs --- contracts/protocol/base/MessagePlugBase.sol | 11 +++++++++-- .../protocol/switchboard/MessageSwitchboard.sol | 14 ++++++-------- contracts/utils/common/Constants.sol | 3 +++ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/contracts/protocol/base/MessagePlugBase.sol b/contracts/protocol/base/MessagePlugBase.sol index 28432794..db99ba86 100644 --- a/contracts/protocol/base/MessagePlugBase.sol +++ b/contracts/protocol/base/MessagePlugBase.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.21; import {PlugBase} from "./PlugBase.sol"; import {ISwitchboard} from "../interfaces/ISwitchboard.sol"; +import {APP_GATEWAY_ID} from "../../utils/common/Constants.sol"; interface IMessageSwitchboard is ISwitchboard { function registerSibling(uint32 chainSlug_, bytes32 siblingPlug_) external; @@ -13,8 +14,15 @@ interface IMessageSwitchboard is ISwitchboard { /// @dev This contract contains helpers for socket connection, disconnection, and overrides /// Uses constant appGatewayId (0xaaaaa) for all chains abstract contract MessagePlugBase is PlugBase { + address public switchboard; error NotSupported(); + constructor(address socket_, address switchboard_) { + _setSocket(socket_); + switchboard = switchboard_; + socket__.connect(APP_GATEWAY_ID, switchboard); + } + /// @notice Initializes the socket with the new protocol function initSocket(bytes32, address, address) external override socketInitializer { revert("Not Supported"); @@ -25,7 +33,6 @@ abstract contract MessagePlugBase is PlugBase { /// @param siblingPlug_ Address of the sibling plug on the destination chain function registerSibling(uint32 chainSlug_, bytes32 siblingPlug_) public { // Call the switchboard to register the sibling - (, address switchboardAddress) = socket__.getPlugConfig(address(this)); - IMessageSwitchboard(switchboardAddress).registerSibling(chainSlug_, siblingPlug_); + IMessageSwitchboard(switchboard).registerSibling(chainSlug_, siblingPlug_); } } diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol index 09418258..7d62807f 100644 --- a/contracts/protocol/switchboard/MessageSwitchboard.sol +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -6,7 +6,7 @@ import {WATCHER_ROLE} from "../../utils/common/AccessRoles.sol"; import {toBytes32Format} from "../../utils/common/Converters.sol"; import {createPayloadId} from "../../utils/common/IdUtils.sol"; import {DigestParams} from "../../utils/common/Structs.sol"; -import {WRITE} from "../../utils/common/Constants.sol"; +import {WRITE, APP_GATEWAY_ID} from "../../utils/common/Constants.sol"; /** * @title MessageSwitchboard contract @@ -31,10 +31,6 @@ contract MessageSwitchboard is SwitchboardBase { // switchboard fees mapping: chainSlug => fee amount mapping(uint32 => uint256) public switchboardFees; - // Constant appGatewayId used on all chains - bytes32 constant APP_GATEWAY_ID = - 0xdeadbeefcafebabe1234567890abcdef1234567890abcdef1234567890abcdef; - // Error emitted when a payload is already attested by watcher. error AlreadyAttested(); // Error emitted when watcher is not valid @@ -188,7 +184,7 @@ contract MessageSwitchboard is SwitchboardBase { target: siblingPlugs[dstChainSlug_][plug_], appGatewayId: APP_GATEWAY_ID, prevBatchDigestHash: triggerId_, - extraData: abi.encodePacked(chainSlug, toBytes32Format(plug_)) + extraData: abi.encode(chainSlug, toBytes32Format(plug_)) }); digest = _createDigest(digestParams); } @@ -200,10 +196,9 @@ contract MessageSwitchboard is SwitchboardBase { * @notice Enhanced attestation that verifies target with srcChainSlug and srcPlug */ function attest(DigestParams calldata digest_, bytes calldata proof_) public { - if (isAttested[digest_.payloadId]) revert AlreadyAttested(); (uint32 srcChainSlug, bytes32 srcPlug) = abi.decode(digest_.extraData, (uint32, bytes32)); - if (siblingPlugs[srcChainSlug][address(uint160(uint256(srcPlug)))] != digest_.target) { + if (siblingPlugs[srcChainSlug][address(uint160(uint256(digest_.target)))] != srcPlug) { revert InvalidTargetVerification(); } @@ -216,7 +211,10 @@ contract MessageSwitchboard is SwitchboardBase { if (!_hasRole(WATCHER_ROLE, watcher)) revert WatcherNotFound(); bytes32 digest = _createDigest(digest_); + + if (isAttested[digest_.payloadId]) revert AlreadyAttested(); isAttested[digest] = true; + emit Attested(digest_.payloadId, watcher); } diff --git a/contracts/utils/common/Constants.sol b/contracts/utils/common/Constants.sol index 2f98d595..9b1ee6f5 100644 --- a/contracts/utils/common/Constants.sol +++ b/contracts/utils/common/Constants.sol @@ -20,3 +20,6 @@ uint16 constant MAX_COPY_BYTES = 2048; // 2KB uint32 constant CHAIN_SLUG_SOLANA_MAINNET = 10000001; uint32 constant CHAIN_SLUG_SOLANA_DEVNET = 10000002; + +// Constant appGatewayId used on all chains +bytes32 constant APP_GATEWAY_ID = 0xdeadbeefcafebabe1234567890abcdef1234567890abcdef1234567890abcdef; From 46b2630fcf966b1a9f287aa9e88551dea22c5352 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 18 Jul 2025 13:24:28 +0530 Subject: [PATCH 028/139] fix: fees --- contracts/protocol/switchboard/MessageSwitchboard.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol index 7d62807f..699d5542 100644 --- a/contracts/protocol/switchboard/MessageSwitchboard.sol +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -39,8 +39,8 @@ contract MessageSwitchboard is SwitchboardBase { error SiblingNotFound(); // Error emitted when invalid target verification error InvalidTargetVerification(); - // Error emitted when value is not equal to msg.value - error InvalidValue(); + // Error emitted when msg.value is not equal to switchboard fees + value + error InvalidMsgValue(); // Event emitted when watcher attests a payload event Attested(bytes32 payloadId_, address watcher); @@ -125,7 +125,7 @@ contract MessageSwitchboard is SwitchboardBase { (uint32, uint256, uint256) ); - if (value != msg.value) revert InvalidValue(); + if (switchboardFees[dstChainSlug] + value != msg.value) revert InvalidMsgValue(); _validateSibling(dstChainSlug, plug_); (bytes32 digest, bytes32 payloadId) = _createDigestAndPayloadId( From d23365bd9ac5bc2ea7d8ef149b95e7ac335cd849 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 21 Jul 2025 16:04:24 +0530 Subject: [PATCH 029/139] feat: tests --- .../switchboard/MessageSwitchboard.sol | 47 ++--- test/MessageSwitchboardTest.t.sol | 180 ++++++++++++++++++ test/SetupTest.t.sol | 53 ++++-- .../app-gateways/counter/MessageCounter.sol | 31 +++ 4 files changed, 271 insertions(+), 40 deletions(-) create mode 100644 test/MessageSwitchboardTest.t.sol create mode 100644 test/apps/app-gateways/counter/MessageCounter.sol diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol index 699d5542..c35877e7 100644 --- a/contracts/protocol/switchboard/MessageSwitchboard.sol +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -43,20 +43,19 @@ contract MessageSwitchboard is SwitchboardBase { error InvalidMsgValue(); // Event emitted when watcher attests a payload - event Attested(bytes32 payloadId_, address watcher); + event Attested(bytes32 payloadId, bytes32 digest, address watcher); // Event emitted when trigger is processed event TriggerProcessed( - bytes32 payloadId, - bytes32 digest, - bytes32 dstPlug, uint32 dstChainSlug, - bytes payload + uint256 switchboardFees, + bytes32 digest, + DigestParams digestParams ); // Event emitted when sibling is registered event SiblingRegistered(uint32 chainSlug, address plugAddress, bytes32 siblingPlug); // Event emitted when sibling config is set - event SiblingConfigSet(uint32 chainSlug, bytes32 socket, bytes32 switchboard); + event SiblingConfigSet(uint32 chainSlug, uint256 fee, bytes32 socket, bytes32 switchboard); // Event emitted when switchboard fees are set event SwitchboardFeesSet(uint32 chainSlug, uint256 feeAmount); @@ -80,13 +79,15 @@ contract MessageSwitchboard is SwitchboardBase { */ function setSiblingConfig( uint32 chainSlug_, + uint256 fee_, bytes32 socket_, bytes32 switchboard_ ) external onlyOwner { siblingSockets[chainSlug_] = socket_; siblingSwitchboards[chainSlug_] = switchboard_; + switchboardFees[chainSlug_] = fee_; - emit SiblingConfigSet(chainSlug_, socket_, switchboard_); + emit SiblingConfigSet(chainSlug_, fee_, socket_, switchboard_); } /** @@ -124,11 +125,10 @@ contract MessageSwitchboard is SwitchboardBase { overrides_, (uint32, uint256, uint256) ); - - if (switchboardFees[dstChainSlug] + value != msg.value) revert InvalidMsgValue(); _validateSibling(dstChainSlug, plug_); + if (switchboardFees[dstChainSlug] + value < msg.value) revert InvalidMsgValue(); - (bytes32 digest, bytes32 payloadId) = _createDigestAndPayloadId( + (DigestParams memory digestParams, bytes32 digest) = _createDigestAndPayloadId( dstChainSlug, plug_, gasLimit, @@ -137,13 +137,7 @@ contract MessageSwitchboard is SwitchboardBase { payload_ ); - emit TriggerProcessed( - payloadId, - digest, - siblingPlugs[dstChainSlug][plug_], - dstChainSlug, - payload_ - ); + emit TriggerProcessed(dstChainSlug, switchboardFees[dstChainSlug], digest, digestParams); } function _validateSibling(uint32 dstChainSlug_, address plug_) internal view { @@ -163,8 +157,8 @@ contract MessageSwitchboard is SwitchboardBase { uint256 value_, bytes32 triggerId_, bytes calldata payload_ - ) internal returns (bytes32 digest, bytes32 payloadId) { - payloadId = createPayloadId( + ) internal returns (DigestParams memory digestParams, bytes32 digest) { + bytes32 payloadId = createPayloadId( chainSlug, uint40(uint64(uint256(triggerId_))), payloadCounter++, @@ -172,7 +166,7 @@ contract MessageSwitchboard is SwitchboardBase { dstChainSlug_ ); - DigestParams memory digestParams = DigestParams({ + digestParams = DigestParams({ socket: siblingSockets[dstChainSlug_], transmitter: address(0), payloadId: payloadId, @@ -197,25 +191,20 @@ contract MessageSwitchboard is SwitchboardBase { */ function attest(DigestParams calldata digest_, bytes calldata proof_) public { (uint32 srcChainSlug, bytes32 srcPlug) = abi.decode(digest_.extraData, (uint32, bytes32)); - if (siblingPlugs[srcChainSlug][address(uint160(uint256(digest_.target)))] != srcPlug) { revert InvalidTargetVerification(); } - + bytes32 digest = _createDigest(digest_); address watcher = _recoverSigner( - keccak256( - abi.encodePacked(toBytes32Format(address(this)), chainSlug, digest_.payloadId) - ), + keccak256(abi.encodePacked(toBytes32Format(address(this)), chainSlug, digest)), proof_ ); if (!_hasRole(WATCHER_ROLE, watcher)) revert WatcherNotFound(); - bytes32 digest = _createDigest(digest_); - - if (isAttested[digest_.payloadId]) revert AlreadyAttested(); + if (isAttested[digest]) revert AlreadyAttested(); isAttested[digest] = true; - emit Attested(digest_.payloadId, watcher); + emit Attested(digest_.payloadId, digest, watcher); } /** diff --git a/test/MessageSwitchboardTest.t.sol b/test/MessageSwitchboardTest.t.sol new file mode 100644 index 00000000..1673600c --- /dev/null +++ b/test/MessageSwitchboardTest.t.sol @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import "./SetupTest.t.sol"; +import "./apps/app-gateways/counter/MessageCounter.sol"; + +contract MessageSwitchboardTest is DeploySetup { + CounterPlug public arbPlug; + CounterPlug public optPlug; + + // Events we expect to see + event TriggerProcessed( + uint32 optChainSlug, + uint256 switchboardFees, + bytes32 digest, + DigestParams digestParams + ); + + function setUp() public { + _deploy(); + arbPlug = new CounterPlug(address(arbConfig.socket), address(arbConfig.messageSwitchboard)); + optPlug = new CounterPlug(address(optConfig.socket), address(optConfig.messageSwitchboard)); + + arbPlug.registerSibling(optConfig.chainSlug, toBytes32Format(address(optPlug))); + optPlug.registerSibling(arbConfig.chainSlug, toBytes32Format(address(arbPlug))); + } + + function testIncrementWithMessageSwitchboard() public { + bytes32 triggerId = bytes32(arbConfig.triggerPrefix | 0); + + uint40 payloadCounter = arbConfig.messageSwitchboard.payloadCounter(); + bytes32 payloadId = createPayloadId( + arbConfig.chainSlug, + uint40(0), + payloadCounter, + toBytes32Format(address(optConfig.messageSwitchboard)), + optConfig.chainSlug + ); + DigestParams memory digestParams = _createDigestParams( + arbConfig.chainSlug, + payloadId, + triggerId + ); + bytes32 digest = _createDigest(digestParams); + + vm.expectEmit(true, true, true, true); + emit TriggerProcessed(optConfig.chainSlug, msgSbFees, digest, digestParams); + arbPlug.requestIncrement{value: msgSbFees}(optConfig.chainSlug); + + _attestPayload(digestParams); + _executeOnDestination(digestParams, triggerId, payloadCounter); + assertEq(optPlug.count(), 1, "Counter should be incremented on destination"); + } + + function testSwitchboardFees() public { + uint256 feeAmount = 2000000000000000; // 0.002 ETH + + hoax(socketOwner); + arbConfig.messageSwitchboard.setSwitchboardFees(optConfig.chainSlug, feeAmount); + + assertEq( + arbConfig.messageSwitchboard.getSwitchboardFees(optConfig.chainSlug), + feeAmount, + "Fee should be set correctly" + ); + assertEq( + arbConfig.messageSwitchboard.switchboardFees(optConfig.chainSlug), + feeAmount, + "Fee should be accessible via mapping" + ); + } + + function testIncrementWithoutSiblingConfig() public { + vm.expectRevert(abi.encodeWithSelector(MessageSwitchboard.SiblingNotFound.selector)); + arbPlug.requestIncrement{value: msgSbFees}(uint32(999)); + } + + function testAttestWithoutWatcherRole() public { + DigestParams memory digestParams = _createDigestParams( + arbConfig.chainSlug, + bytes32(uint256(1)), + bytes32(arbConfig.triggerPrefix | 0) + ); + + bytes memory signature = createSignature( + _createDigest(digestParams), + transmitterPrivateKey + ); + + vm.expectRevert(abi.encodeWithSelector(MessageSwitchboard.WatcherNotFound.selector)); + optConfig.messageSwitchboard.attest(digestParams, signature); + } + + // Helper function to attest a payload + function _attestPayload(DigestParams memory digestParams_) internal { + bytes32 attestDigest = keccak256( + abi.encodePacked( + toBytes32Format(address(optConfig.messageSwitchboard)), + optConfig.chainSlug, + _createDigest(digestParams_) + ) + ); + + bytes memory signature = createSignature(attestDigest, watcherPrivateKey); + optConfig.messageSwitchboard.attest(digestParams_, signature); + } + + function _createDigestParams( + uint32 chainSlug_, + bytes32 payloadId_, + bytes32 triggerId_ + ) internal view returns (DigestParams memory digestParams) { + bytes memory extraData = abi.encode(chainSlug_, toBytes32Format(address(arbPlug))); + digestParams = DigestParams({ + socket: toBytes32Format(address(optConfig.socket)), + transmitter: address(0), + payloadId: payloadId_, + deadline: block.timestamp + 3600, + callType: WRITE, + gasLimit: uint256(100000), + value: uint256(0), + payload: abi.encodeWithSignature("increment()"), + target: toBytes32Format(address(optPlug)), + appGatewayId: APP_GATEWAY_ID, + prevBatchDigestHash: triggerId_, + extraData: extraData + }); + } + + function _createDigest(DigestParams memory digest_) internal pure returns (bytes32) { + return + keccak256( + abi.encodePacked( + digest_.socket, + digest_.transmitter, + digest_.payloadId, + digest_.deadline, + digest_.callType, + digest_.gasLimit, + digest_.value, + digest_.payload, + digest_.target, + digest_.appGatewayId, + digest_.prevBatchDigestHash, + digest_.extraData + ) + ); + } + + // Helper function to execute on destination chain + function _executeOnDestination( + DigestParams memory digestParams_, + bytes32 triggerId_, + uint256 payloadCount_ + ) internal { + // this is a signature for the socket batcher (only used for EVM) + ExecuteParams memory executeParams = ExecuteParams({ + callType: digestParams_.callType, + deadline: digestParams_.deadline, + gasLimit: digestParams_.gasLimit, + value: digestParams_.value, + payload: digestParams_.payload, + target: fromBytes32Format(digestParams_.target), + requestCount: uint40(arbConfig.chainSlug), + batchCount: uint40(uint64(uint256(triggerId_))), + payloadCount: uint40(payloadCount_), + prevBatchDigestHash: digestParams_.prevBatchDigestHash, + extraData: digestParams_.extraData + }); + + TransmissionParams memory transmissionParams = TransmissionParams({ + socketFees: 0, + refundAddress: socketOwner, + extraData: bytes(""), + transmitterSignature: bytes("") + }); + + optConfig.socket.execute(executeParams, transmissionParams); + } +} diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 32123840..c18da761 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -13,6 +13,7 @@ import "../contracts/evmx/interfaces/IForwarder.sol"; import "../contracts/protocol/Socket.sol"; import "../contracts/protocol/switchboard/FastSwitchboard.sol"; import "../contracts/protocol/switchboard/CCTPSwitchboard.sol"; +import "../contracts/protocol/switchboard/MessageSwitchboard.sol"; import "../contracts/protocol/SocketBatcher.sol"; import "../contracts/protocol/SocketFeeManager.sol"; @@ -65,6 +66,7 @@ contract SetupStore is Test { uint256 scheduleFeesPerSecond = 10000; uint256 triggerFees = 10000; uint256 socketFees = 0; + uint256 msgSbFees = 1000000000000000; // 0.001 ETH uint256 public watcherNonce; uint256 public payloadIdCounter; @@ -74,10 +76,12 @@ contract SetupStore is Test { uint32 public arbCCTPDomain = 3; struct SocketContracts { uint32 chainSlug; + uint256 triggerPrefix; Socket socket; SocketFeeManager socketFeeManager; FastSwitchboard switchboard; CCTPSwitchboard cctpSwitchboard; + MessageSwitchboard messageSwitchboard; CCTPMessageTransmitter cctpMessageTransmitter; SocketBatcher socketBatcher; ContractFactoryPlug contractFactoryPlug; @@ -138,7 +142,21 @@ contract DeploySetup is SetupStore { addressToBytes32(address(arbConfig.cctpSwitchboard)), arbCCTPDomain ); + + arbConfig.messageSwitchboard.setSiblingConfig( + optChainSlug, + msgSbFees, + toBytes32Format(address(optConfig.socket)), + toBytes32Format(address(optConfig.messageSwitchboard)) + ); + optConfig.messageSwitchboard.setSiblingConfig( + arbChainSlug, + msgSbFees, + toBytes32Format(address(arbConfig.socket)), + toBytes32Format(address(arbConfig.messageSwitchboard)) + ); vm.stopPrank(); + // transfer eth to fees pool for native fee payouts vm.deal(address(feesPool), 100000 ether); @@ -234,6 +252,8 @@ contract DeploySetup is SetupStore { return SocketContracts({ chainSlug: chainSlug_, + triggerPrefix: (uint256(chainSlug_) << 224) | + (uint256(uint160(address(socket))) << 64), socket: socket, socketFeeManager: new SocketFeeManager(socketOwner, socketFees), switchboard: new FastSwitchboard(chainSlug_, socket, socketOwner), @@ -243,6 +263,7 @@ contract DeploySetup is SetupStore { socketOwner, address(cctpMessageTransmitter) ), + messageSwitchboard: new MessageSwitchboard(chainSlug_, socket, socketOwner), cctpMessageTransmitter: cctpMessageTransmitter, socketBatcher: new SocketBatcher(socketOwner, socket), contractFactoryPlug: new ContractFactoryPlug(address(socket), socketOwner), @@ -256,6 +277,7 @@ contract DeploySetup is SetupStore { Socket socket = socketConfig.socket; FastSwitchboard switchboard = socketConfig.switchboard; CCTPSwitchboard cctpSwitchboard = socketConfig.cctpSwitchboard; + MessageSwitchboard messageSwitchboard = socketConfig.messageSwitchboard; FeesPlug feesPlug = socketConfig.feesPlug; ContractFactoryPlug contractFactoryPlug = socketConfig.contractFactoryPlug; @@ -273,6 +295,9 @@ contract DeploySetup is SetupStore { cctpSwitchboard.registerSwitchboard(); cctpSwitchboard.grantRole(WATCHER_ROLE, watcherEOA); + messageSwitchboard.registerSwitchboard(); + messageSwitchboard.grantRole(WATCHER_ROLE, watcherEOA); + feesPlug.grantRole(RESCUE_ROLE, address(socketOwner)); feesPlug.whitelistToken(address(socketConfig.testUSDC)); feesPlug.connectSocket( @@ -472,13 +497,13 @@ contract DeploySetup is SetupStore { bytes32 digest = keccak256( abi.encode(address(watcher), evmxSlug, watcherNonce, contractAddress_, data_) ); - return _createSignature(digest, watcherPrivateKey); + return createSignature(digest, watcherPrivateKey); } - function _createSignature( + function createSignature( bytes32 digest_, uint256 privateKey_ - ) internal pure returns (bytes memory sig) { + ) public pure returns (bytes memory sig) { bytes32 digest = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", digest_)); (uint8 sigV, bytes32 sigR, bytes32 sigS) = vm.sign(privateKey_, digest); sig = new bytes(65); @@ -620,7 +645,7 @@ contract FeesSetup is DeploySetup { ); // Sign with consumeFrom's private key - bytes memory signature = _createSignature(digest, userPrivateKey_); + bytes memory signature = createSignature(digest, userPrivateKey_); // Encode approval data bytes memory feeApprovalData = abi.encode(appGateway_, true, block.timestamp, signature); @@ -647,7 +672,7 @@ contract AuctionSetup is FeesSetup { function placeBid(uint40 requestCount) internal { uint256 bidAmount = getBidAmount(requestCount); - bytes memory transmitterSignature = _createSignature( + bytes memory transmitterSignature = createSignature( keccak256(abi.encode(address(auctionManager), evmxSlug, requestCount, bidAmount, "")), transmitterPrivateKey ); @@ -677,7 +702,7 @@ contract AuctionSetup is FeesSetup { // todo: handle other cases uint256 bidAmount = getBidAmount(requestCount_); - // bytes memory watcherSignature = _createSignature( + // bytes memory watcherSignature = createSignature( // keccak256(abi.encode(address(watcher), evmxSlug, requestCount_, bidAmount, "")), // watcherPrivateKey // ); @@ -846,7 +871,7 @@ contract WatcherSetup is AuctionSetup { bytes32 switchboard, uint32 chainSlug ) internal returns (bytes memory proof) { - proof = _createSignature( + proof = createSignature( // create sigDigest which get signed by watcher keccak256(abi.encodePacked(switchboard, chainSlug, digest)), watcherPrivateKey @@ -865,6 +890,7 @@ contract WatcherSetup is AuctionSetup { PayloadParams memory payloadParams ) internal + view returns ( uint32 chainSlug, bytes32 switchboard, @@ -919,7 +945,7 @@ contract WatcherSetup is AuctionSetup { bytes memory watcherProof ) internal returns (bool success, PromiseReturnData memory promiseReturnData) { // this is a signature for the socket batcher (only used for EVM) - bytes memory transmitterSig = _createSignature( + bytes memory transmitterSig = createSignature( keccak256( abi.encode(address(getSocketConfig(chainSlug).socket), payloadParams.payloadId) ), @@ -948,7 +974,9 @@ contract WatcherSetup is AuctionSetup { transmitterSig, transmitterEOA ); - } else if (fromBytes32Format(switchboard) == address(getSocketConfig(chainSlug).cctpSwitchboard)) { + } else if ( + fromBytes32Format(switchboard) == address(getSocketConfig(chainSlug).cctpSwitchboard) + ) { (success, returnData) = _executeWithCCTPBatcher( chainSlug, executeParams, @@ -964,6 +992,7 @@ contract WatcherSetup is AuctionSetup { returnData: returnData }); } + function _executeWithCCTPBatcher( uint32 chainSlug, ExecuteParams memory executeParams, @@ -1141,6 +1170,7 @@ contract WatcherSetup is AuctionSetup { } } } + contract AppGatewayBaseSetup is WatcherSetup { function getOnChainAndForwarderAddresses( uint32 chainSlug_, @@ -1157,7 +1187,7 @@ contract AppGatewayBaseSetup is WatcherSetup { function checkRequestParams( uint40 requestCount, RequestParams memory expectedRequest - ) internal { + ) internal view { RequestParams memory actualRequest = watcher.getRequestParams(requestCount); // RequestParams checks assertEq( @@ -1234,7 +1264,7 @@ contract AppGatewayBaseSetup is WatcherSetup { ); } - function checkPayloadParams(PayloadParams[] memory expectedPayloads) internal { + function checkPayloadParams(PayloadParams[] memory expectedPayloads) internal view { for (uint i = 0; i < expectedPayloads.length; i++) { PayloadParams memory expectedPayload = expectedPayloads[i]; PayloadParams memory actualPayload = watcher.getPayloadParams( @@ -1305,6 +1335,7 @@ contract AppGatewayBaseSetup is WatcherSetup { function addressToBytes32(address addr_) pure returns (bytes32) { return bytes32(uint256(uint160(addr_))); } + function bytes32ToAddress(bytes32 addrBytes32_) pure returns (address) { return address(uint160(uint256(addrBytes32_))); } diff --git a/test/apps/app-gateways/counter/MessageCounter.sol b/test/apps/app-gateways/counter/MessageCounter.sol new file mode 100644 index 00000000..079eab9d --- /dev/null +++ b/test/apps/app-gateways/counter/MessageCounter.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import {MessagePlugBase} from "../../../../contracts/protocol/base/MessagePlugBase.sol"; + +interface ICounterPlug { + function increment() external payable; +} + +// Counter plug that extends MessagePlugBase and includes counter functionality +contract CounterPlug is MessagePlugBase { + uint256 public count; + + event CounterIncremented(uint256 newCount, address caller); + event IncrementRequested(bytes32 triggerId, uint32 dstChainSlug); + event IncrementExecuted(bytes32 triggerId, uint256 newCount); + + constructor(address socket_, address switchboard_) MessagePlugBase(socket_, switchboard_) {} + + /// @notice Increment the counter (local function) + function increment() external { + count++; + emit CounterIncremented(count, msg.sender); + } + + /// @notice Request increment on remote chain + function requestIncrement(uint32 dstChainSlug) external payable { + _setOverrides(abi.encode(dstChainSlug, uint256(100000), uint256(0))); + ICounterPlug(address(socket__)).increment{value: msg.value}(); + } +} From a70db0e6dd07dc3f6a4dbf04ac1794272c88cae7 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 22 Jul 2025 16:01:41 +0530 Subject: [PATCH 030/139] feat: helpers in msg sb --- contracts/protocol/base/MessagePlugBase.sol | 25 +++++++++++++++++++-- contracts/protocol/interfaces/ISocket.sol | 2 ++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/contracts/protocol/base/MessagePlugBase.sol b/contracts/protocol/base/MessagePlugBase.sol index db99ba86..5c0d83f4 100644 --- a/contracts/protocol/base/MessagePlugBase.sol +++ b/contracts/protocol/base/MessagePlugBase.sol @@ -4,9 +4,12 @@ pragma solidity ^0.8.21; import {PlugBase} from "./PlugBase.sol"; import {ISwitchboard} from "../interfaces/ISwitchboard.sol"; import {APP_GATEWAY_ID} from "../../utils/common/Constants.sol"; +import {toBytes32Format} from "../../utils/common/Converters.sol"; interface IMessageSwitchboard is ISwitchboard { function registerSibling(uint32 chainSlug_, bytes32 siblingPlug_) external; + + function getSwitchboardFees(uint32 chainSlug_) external view returns (uint256); } /// @title MessagePlugBase @@ -15,12 +18,17 @@ interface IMessageSwitchboard is ISwitchboard { /// Uses constant appGatewayId (0xaaaaa) for all chains abstract contract MessagePlugBase is PlugBase { address public switchboard; + uint256 public triggerPrefix; error NotSupported(); constructor(address socket_, address switchboard_) { _setSocket(socket_); switchboard = switchboard_; socket__.connect(APP_GATEWAY_ID, switchboard); + + triggerPrefix = + (uint256(socket__.chainSlug()) << 224) | + (uint256(uint160(address(this))) << 64); } /// @notice Initializes the socket with the new protocol @@ -31,8 +39,21 @@ abstract contract MessagePlugBase is PlugBase { /// @notice Registers a sibling plug for a specific chain /// @param chainSlug_ Chain slug of the sibling chain /// @param siblingPlug_ Address of the sibling plug on the destination chain - function registerSibling(uint32 chainSlug_, bytes32 siblingPlug_) public { + function registerSibling(uint32 chainSlug_, address siblingPlug_) public { // Call the switchboard to register the sibling - IMessageSwitchboard(switchboard).registerSibling(chainSlug_, siblingPlug_); + IMessageSwitchboard(switchboard).registerSibling(chainSlug_, toBytes32Format(siblingPlug_)); + } + + function getSocketFees(uint32 chainSlug_) public view returns (uint256) { + return IMessageSwitchboard(switchboard).getSwitchboardFees(chainSlug_); + } + + function getNextTriggerId(uint32 chainSlug_) public view returns (bytes32) { + return + bytes32( + (uint256(chainSlug_) << 224) | + (uint256(uint160(address(socket__))) << 64) | + (uint256(socket__.triggerCounter()) << 16) + ); } } diff --git a/contracts/protocol/interfaces/ISocket.sol b/contracts/protocol/interfaces/ISocket.sol index 3488f636..e7d475df 100644 --- a/contracts/protocol/interfaces/ISocket.sol +++ b/contracts/protocol/interfaces/ISocket.sol @@ -82,4 +82,6 @@ interface ISocket { function chainSlug() external view returns (uint32); function payloadIdToDigest(bytes32 payloadId_) external view returns (bytes32); + + function triggerCounter() external view returns (uint64); } From 4722cbe6e718fd7d27bc5841267c65ac5774f9dc Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 22 Jul 2025 16:01:46 +0530 Subject: [PATCH 031/139] fix: tests --- test/MessageSwitchboardTest.t.sol | 93 +++++++++++++++++++++---------- 1 file changed, 64 insertions(+), 29 deletions(-) diff --git a/test/MessageSwitchboardTest.t.sol b/test/MessageSwitchboardTest.t.sol index 1673600c..f4cb38e5 100644 --- a/test/MessageSwitchboardTest.t.sol +++ b/test/MessageSwitchboardTest.t.sol @@ -21,34 +21,28 @@ contract MessageSwitchboardTest is DeploySetup { arbPlug = new CounterPlug(address(arbConfig.socket), address(arbConfig.messageSwitchboard)); optPlug = new CounterPlug(address(optConfig.socket), address(optConfig.messageSwitchboard)); - arbPlug.registerSibling(optConfig.chainSlug, toBytes32Format(address(optPlug))); - optPlug.registerSibling(arbConfig.chainSlug, toBytes32Format(address(arbPlug))); + arbPlug.registerSibling(optConfig.chainSlug, address(optPlug)); + optPlug.registerSibling(arbConfig.chainSlug, address(arbPlug)); } function testIncrementWithMessageSwitchboard() public { - bytes32 triggerId = bytes32(arbConfig.triggerPrefix | 0); - - uint40 payloadCounter = arbConfig.messageSwitchboard.payloadCounter(); - bytes32 payloadId = createPayloadId( - arbConfig.chainSlug, - uint40(0), - payloadCounter, - toBytes32Format(address(optConfig.messageSwitchboard)), - optConfig.chainSlug + (uint40 payloadCounter, DigestParams memory digestParams) = _getTriggerData( + arbPlug, + optPlug, + arbConfig, + optConfig ); - DigestParams memory digestParams = _createDigestParams( - arbConfig.chainSlug, - payloadId, - triggerId - ); - bytes32 digest = _createDigest(digestParams); vm.expectEmit(true, true, true, true); - emit TriggerProcessed(optConfig.chainSlug, msgSbFees, digest, digestParams); + emit TriggerProcessed( + optConfig.chainSlug, + msgSbFees, + _createDigest(digestParams), + digestParams + ); arbPlug.requestIncrement{value: msgSbFees}(optConfig.chainSlug); - _attestPayload(digestParams); - _executeOnDestination(digestParams, triggerId, payloadCounter); + _executeOnDestination(digestParams, digestParams.prevBatchDigestHash, payloadCounter); assertEq(optPlug.count(), 1, "Counter should be incremented on destination"); } @@ -76,11 +70,13 @@ contract MessageSwitchboardTest is DeploySetup { } function testAttestWithoutWatcherRole() public { - DigestParams memory digestParams = _createDigestParams( - arbConfig.chainSlug, - bytes32(uint256(1)), - bytes32(arbConfig.triggerPrefix | 0) + (uint40 payloadCounter, DigestParams memory digestParams) = _getTriggerData( + arbPlug, + optPlug, + arbConfig, + optConfig ); + bytes32 digest = _createDigest(digestParams); bytes memory signature = createSignature( _createDigest(digestParams), @@ -91,6 +87,42 @@ contract MessageSwitchboardTest is DeploySetup { optConfig.messageSwitchboard.attest(digestParams, signature); } + function _getTriggerData( + MessagePlugBase srcPlug_, + MessagePlugBase dstPlug_, + SocketContracts memory srcSocketConfig_, + SocketContracts memory dstSocketConfig_ + ) internal view returns (uint40 payloadCounter, DigestParams memory digestParams) { + bytes32 triggerId = srcPlug_.getNextTriggerId(srcSocketConfig_.chainSlug); + payloadCounter = srcSocketConfig_.messageSwitchboard.payloadCounter(); + + bytes32 payloadId = createPayloadId( + srcSocketConfig_.chainSlug, + uint40(uint64(uint256(triggerId))), + payloadCounter, + toBytes32Format(address(dstSocketConfig_.messageSwitchboard)), + dstSocketConfig_.chainSlug + ); + + digestParams = _createDigestParams( + srcSocketConfig_.chainSlug, + address(srcPlug_), + address(dstPlug_), + address(dstSocketConfig_.socket), + payloadId, + triggerId + ); + } + + function _executeOnDestination( + DigestParams memory digestParams_, + bytes32 triggerId_, + uint256 payloadCount_ + ) internal { + _attestPayload(digestParams_); + _execute(digestParams_, triggerId_, payloadCount_); + } + // Helper function to attest a payload function _attestPayload(DigestParams memory digestParams_) internal { bytes32 attestDigest = keccak256( @@ -106,13 +138,16 @@ contract MessageSwitchboardTest is DeploySetup { } function _createDigestParams( - uint32 chainSlug_, + uint32 srcChainSlug_, + address srcPlug_, + address dstPlug_, + address dstSocket_, bytes32 payloadId_, bytes32 triggerId_ ) internal view returns (DigestParams memory digestParams) { - bytes memory extraData = abi.encode(chainSlug_, toBytes32Format(address(arbPlug))); + bytes memory extraData = abi.encode(srcChainSlug_, toBytes32Format(srcPlug_)); digestParams = DigestParams({ - socket: toBytes32Format(address(optConfig.socket)), + socket: toBytes32Format(dstSocket_), transmitter: address(0), payloadId: payloadId_, deadline: block.timestamp + 3600, @@ -120,7 +155,7 @@ contract MessageSwitchboardTest is DeploySetup { gasLimit: uint256(100000), value: uint256(0), payload: abi.encodeWithSignature("increment()"), - target: toBytes32Format(address(optPlug)), + target: toBytes32Format(dstPlug_), appGatewayId: APP_GATEWAY_ID, prevBatchDigestHash: triggerId_, extraData: extraData @@ -148,7 +183,7 @@ contract MessageSwitchboardTest is DeploySetup { } // Helper function to execute on destination chain - function _executeOnDestination( + function _execute( DigestParams memory digestParams_, bytes32 triggerId_, uint256 payloadCount_ From 58e9af1de380762ebecfffc801c067c6fa457312 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 23 Jul 2025 11:37:45 +0530 Subject: [PATCH 032/139] test: refactor --- contracts/utils/common/IdUtils.sol | 4 +- test/MessageSwitchboardTest.t.sol | 133 +---------------------------- test/SetupTest.t.sol | 129 ++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+), 132 deletions(-) diff --git a/contracts/utils/common/IdUtils.sol b/contracts/utils/common/IdUtils.sol index 332c582e..572f8d5d 100644 --- a/contracts/utils/common/IdUtils.sol +++ b/contracts/utils/common/IdUtils.sol @@ -1,5 +1,5 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.22; +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; /// @notice Creates a payload ID from the given parameters /// @param requestCount_ The request count diff --git a/test/MessageSwitchboardTest.t.sol b/test/MessageSwitchboardTest.t.sol index f4cb38e5..1251698a 100644 --- a/test/MessageSwitchboardTest.t.sol +++ b/test/MessageSwitchboardTest.t.sol @@ -2,9 +2,9 @@ pragma solidity ^0.8.21; import "./SetupTest.t.sol"; -import "./apps/app-gateways/counter/MessageCounter.sol"; +import {CounterPlug} from "./apps/app-gateways/counter/MessageCounter.sol"; -contract MessageSwitchboardTest is DeploySetup { +contract MessageSwitchboardTest is MessageSwitchboardSetup { CounterPlug public arbPlug; CounterPlug public optPlug; @@ -70,13 +70,12 @@ contract MessageSwitchboardTest is DeploySetup { } function testAttestWithoutWatcherRole() public { - (uint40 payloadCounter, DigestParams memory digestParams) = _getTriggerData( + (, DigestParams memory digestParams) = _getTriggerData( arbPlug, optPlug, arbConfig, optConfig ); - bytes32 digest = _createDigest(digestParams); bytes memory signature = createSignature( _createDigest(digestParams), @@ -86,130 +85,4 @@ contract MessageSwitchboardTest is DeploySetup { vm.expectRevert(abi.encodeWithSelector(MessageSwitchboard.WatcherNotFound.selector)); optConfig.messageSwitchboard.attest(digestParams, signature); } - - function _getTriggerData( - MessagePlugBase srcPlug_, - MessagePlugBase dstPlug_, - SocketContracts memory srcSocketConfig_, - SocketContracts memory dstSocketConfig_ - ) internal view returns (uint40 payloadCounter, DigestParams memory digestParams) { - bytes32 triggerId = srcPlug_.getNextTriggerId(srcSocketConfig_.chainSlug); - payloadCounter = srcSocketConfig_.messageSwitchboard.payloadCounter(); - - bytes32 payloadId = createPayloadId( - srcSocketConfig_.chainSlug, - uint40(uint64(uint256(triggerId))), - payloadCounter, - toBytes32Format(address(dstSocketConfig_.messageSwitchboard)), - dstSocketConfig_.chainSlug - ); - - digestParams = _createDigestParams( - srcSocketConfig_.chainSlug, - address(srcPlug_), - address(dstPlug_), - address(dstSocketConfig_.socket), - payloadId, - triggerId - ); - } - - function _executeOnDestination( - DigestParams memory digestParams_, - bytes32 triggerId_, - uint256 payloadCount_ - ) internal { - _attestPayload(digestParams_); - _execute(digestParams_, triggerId_, payloadCount_); - } - - // Helper function to attest a payload - function _attestPayload(DigestParams memory digestParams_) internal { - bytes32 attestDigest = keccak256( - abi.encodePacked( - toBytes32Format(address(optConfig.messageSwitchboard)), - optConfig.chainSlug, - _createDigest(digestParams_) - ) - ); - - bytes memory signature = createSignature(attestDigest, watcherPrivateKey); - optConfig.messageSwitchboard.attest(digestParams_, signature); - } - - function _createDigestParams( - uint32 srcChainSlug_, - address srcPlug_, - address dstPlug_, - address dstSocket_, - bytes32 payloadId_, - bytes32 triggerId_ - ) internal view returns (DigestParams memory digestParams) { - bytes memory extraData = abi.encode(srcChainSlug_, toBytes32Format(srcPlug_)); - digestParams = DigestParams({ - socket: toBytes32Format(dstSocket_), - transmitter: address(0), - payloadId: payloadId_, - deadline: block.timestamp + 3600, - callType: WRITE, - gasLimit: uint256(100000), - value: uint256(0), - payload: abi.encodeWithSignature("increment()"), - target: toBytes32Format(dstPlug_), - appGatewayId: APP_GATEWAY_ID, - prevBatchDigestHash: triggerId_, - extraData: extraData - }); - } - - function _createDigest(DigestParams memory digest_) internal pure returns (bytes32) { - return - keccak256( - abi.encodePacked( - digest_.socket, - digest_.transmitter, - digest_.payloadId, - digest_.deadline, - digest_.callType, - digest_.gasLimit, - digest_.value, - digest_.payload, - digest_.target, - digest_.appGatewayId, - digest_.prevBatchDigestHash, - digest_.extraData - ) - ); - } - - // Helper function to execute on destination chain - function _execute( - DigestParams memory digestParams_, - bytes32 triggerId_, - uint256 payloadCount_ - ) internal { - // this is a signature for the socket batcher (only used for EVM) - ExecuteParams memory executeParams = ExecuteParams({ - callType: digestParams_.callType, - deadline: digestParams_.deadline, - gasLimit: digestParams_.gasLimit, - value: digestParams_.value, - payload: digestParams_.payload, - target: fromBytes32Format(digestParams_.target), - requestCount: uint40(arbConfig.chainSlug), - batchCount: uint40(uint64(uint256(triggerId_))), - payloadCount: uint40(payloadCount_), - prevBatchDigestHash: digestParams_.prevBatchDigestHash, - extraData: digestParams_.extraData - }); - - TransmissionParams memory transmissionParams = TransmissionParams({ - socketFees: 0, - refundAddress: socketOwner, - extraData: bytes(""), - transmitterSignature: bytes("") - }); - - optConfig.socket.execute(executeParams, transmissionParams); - } } diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index c18da761..f44a1d3d 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -16,6 +16,7 @@ import "../contracts/protocol/switchboard/CCTPSwitchboard.sol"; import "../contracts/protocol/switchboard/MessageSwitchboard.sol"; import "../contracts/protocol/SocketBatcher.sol"; import "../contracts/protocol/SocketFeeManager.sol"; +import "../contracts/protocol/base/MessagePlugBase.sol"; import "../contracts/evmx/watcher/Watcher.sol"; import "../contracts/evmx/watcher/Configurations.sol"; @@ -1332,6 +1333,134 @@ contract AppGatewayBaseSetup is WatcherSetup { } } +contract MessageSwitchboardSetup is DeploySetup { + function _getTriggerData( + MessagePlugBase srcPlug_, + MessagePlugBase dstPlug_, + SocketContracts memory srcSocketConfig_, + SocketContracts memory dstSocketConfig_ + ) internal view returns (uint40 payloadCounter, DigestParams memory digestParams) { + bytes32 triggerId = srcPlug_.getNextTriggerId(srcSocketConfig_.chainSlug); + payloadCounter = srcSocketConfig_.messageSwitchboard.payloadCounter(); + + bytes32 payloadId = createPayloadId( + srcSocketConfig_.chainSlug, + uint40(uint64(uint256(triggerId))), + payloadCounter, + toBytes32Format(address(dstSocketConfig_.messageSwitchboard)), + dstSocketConfig_.chainSlug + ); + + digestParams = _createDigestParams( + srcSocketConfig_.chainSlug, + address(srcPlug_), + address(dstPlug_), + address(dstSocketConfig_.socket), + payloadId, + triggerId + ); + } + + function _executeOnDestination( + DigestParams memory digestParams_, + bytes32 triggerId_, + uint256 payloadCount_ + ) internal { + _attestPayload(digestParams_); + _execute(digestParams_, triggerId_, payloadCount_); + } + + // Helper function to attest a payload + function _attestPayload(DigestParams memory digestParams_) internal { + bytes32 attestDigest = keccak256( + abi.encodePacked( + toBytes32Format(address(optConfig.messageSwitchboard)), + optConfig.chainSlug, + _createDigest(digestParams_) + ) + ); + + bytes memory signature = createSignature(attestDigest, watcherPrivateKey); + optConfig.messageSwitchboard.attest(digestParams_, signature); + } + + function _createDigestParams( + uint32 srcChainSlug_, + address srcPlug_, + address dstPlug_, + address dstSocket_, + bytes32 payloadId_, + bytes32 triggerId_ + ) internal view returns (DigestParams memory digestParams) { + bytes memory extraData = abi.encode(srcChainSlug_, toBytes32Format(srcPlug_)); + digestParams = DigestParams({ + socket: toBytes32Format(dstSocket_), + transmitter: address(0), + payloadId: payloadId_, + deadline: block.timestamp + 3600, + callType: WRITE, + gasLimit: uint256(100000), + value: uint256(0), + payload: abi.encodeWithSignature("increment()"), + target: toBytes32Format(dstPlug_), + appGatewayId: APP_GATEWAY_ID, + prevBatchDigestHash: triggerId_, + extraData: extraData + }); + } + + function _createDigest(DigestParams memory digest_) internal pure returns (bytes32) { + return + keccak256( + abi.encodePacked( + digest_.socket, + digest_.transmitter, + digest_.payloadId, + digest_.deadline, + digest_.callType, + digest_.gasLimit, + digest_.value, + digest_.payload, + digest_.target, + digest_.appGatewayId, + digest_.prevBatchDigestHash, + digest_.extraData + ) + ); + } + + // Helper function to execute on destination chain + function _execute( + DigestParams memory digestParams_, + bytes32 triggerId_, + uint256 payloadCount_ + ) internal { + // this is a signature for the socket batcher (only used for EVM) + ExecuteParams memory executeParams = ExecuteParams({ + callType: digestParams_.callType, + deadline: digestParams_.deadline, + gasLimit: digestParams_.gasLimit, + value: digestParams_.value, + payload: digestParams_.payload, + target: fromBytes32Format(digestParams_.target), + requestCount: uint40(arbConfig.chainSlug), + batchCount: uint40(uint64(uint256(triggerId_))), + payloadCount: uint40(payloadCount_), + prevBatchDigestHash: digestParams_.prevBatchDigestHash, + extraData: digestParams_.extraData + }); + + TransmissionParams memory transmissionParams = TransmissionParams({ + socketFees: 0, + refundAddress: socketOwner, + extraData: bytes(""), + transmitterSignature: bytes("") + }); + + optConfig.socket.execute(executeParams, transmissionParams); + } +} + function addressToBytes32(address addr_) pure returns (bytes32) { return bytes32(uint256(uint160(addr_))); } From 6d70b742c066e3fa67c475af040032939bf7a2e4 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 23 Jul 2025 12:06:14 +0530 Subject: [PATCH 033/139] fix: dynamic payload --- test/MessageSwitchboardTest.t.sol | 14 ++++---------- test/SetupTest.t.sol | 24 ++++++++++++++++++------ 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/test/MessageSwitchboardTest.t.sol b/test/MessageSwitchboardTest.t.sol index 1251698a..8b2eb373 100644 --- a/test/MessageSwitchboardTest.t.sol +++ b/test/MessageSwitchboardTest.t.sol @@ -8,14 +8,6 @@ contract MessageSwitchboardTest is MessageSwitchboardSetup { CounterPlug public arbPlug; CounterPlug public optPlug; - // Events we expect to see - event TriggerProcessed( - uint32 optChainSlug, - uint256 switchboardFees, - bytes32 digest, - DigestParams digestParams - ); - function setUp() public { _deploy(); arbPlug = new CounterPlug(address(arbConfig.socket), address(arbConfig.messageSwitchboard)); @@ -30,7 +22,8 @@ contract MessageSwitchboardTest is MessageSwitchboardSetup { arbPlug, optPlug, arbConfig, - optConfig + optConfig, + abi.encodeWithSignature("increment()") ); vm.expectEmit(true, true, true, true); @@ -74,7 +67,8 @@ contract MessageSwitchboardTest is MessageSwitchboardSetup { arbPlug, optPlug, arbConfig, - optConfig + optConfig, + abi.encodeWithSignature("increment()") ); bytes memory signature = createSignature( diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index f44a1d3d..4b8a9eef 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -494,7 +494,7 @@ contract DeploySetup is SetupStore { function _createWatcherSignature( address contractAddress_, bytes memory data_ - ) internal returns (bytes memory) { + ) internal view returns (bytes memory) { bytes32 digest = keccak256( abi.encode(address(watcher), evmxSlug, watcherNonce, contractAddress_, data_) ); @@ -1334,11 +1334,21 @@ contract AppGatewayBaseSetup is WatcherSetup { } contract MessageSwitchboardSetup is DeploySetup { + uint256 msgSbGasLimit = 100000; + + event TriggerProcessed( + uint32 optChainSlug, + uint256 switchboardFees, + bytes32 digest, + DigestParams digestParams + ); + function _getTriggerData( MessagePlugBase srcPlug_, MessagePlugBase dstPlug_, SocketContracts memory srcSocketConfig_, - SocketContracts memory dstSocketConfig_ + SocketContracts memory dstSocketConfig_, + bytes memory payload_ ) internal view returns (uint40 payloadCounter, DigestParams memory digestParams) { bytes32 triggerId = srcPlug_.getNextTriggerId(srcSocketConfig_.chainSlug); payloadCounter = srcSocketConfig_.messageSwitchboard.payloadCounter(); @@ -1357,7 +1367,8 @@ contract MessageSwitchboardSetup is DeploySetup { address(dstPlug_), address(dstSocketConfig_.socket), payloadId, - triggerId + triggerId, + payload_ ); } @@ -1390,7 +1401,8 @@ contract MessageSwitchboardSetup is DeploySetup { address dstPlug_, address dstSocket_, bytes32 payloadId_, - bytes32 triggerId_ + bytes32 triggerId_, + bytes memory payload_ ) internal view returns (DigestParams memory digestParams) { bytes memory extraData = abi.encode(srcChainSlug_, toBytes32Format(srcPlug_)); digestParams = DigestParams({ @@ -1399,9 +1411,9 @@ contract MessageSwitchboardSetup is DeploySetup { payloadId: payloadId_, deadline: block.timestamp + 3600, callType: WRITE, - gasLimit: uint256(100000), + gasLimit: msgSbGasLimit, value: uint256(0), - payload: abi.encodeWithSignature("increment()"), + payload: payload_, target: toBytes32Format(dstPlug_), appGatewayId: APP_GATEWAY_ID, prevBatchDigestHash: triggerId_, From b589ba0e5d36ffe359401015635c422921ec7b31 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 23 Jul 2025 13:55:16 +0530 Subject: [PATCH 034/139] fix: check if sb is valid --- contracts/protocol/Socket.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index 553c51f7..3a9ded70 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -185,6 +185,8 @@ contract Socket is SocketUtils { // if no sibling plug is found for the given chain slug, revert if (plugConfig.appGatewayId == bytes32(0)) revert PlugNotFound(); + if (isValidSwitchboard[plugConfig.switchboard] != SwitchboardStatus.REGISTERED) + revert InvalidSwitchboard(); bytes memory plugOverrides = IPlug(msg.sender).overrides(); triggerId = _encodeTriggerId(); From b1531816630434d422e3411fd1d0180e67eb3321 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 24 Jul 2025 13:13:03 +0530 Subject: [PATCH 035/139] feat: merge counts to uint160 --- contracts/evmx/watcher/PromiseResolver.sol | 4 ++-- .../watcher/precompiles/WritePrecompile.sol | 5 +++-- .../switchboard/MessageSwitchboard.sol | 16 +++++--------- contracts/utils/common/IdUtils.sol | 22 +++++++++---------- contracts/utils/common/Structs.sol | 8 ++----- 5 files changed, 22 insertions(+), 33 deletions(-) diff --git a/contracts/evmx/watcher/PromiseResolver.sol b/contracts/evmx/watcher/PromiseResolver.sol index d226492c..82367c13 100644 --- a/contracts/evmx/watcher/PromiseResolver.sol +++ b/contracts/evmx/watcher/PromiseResolver.sol @@ -54,7 +54,7 @@ contract PromiseResolver is IPromiseResolver, WatcherBase { if (payloadParams.deadline < block.timestamp) revert DeadlinePassed(); address asyncPromise = payloadParams.asyncPromise; - requestCount = payloadParams.requestCount; + requestCount = uint40(payloadParams.payloadPointer >> 120); if (asyncPromise != address(0)) { success = IPromise(asyncPromise).markResolved(resolvedPromise_); @@ -85,7 +85,7 @@ contract PromiseResolver is IPromiseResolver, WatcherBase { if (payloadParams.deadline > block.timestamp) revert DeadlineNotPassedForOnChainRevert(); // marks the request as cancelled and settles the fees - requestHandler__().cancelRequestForReverts(payloadParams.requestCount); + requestHandler__().cancelRequestForReverts(uint40(payloadParams.payloadPointer >> 120)); // marks the promise as onchain reverting if the request is reverting onchain if (isRevertingOnchain_ && payloadParams.asyncPromise != address(0)) diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index 6bc8192b..30bfeadb 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -170,9 +170,10 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc deadline = block.timestamp + expiryTime; fees = getPrecompileFees(payloadParams.precompileData); + // todo: fix batch count bytes32 prevBatchDigestHash = getPrevBatchDigestHash( - payloadParams.requestCount, - payloadParams.batchCount + uint40(payloadParams.payloadPointer >> 120), + uint40(payloadParams.payloadPointer >> 80) ); // create digest diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol index c35877e7..872b7a57 100644 --- a/contracts/protocol/switchboard/MessageSwitchboard.sol +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -158,13 +158,11 @@ contract MessageSwitchboard is SwitchboardBase { bytes32 triggerId_, bytes calldata payload_ ) internal returns (DigestParams memory digestParams, bytes32 digest) { - bytes32 payloadId = createPayloadId( - chainSlug, - uint40(uint64(uint256(triggerId_))), - payloadCounter++, - siblingSwitchboards[dstChainSlug_], - dstChainSlug_ - ); + uint128 payloadPointer = (uint128(chainSlug) << 120) | + (uint128(uint64(uint256(triggerId_))) << 80) | + payloadCounter++; + + bytes32 payloadId = createPayloadId(payloadPointer, switchboardId, chainSlug); digestParams = DigestParams({ socket: siblingSockets[dstChainSlug_], @@ -215,10 +213,6 @@ contract MessageSwitchboard is SwitchboardBase { return isAttested[digest_]; } - function registerSwitchboard() external onlyOwner { - socket__.registerSwitchboard(); - } - /** * @dev Function to set switchboard fees for a specific chain (admin only) * @param chainSlug_ Chain slug for which to set the fee diff --git a/contracts/utils/common/IdUtils.sol b/contracts/utils/common/IdUtils.sol index 572f8d5d..8482df03 100644 --- a/contracts/utils/common/IdUtils.sol +++ b/contracts/utils/common/IdUtils.sol @@ -2,21 +2,19 @@ pragma solidity ^0.8.21; /// @notice Creates a payload ID from the given parameters -/// @param requestCount_ The request count -/// @param batchCount_ The batch count -/// @param payloadCount_ The payload count -/// @param switchboard_ The switchboard address +/// @param payloadPointer_ The payload pointer +/// @param switchboardId_ The switchboard id /// @param chainSlug_ The chain slug /// @return The created payload ID function createPayloadId( - uint40 requestCount_, - uint40 batchCount_, - uint40 payloadCount_, - bytes32 switchboard_, + uint160 payloadPointer_, + uint64 switchboardId_, uint32 chainSlug_ ) pure returns (bytes32) { - uint256 payloadCounter = (uint256(requestCount_) << 40) | - (uint256(batchCount_) << 24) | - uint256(payloadCount_); - return keccak256(abi.encodePacked(payloadCounter, chainSlug_, switchboard_)); + return + bytes32( + (uint256(chainSlug_) << 224) | + (uint256(switchboardId_) << 160) | + uint256(payloadPointer_) + ); } diff --git a/contracts/utils/common/Structs.sol b/contracts/utils/common/Structs.sol index d1a8a2ca..5014e339 100644 --- a/contracts/utils/common/Structs.sol +++ b/contracts/utils/common/Structs.sol @@ -89,9 +89,7 @@ struct PromiseReturnData { // AM struct ExecuteParams { bytes4 callType; - uint40 requestCount; - uint40 batchCount; - uint40 payloadCount; + uint128 payloadPointer; uint256 deadline; uint256 gasLimit; uint256 value; @@ -174,10 +172,8 @@ struct QueueParams { } struct PayloadParams { - uint40 requestCount; - uint40 batchCount; - uint40 payloadCount; bytes4 callType; + uint128 payloadPointer; address asyncPromise; address appGateway; bytes32 payloadId; From 4ac2caead8dc3d8bb84941fe44d11d245076a263 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 24 Jul 2025 13:13:23 +0530 Subject: [PATCH 036/139] fix: assign uint64 sb id --- contracts/evmx/interfaces/IConfigurations.sol | 6 +- .../evmx/interfaces/IContractFactoryPlug.sol | 2 +- contracts/evmx/plugs/ContractFactoryPlug.sol | 10 +-- contracts/evmx/plugs/FeesPlug.sol | 4 +- contracts/evmx/watcher/Configurations.sol | 26 ++++---- contracts/evmx/watcher/RequestHandler.sol | 20 +++--- contracts/protocol/Socket.sol | 21 +++---- contracts/protocol/SocketBatcher.sol | 7 +-- contracts/protocol/SocketConfig.sol | 62 +++++++++++-------- contracts/protocol/base/MessagePlugBase.sol | 14 ++--- contracts/protocol/base/PlugBase.sol | 14 ++--- contracts/protocol/interfaces/IPlug.sol | 4 +- contracts/protocol/interfaces/ISocket.sol | 18 +++--- .../protocol/switchboard/FastSwitchboard.sol | 4 -- .../protocol/switchboard/SwitchboardBase.sol | 6 ++ contracts/utils/common/Structs.sol | 8 +-- 16 files changed, 115 insertions(+), 111 deletions(-) diff --git a/contracts/evmx/interfaces/IConfigurations.sol b/contracts/evmx/interfaces/IConfigurations.sol index 9d095679..227a18f3 100644 --- a/contracts/evmx/interfaces/IConfigurations.sol +++ b/contracts/evmx/interfaces/IConfigurations.sol @@ -26,7 +26,7 @@ interface IConfigurations { function getPlugConfigs( uint32 chainSlug_, bytes32 plug_ - ) external view returns (bytes32, bytes32); + ) external view returns (bytes32, uint64); /// @notice Maps chain slug to their associated socket /// @param chainSlug_ The chain slug @@ -36,10 +36,10 @@ interface IConfigurations { /// @notice Returns the socket for a given chain slug /// @param chainSlug_ The chain slug /// @return The socket - function switchboards(uint32 chainSlug_, bytes32 sbType_) external view returns (bytes32); + function switchboards(uint32 chainSlug_, bytes32 sbType_) external view returns (uint64); /// @notice Sets the switchboard for a network - function setSwitchboard(uint32 chainSlug_, bytes32 sbType_, bytes32 switchboard_) external; + function setSwitchboard(uint32 chainSlug_, bytes32 sbType_, uint64 switchboardId_) external; /// @notice Sets valid plugs for each chain slug /// @dev This function is used to verify if a plug deployed on a chain slug is valid connection to the app gateway diff --git a/contracts/evmx/interfaces/IContractFactoryPlug.sol b/contracts/evmx/interfaces/IContractFactoryPlug.sol index 4fa5f0fe..9688be0a 100644 --- a/contracts/evmx/interfaces/IContractFactoryPlug.sol +++ b/contracts/evmx/interfaces/IContractFactoryPlug.sol @@ -15,7 +15,7 @@ interface IContractFactoryPlug { IsPlug isPlug_, bytes32 salt_, bytes32 appGatewayId_, - address switchboard_, + uint64 switchboardId_, bytes memory creationCode_, bytes memory initCallData_ ) external returns (address); diff --git a/contracts/evmx/plugs/ContractFactoryPlug.sol b/contracts/evmx/plugs/ContractFactoryPlug.sol index a83e098e..f92f1bd4 100644 --- a/contracts/evmx/plugs/ContractFactoryPlug.sol +++ b/contracts/evmx/plugs/ContractFactoryPlug.sol @@ -35,7 +35,7 @@ contract ContractFactoryPlug is PlugBase, AccessControl, IContractFactoryPlug { /// @param isPlug_ Whether the contract to be deployed is a plug /// @param salt_ The salt used for create 2 /// @param appGatewayId_ The app gateway id - /// @param switchboard_ The switchboard address + /// @param switchboardId_ The switchboard id /// @param creationCode_ The creation code /// @param initCallData_ The init call data /// @return addr The address of the deployed contract @@ -43,7 +43,7 @@ contract ContractFactoryPlug is PlugBase, AccessControl, IContractFactoryPlug { IsPlug isPlug_, bytes32 salt_, bytes32 appGatewayId_, - address switchboard_, + uint64 switchboardId_, bytes memory creationCode_, bytes memory initCallData_ ) public override onlySocket returns (address addr) { @@ -55,7 +55,7 @@ contract ContractFactoryPlug is PlugBase, AccessControl, IContractFactoryPlug { } } - if (isPlug_ == IsPlug.YES) IPlug(addr).initSocket(appGatewayId_, msg.sender, switchboard_); + if (isPlug_ == IsPlug.YES) IPlug(addr).initSocket(appGatewayId_, msg.sender, switchboardId_); bytes memory returnData; if (initCallData_.length > 0) { @@ -89,9 +89,9 @@ contract ContractFactoryPlug is PlugBase, AccessControl, IContractFactoryPlug { function connectSocket( bytes32 appGatewayId_, address socket_, - address switchboard_ + uint64 switchboardId_ ) external onlyOwner { - _connectSocket(appGatewayId_, socket_, switchboard_); + _connectSocket(appGatewayId_, socket_, switchboardId_); } /** diff --git a/contracts/evmx/plugs/FeesPlug.sol b/contracts/evmx/plugs/FeesPlug.sol index 3e035125..5c9f6124 100644 --- a/contracts/evmx/plugs/FeesPlug.sol +++ b/contracts/evmx/plugs/FeesPlug.sol @@ -119,9 +119,9 @@ contract FeesPlug is IFeesPlug, PlugBase, AccessControl { function connectSocket( bytes32 appGatewayId_, address socket_, - address switchboard_ + uint64 switchboardId_ ) external onlyOwner { - _connectSocket(appGatewayId_, socket_, switchboard_); + _connectSocket(appGatewayId_, socket_, switchboardId_); } /** diff --git a/contracts/evmx/watcher/Configurations.sol b/contracts/evmx/watcher/Configurations.sol index dc0b3694..16af40c8 100644 --- a/contracts/evmx/watcher/Configurations.sol +++ b/contracts/evmx/watcher/Configurations.sol @@ -21,8 +21,8 @@ abstract contract ConfigurationsStorage is IConfigurations { // slot 51 /// @notice Maps chain slug to their associated switchboard - /// @dev chainSlug => sb type => switchboard address - mapping(uint32 => mapping(bytes32 => bytes32)) public switchboards; + /// @dev chainSlug => sb type => switchboard id + mapping(uint32 => mapping(bytes32 => uint64)) public switchboards; // slot 52 /// @notice Maps chain slug to their associated socket @@ -53,8 +53,8 @@ contract Configurations is ConfigurationsStorage, Initializable, Ownable, Watche /// @notice Emitted when a switchboard is set for a network /// @param chainSlug The identifier of the network /// @param sbType The type of switchboard - /// @param switchboard The address of the switchboard - event SwitchboardSet(uint32 chainSlug, bytes32 sbType, bytes32 switchboard); + /// @param switchboardId The id of the switchboard + event SwitchboardSet(uint32 chainSlug, bytes32 sbType, uint64 switchboardId); /// @notice Emitted when socket is set for a network /// @param chainSlug The identifier of the network @@ -105,14 +105,14 @@ contract Configurations is ConfigurationsStorage, Initializable, Ownable, Watche /// @notice Sets the switchboard for a network /// @param chainSlug_ The identifier of the network /// @param sbType_ The type of switchboard, hash of a string - /// @param switchboard_ The address of the switchboard + /// @param switchboardId_ The id of the switchboard function setSwitchboard( uint32 chainSlug_, bytes32 sbType_, - bytes32 switchboard_ + uint64 switchboardId_ ) external onlyOwner { - switchboards[chainSlug_][sbType_] = switchboard_; - emit SwitchboardSet(chainSlug_, sbType_, switchboard_); + switchboards[chainSlug_][sbType_] = switchboardId_; + emit SwitchboardSet(chainSlug_, sbType_, switchboardId_); } /// @notice Sets the valid plugs for an app gateway @@ -135,15 +135,15 @@ contract Configurations is ConfigurationsStorage, Initializable, Ownable, Watche /// @dev Returns zero addresses if configuration doesn't exist /// @param chainSlug_ The identifier of the network /// @param plug_ The address of the plug - /// @return The app gateway id and switchboard address for the plug + /// @return The app gateway id and switchboard id for the plug /// @dev Returns zero addresses if configuration doesn't exist function getPlugConfigs( uint32 chainSlug_, bytes32 plug_ - ) public view returns (bytes32, bytes32) { + ) public view returns (bytes32, uint64) { return ( _plugConfigs[chainSlug_][plug_].appGatewayId, - _plugConfigs[chainSlug_][plug_].switchboard + _plugConfigs[chainSlug_][plug_].switchboardId ); } @@ -159,9 +159,9 @@ contract Configurations is ConfigurationsStorage, Initializable, Ownable, Watche address appGateway_, bytes32 switchboardType_ ) external view { - (bytes32 appGatewayId, bytes32 switchboard) = getPlugConfigs(chainSlug_, target_); + (bytes32 appGatewayId, uint64 switchboardId) = getPlugConfigs(chainSlug_, target_); if (appGatewayId != toBytes32Format(appGateway_)) revert InvalidGateway(); - if (switchboard != switchboards[chainSlug_][switchboardType_]) revert InvalidSwitchboard(); + if (switchboardId != switchboards[chainSlug_][switchboardType_]) revert InvalidSwitchboard(); } /** diff --git a/contracts/evmx/watcher/RequestHandler.sol b/contracts/evmx/watcher/RequestHandler.sol index ad1a6b71..d1f2c351 100644 --- a/contracts/evmx/watcher/RequestHandler.sol +++ b/contracts/evmx/watcher/RequestHandler.sol @@ -227,9 +227,7 @@ contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, Addres _requestBatchIds[requestCount_].push(nextBatchCount); } - // get the switchboard address from the configurations - // returns bytes32(0) for schedule precompile and reads if sb type not set - bytes32 switchboard = watcher__().configurations__().switchboards( + uint64 switchboardId = watcher__().configurations__().switchboards( queuePayloadParam.transaction.chainSlug, queuePayloadParam.switchboardType ); @@ -243,22 +241,20 @@ contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, Addres result.totalEstimatedWatcherFees += estimatedFees; // create payload id - uint40 payloadCount = payloadCounter++; + uint128 payloadPointer = (uint128(requestCount_) << 120) | + (uint128(nextBatchCount) << 80) | + uint128(payloadCounter++); + bytes32 payloadId = createPayloadId( - requestCount_, - nextBatchCount, - payloadCount, - switchboard, - // todo: add evmx chain slug if schedule or read? + payloadPointer, + switchboardId, queuePayloadParam.transaction.chainSlug ); _batchPayloadIds[nextBatchCount].push(payloadId); // create prev digest hash PayloadParams memory p; - p.requestCount = requestCount_; - p.batchCount = nextBatchCount; - p.payloadCount = payloadCount; + p.payloadPointer = payloadPointer; p.callType = callType; p.asyncPromise = queueParams_[i].asyncPromise; p.appGateway = appGateway_; diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index 3a9ded70..6a942ae3 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -76,16 +76,13 @@ contract Socket is SocketUtils { revert InsufficientMsgValue(); bytes32 payloadId = createPayloadId( - executeParams_.requestCount, - executeParams_.batchCount, - executeParams_.payloadCount, - toBytes32Format(plugConfig.switchboard), + executeParams_.payloadPointer, + plugConfig.switchboardId, chainSlug ); // validate the execution status _validateExecutionStatus(payloadId); - address transmitter = transmissionParams_.transmitterSignature.length > 0 ? _recoverSigner( keccak256(abi.encode(address(this), payloadId)), @@ -104,7 +101,7 @@ contract Socket is SocketUtils { payloadIdToDigest[payloadId] = digest; // verify the digest - _verify(digest, payloadId, plugConfig.switchboard); + _verify(digest, payloadId, plugConfig.switchboardId); return _execute(payloadId, executeParams_, transmissionParams_); } @@ -112,12 +109,12 @@ contract Socket is SocketUtils { //////////////////////////////////////////////////////// ////////////////// INTERNAL FUNCS ////////////////////// //////////////////////////////////////////////////////// - function _verify(bytes32 digest_, bytes32 payloadId_, address switchboard_) internal view { - if (isValidSwitchboard[switchboard_] != SwitchboardStatus.REGISTERED) + function _verify(bytes32 digest_, bytes32 payloadId_, uint64 switchboardId_) internal view { + if (isValidSwitchboard[switchboardId_] != SwitchboardStatus.REGISTERED) revert InvalidSwitchboard(); // NOTE: is the the first un-trusted call in the system, another one is Plug.call - if (!ISwitchboard(switchboard_).allowPayload(digest_, payloadId_)) + if (!ISwitchboard(switchboardAddresses[switchboardId_]).allowPayload(digest_, payloadId_)) revert VerificationFailed(); } @@ -185,14 +182,14 @@ contract Socket is SocketUtils { // if no sibling plug is found for the given chain slug, revert if (plugConfig.appGatewayId == bytes32(0)) revert PlugNotFound(); - if (isValidSwitchboard[plugConfig.switchboard] != SwitchboardStatus.REGISTERED) + if (isValidSwitchboard[plugConfig.switchboardId] != SwitchboardStatus.REGISTERED) revert InvalidSwitchboard(); bytes memory plugOverrides = IPlug(msg.sender).overrides(); triggerId = _encodeTriggerId(); // todo: need gas limit? - ISwitchboard(plugConfig.switchboard).processTrigger{value: msg.value}( + ISwitchboard(switchboardAddresses[plugConfig.switchboardId]).processTrigger{value: msg.value}( msg.sender, triggerId, msg.data, @@ -202,7 +199,7 @@ contract Socket is SocketUtils { emit AppGatewayCallRequested( triggerId, plugConfig.appGatewayId, - toBytes32Format(plugConfig.switchboard), + plugConfig.switchboardId, toBytes32Format(plug_), plugOverrides, msg.data diff --git a/contracts/protocol/SocketBatcher.sol b/contracts/protocol/SocketBatcher.sol index 19a3db8b..ecaecee8 100644 --- a/contracts/protocol/SocketBatcher.sol +++ b/contracts/protocol/SocketBatcher.sol @@ -64,13 +64,12 @@ contract SocketBatcher is ISocketBatcher, Ownable { function attestCCTPAndProveAndExecute( CCTPExecutionParams calldata execParams_, CCTPBatchParams calldata cctpParams_, + uint64 switchboardId_, address switchboard_ ) external payable returns (bool, bytes memory) { bytes32 payloadId = createPayloadId( - execParams_.executeParams.requestCount, - execParams_.executeParams.batchCount, - execParams_.executeParams.payloadCount, - bytes32(uint256(uint160(address(switchboard_)))), + execParams_.executeParams.payloadPointer, + switchboardId_, socket__.chainSlug() ); ICCTPSwitchboard(switchboard_).attestVerifyAndProveExecutions( diff --git a/contracts/protocol/SocketConfig.sol b/contracts/protocol/SocketConfig.sol index 32bafb17..d5fc01d9 100644 --- a/contracts/protocol/SocketConfig.sol +++ b/contracts/protocol/SocketConfig.sol @@ -22,7 +22,7 @@ abstract contract SocketConfig is ISocket, AccessControl { ISocketFeeManager public socketFeeManager; // @notice mapping of switchboard address to its status, helps socket to block invalid switchboards - mapping(address => SwitchboardStatus) public isValidSwitchboard; + mapping(uint64 => SwitchboardStatus) public isValidSwitchboard; // @notice mapping of plug address to its config mapping(address => PlugConfigEvm) internal _plugConfigs; @@ -30,41 +30,54 @@ abstract contract SocketConfig is ISocket, AccessControl { // @notice max copy bytes for socket uint16 public maxCopyBytes = 2048; // 2KB + // @notice counter for switchboard ids + uint64 public switchboardIdCounter = 1; + + // @notice mapping of switchboard id to its address + mapping(uint64 => address) public switchboardAddresses; + + // @notice mapping of switchboard address to its id + mapping(address => uint64) public switchboardIds; + // @notice error triggered when a switchboard already exists error SwitchboardExists(); - // @notice error triggered when a switchboard already exists or is disabled - error SwitchboardExistsOrDisabled(); // @notice event triggered when a new switchboard is added - event SwitchboardAdded(address switchboard); + event SwitchboardAdded(address switchboard, uint64 switchboardId); // @notice event triggered when a switchboard is disabled - event SwitchboardDisabled(address switchboard); + event SwitchboardDisabled(uint64 switchboardId); // @notice event triggered when a switchboard is enabled - event SwitchboardEnabled(address switchboard); + event SwitchboardEnabled(uint64 switchboardId); event SocketFeeManagerUpdated(address oldSocketFeeManager, address newSocketFeeManager); // @notice function to register a switchboard // @dev only callable by switchboards - function registerSwitchboard() external { - if (isValidSwitchboard[msg.sender] != SwitchboardStatus.NOT_REGISTERED) - revert SwitchboardExistsOrDisabled(); + function registerSwitchboard() external returns (uint64 switchboardId) { + switchboardId = switchboardIds[msg.sender]; + if (switchboardId != 0) revert SwitchboardExists(); - isValidSwitchboard[msg.sender] = SwitchboardStatus.REGISTERED; - emit SwitchboardAdded(msg.sender); + switchboardId = switchboardIdCounter++; + switchboardIds[msg.sender] = switchboardId; + switchboardAddresses[switchboardId] = msg.sender; + isValidSwitchboard[switchboardId] = SwitchboardStatus.REGISTERED; + + emit SwitchboardAdded(msg.sender, switchboardId); } // @notice function to disable a switchboard // @dev only callable by governance role - function disableSwitchboard(address switchboard_) external onlyRole(SWITCHBOARD_DISABLER_ROLE) { - isValidSwitchboard[switchboard_] = SwitchboardStatus.DISABLED; - emit SwitchboardDisabled(switchboard_); + function disableSwitchboard( + uint64 switchboardId_ + ) external onlyRole(SWITCHBOARD_DISABLER_ROLE) { + isValidSwitchboard[switchboardId_] = SwitchboardStatus.DISABLED; + emit SwitchboardDisabled(switchboardId_); } // @notice function to enable a switchboard // @dev only callable by governance role - function enableSwitchboard() external onlyRole(GOVERNANCE_ROLE) { - isValidSwitchboard[msg.sender] = SwitchboardStatus.REGISTERED; - emit SwitchboardEnabled(msg.sender); + function enableSwitchboard(uint64 switchboardId_) external onlyRole(GOVERNANCE_ROLE) { + isValidSwitchboard[switchboardId_] = SwitchboardStatus.REGISTERED; + emit SwitchboardEnabled(switchboardId_); } function setSocketFeeManager(address socketFeeManager_) external onlyRole(GOVERNANCE_ROLE) { @@ -75,16 +88,15 @@ abstract contract SocketConfig is ISocket, AccessControl { /** * @notice connects Plug to Socket and sets the config for given `siblingChainSlug_` */ - function connect(bytes32 appGatewayId_, address switchboard_) external override { - if (isValidSwitchboard[switchboard_] != SwitchboardStatus.REGISTERED) + function connect(bytes32 appGatewayId_, uint64 switchboardId_) external override { + if (isValidSwitchboard[switchboardId_] != SwitchboardStatus.REGISTERED) revert InvalidSwitchboard(); PlugConfigEvm storage _plugConfig = _plugConfigs[msg.sender]; - _plugConfig.appGatewayId = appGatewayId_; - _plugConfig.switchboard = switchboard_; + _plugConfig.switchboardId = switchboardId_; - emit PlugConnected(msg.sender, appGatewayId_, switchboard_); + emit PlugConnected(msg.sender, appGatewayId_, switchboardId_); } // @notice function to set the max copy bytes for socket @@ -98,12 +110,12 @@ abstract contract SocketConfig is ISocket, AccessControl { * @notice returns the config for given `plugAddress_` * @param plugAddress_ address of plug present at current chain * @return appGatewayId The app gateway id - * @return switchboard The switchboard address + * @return switchboardId The switchboard id */ function getPlugConfig( address plugAddress_ - ) external view returns (bytes32 appGatewayId, address switchboard) { + ) external view returns (bytes32 appGatewayId, uint64 switchboardId) { PlugConfigEvm memory _plugConfig = _plugConfigs[plugAddress_]; - return (_plugConfig.appGatewayId, _plugConfig.switchboard); + return (_plugConfig.appGatewayId, _plugConfig.switchboardId); } } diff --git a/contracts/protocol/base/MessagePlugBase.sol b/contracts/protocol/base/MessagePlugBase.sol index 5c0d83f4..768a374e 100644 --- a/contracts/protocol/base/MessagePlugBase.sol +++ b/contracts/protocol/base/MessagePlugBase.sol @@ -18,21 +18,21 @@ interface IMessageSwitchboard is ISwitchboard { /// Uses constant appGatewayId (0xaaaaa) for all chains abstract contract MessagePlugBase is PlugBase { address public switchboard; + uint64 public switchboardId; uint256 public triggerPrefix; error NotSupported(); - constructor(address socket_, address switchboard_) { + constructor(address socket_, uint64 switchboardId_) { _setSocket(socket_); - switchboard = switchboard_; - socket__.connect(APP_GATEWAY_ID, switchboard); + switchboardId = switchboardId_; + switchboard = socket__.switchboardAddresses(switchboardId_); + socket__.connect(APP_GATEWAY_ID, switchboardId_); - triggerPrefix = - (uint256(socket__.chainSlug()) << 224) | - (uint256(uint160(address(this))) << 64); + triggerPrefix = (uint256(socket__.chainSlug()) << 224) | (uint256(uint160(socket_)) << 64); } /// @notice Initializes the socket with the new protocol - function initSocket(bytes32, address, address) external override socketInitializer { + function initSocket(bytes32, address, uint64) external override socketInitializer { revert("Not Supported"); } diff --git a/contracts/protocol/base/PlugBase.sol b/contracts/protocol/base/PlugBase.sol index 3bd4c160..1d854407 100644 --- a/contracts/protocol/base/PlugBase.sol +++ b/contracts/protocol/base/PlugBase.sol @@ -33,18 +33,18 @@ abstract contract PlugBase is IPlug { /// @notice Connects the plug to the app gateway and switchboard /// @param appGatewayId_ The app gateway id /// @param socket_ The socket address - /// @param switchboard_ The switchboard address - function _connectSocket(bytes32 appGatewayId_, address socket_, address switchboard_) internal { + /// @param switchboardId_ The switchboard id + function _connectSocket(bytes32 appGatewayId_, address socket_, uint64 switchboardId_) internal { _setSocket(socket_); appGatewayId = appGatewayId_; - socket__.connect(appGatewayId_, switchboard_); + socket__.connect(appGatewayId_, switchboardId_); } /// @notice Disconnects the plug from the socket function _disconnectSocket() internal { - (, address switchboard) = socket__.getPlugConfig(address(this)); - socket__.connect(bytes32(0), switchboard); + (, uint64 switchboardId) = socket__.getPlugConfig(address(this)); + socket__.connect(bytes32(0), switchboardId); emit ConnectorPlugDisconnected(); } @@ -63,8 +63,8 @@ abstract contract PlugBase is IPlug { function initSocket( bytes32 appGatewayId_, address socket_, - address switchboard_ + uint64 switchboardId_ ) external virtual socketInitializer { - _connectSocket(appGatewayId_, socket_, switchboard_); + _connectSocket(appGatewayId_, socket_, switchboardId_); } } diff --git a/contracts/protocol/interfaces/IPlug.sol b/contracts/protocol/interfaces/IPlug.sol index be18836e..2eb70721 100644 --- a/contracts/protocol/interfaces/IPlug.sol +++ b/contracts/protocol/interfaces/IPlug.sol @@ -9,8 +9,8 @@ interface IPlug { /// @notice Initializes the socket /// @param appGatewayId_ The app gateway id /// @param socket_ The socket address - /// @param switchboard_ The switchboard address - function initSocket(bytes32 appGatewayId_, address socket_, address switchboard_) external; + /// @param switchboardId_ The switchboard id + function initSocket(bytes32 appGatewayId_, address socket_, uint64 switchboardId_) external; /// @notice Gets the overrides /// @return overrides_ The overrides diff --git a/contracts/protocol/interfaces/ISocket.sol b/contracts/protocol/interfaces/ISocket.sol index e7d475df..7083c36a 100644 --- a/contracts/protocol/interfaces/ISocket.sol +++ b/contracts/protocol/interfaces/ISocket.sol @@ -28,14 +28,14 @@ interface ISocket { * @notice emits the config set by a plug for a remoteChainSlug * @param plug address of plug on current chain * @param appGatewayId address of plug on sibling chain - * @param switchboard outbound switchboard (select from registered options) + * @param switchboardId outbound switchboard (select from registered options) */ - event PlugConnected(address plug, bytes32 appGatewayId, address switchboard); + event PlugConnected(address plug, bytes32 appGatewayId, uint64 switchboardId); /** * @notice emits the payload details when a new payload arrives at outbound * @param triggerId trigger id - * @param switchboard switchboard address + * @param switchboardId switchboard id * @param plug local plug address * @param overrides params, for specifying details like fee pool chain, fee pool token and max fees if required * @param payload the data which will be used by contracts on chain @@ -43,7 +43,7 @@ interface ISocket { event AppGatewayCallRequested( bytes32 triggerId, bytes32 appGatewayId, - bytes32 switchboard, + uint64 switchboardId, bytes32 plug, bytes overrides, bytes payload @@ -60,14 +60,14 @@ interface ISocket { /** * @notice sets the config specific to the plug * @param appGatewayId_ address of plug present at sibling chain - * @param switchboard_ the address of switchboard to use for executing payloads + * @param switchboardId_ the id of switchboard to use for executing payloads */ - function connect(bytes32 appGatewayId_, address switchboard_) external; + function connect(bytes32 appGatewayId_, uint64 switchboardId_) external; /** * @notice registers a switchboard for the socket */ - function registerSwitchboard() external; + function registerSwitchboard() external returns (uint64); /** * @notice returns the config for given `plugAddress_` and `siblingChainSlug_` @@ -75,7 +75,7 @@ interface ISocket { */ function getPlugConfig( address plugAddress_ - ) external view returns (bytes32 appGatewayId, address switchboard); + ) external view returns (bytes32 appGatewayId, uint64 switchboardId); function payloadExecuted(bytes32 payloadId_) external view returns (ExecutionStatus); @@ -84,4 +84,6 @@ interface ISocket { function payloadIdToDigest(bytes32 payloadId_) external view returns (bytes32); function triggerCounter() external view returns (uint64); + + function switchboardAddresses(uint64 switchboardId_) external view returns (address); } diff --git a/contracts/protocol/switchboard/FastSwitchboard.sol b/contracts/protocol/switchboard/FastSwitchboard.sol index 2eaf66fa..95a41629 100644 --- a/contracts/protocol/switchboard/FastSwitchboard.sol +++ b/contracts/protocol/switchboard/FastSwitchboard.sol @@ -61,10 +61,6 @@ contract FastSwitchboard is SwitchboardBase { return isAttested[digest_]; } - function registerSwitchboard() external onlyOwner { - socket__.registerSwitchboard(); - } - function processTrigger( address plug_, bytes32 triggerId_, diff --git a/contracts/protocol/switchboard/SwitchboardBase.sol b/contracts/protocol/switchboard/SwitchboardBase.sol index 99e3a607..aed60da0 100644 --- a/contracts/protocol/switchboard/SwitchboardBase.sol +++ b/contracts/protocol/switchboard/SwitchboardBase.sol @@ -16,6 +16,8 @@ abstract contract SwitchboardBase is ISwitchboard, AccessControl { // chain slug of deployed chain uint32 public immutable chainSlug; + uint64 public switchboardId; + /** * @dev Constructor of SwitchboardBase * @param chainSlug_ Chain slug of deployment chain @@ -27,6 +29,10 @@ abstract contract SwitchboardBase is ISwitchboard, AccessControl { _initializeOwner(owner_); } + function registerSwitchboard() external onlyOwner { + switchboardId = socket__.registerSwitchboard(); + } + /// @notice Recovers the signer from the signature /// @param digest_ The digest of the payload /// @param signature_ The signature of the watcher diff --git a/contracts/utils/common/Structs.sol b/contracts/utils/common/Structs.sol index 5014e339..0804e09b 100644 --- a/contracts/utils/common/Structs.sol +++ b/contracts/utils/common/Structs.sol @@ -56,19 +56,15 @@ struct AppGatewayConfig { uint32 chainSlug; } // Plug config: -// struct PlugConfig { -// bytes32 appGatewayId; -// address switchboard; -// } struct PlugConfigGeneric { bytes32 appGatewayId; - bytes32 switchboard; + uint64 switchboardId; } // Plug config: struct PlugConfigEvm { bytes32 appGatewayId; - address switchboard; + uint64 switchboardId; } //trigger: From ae497dddb23408771dd5afac149b931cb42945e8 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 24 Jul 2025 13:13:30 +0530 Subject: [PATCH 037/139] fix: build --- test/FeesTest.t.sol | 13 ++-- test/MessageSwitchboardTest.t.sol | 4 +- test/SetupTest.t.sol | 71 ++++++++----------- test/SocketFeeManager.t.sol | 6 +- test/Watcher.t.sol | 2 +- .../app-gateways/counter/MessageCounter.sol | 2 +- test/mock/MockFastSwitchboard.sol | 3 +- test/mock/MockSocket.sol | 18 ++--- 8 files changed, 55 insertions(+), 64 deletions(-) diff --git a/test/FeesTest.t.sol b/test/FeesTest.t.sol index c94d0681..26424c24 100644 --- a/test/FeesTest.t.sol +++ b/test/FeesTest.t.sol @@ -96,7 +96,7 @@ contract FeesTest is AppGatewayBaseSetup { arbConfig.feesPlug.connectSocket( bytes32(0), address(arbConfig.socket), - address(arbConfig.switchboard) + arbConfig.switchboard.switchboardId() ); hoax(watcherEOA); @@ -106,7 +106,10 @@ contract FeesTest is AppGatewayBaseSetup { configs[0] = AppGatewayConfig({ chainSlug: arbChainSlug, plug: toBytes32Format(address(arbConfig.feesPlug)), - plugConfig: PlugConfigGeneric({appGatewayId: bytes32(0), switchboard: bytes32(0)}) + plugConfig: PlugConfigGeneric({ + appGatewayId: bytes32(0), + switchboardId: arbConfig.switchboard.switchboardId() + }) }); watcherMultiCall( address(configurations), @@ -135,7 +138,7 @@ contract FeesTest is AppGatewayBaseSetup { oldFeesPlug.connectSocket( bytes32(0), address(arbConfig.socket), - address(arbConfig.switchboard) + arbConfig.switchboard.switchboardId() ); // deploy new fees plug @@ -148,7 +151,7 @@ contract FeesTest is AppGatewayBaseSetup { arbConfig.feesPlug.connectSocket( toBytes32Format(address(feesManager)), address(arbConfig.socket), - address(arbConfig.switchboard) + arbConfig.switchboard.switchboardId() ); vm.stopPrank(); @@ -161,7 +164,7 @@ contract FeesTest is AppGatewayBaseSetup { plug: toBytes32Format(address(arbConfig.feesPlug)), plugConfig: PlugConfigGeneric({ appGatewayId: toBytes32Format(address(feesManager)), - switchboard: toBytes32Format(address(arbConfig.switchboard)) + switchboardId: arbConfig.switchboard.switchboardId() }) }); watcherMultiCall( diff --git a/test/MessageSwitchboardTest.t.sol b/test/MessageSwitchboardTest.t.sol index 8b2eb373..fede68e0 100644 --- a/test/MessageSwitchboardTest.t.sol +++ b/test/MessageSwitchboardTest.t.sol @@ -10,8 +10,8 @@ contract MessageSwitchboardTest is MessageSwitchboardSetup { function setUp() public { _deploy(); - arbPlug = new CounterPlug(address(arbConfig.socket), address(arbConfig.messageSwitchboard)); - optPlug = new CounterPlug(address(optConfig.socket), address(optConfig.messageSwitchboard)); + arbPlug = new CounterPlug(address(arbConfig.socket), arbConfig.messageSwitchboard.switchboardId()); + optPlug = new CounterPlug(address(optConfig.socket), optConfig.messageSwitchboard.switchboardId()); arbPlug.registerSibling(optConfig.chainSlug, address(optPlug)); optPlug.registerSibling(arbConfig.chainSlug, address(arbPlug)); diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 4b8a9eef..c269a40e 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -209,7 +209,7 @@ contract DeploySetup is SetupStore { plug: toBytes32Format(address(arbConfig.feesPlug)), plugConfig: PlugConfigGeneric({ appGatewayId: toBytes32Format(address(feesManager)), - switchboard: toBytes32Format(address(arbConfig.switchboard)) + switchboardId: arbConfig.switchboard.switchboardId() }) }); configs[1] = AppGatewayConfig({ @@ -217,7 +217,7 @@ contract DeploySetup is SetupStore { plug: toBytes32Format(address(optConfig.feesPlug)), plugConfig: PlugConfigGeneric({ appGatewayId: toBytes32Format(address(feesManager)), - switchboard: toBytes32Format(address(optConfig.switchboard)) + switchboardId: optConfig.switchboard.switchboardId() }) }); configs[2] = AppGatewayConfig({ @@ -225,7 +225,7 @@ contract DeploySetup is SetupStore { plug: toBytes32Format(address(arbConfig.contractFactoryPlug)), plugConfig: PlugConfigGeneric({ appGatewayId: toBytes32Format(address(writePrecompile)), - switchboard: toBytes32Format(address(arbConfig.switchboard)) + switchboardId: arbConfig.switchboard.switchboardId() }) }); configs[3] = AppGatewayConfig({ @@ -233,7 +233,7 @@ contract DeploySetup is SetupStore { plug: toBytes32Format(address(optConfig.contractFactoryPlug)), plugConfig: PlugConfigGeneric({ appGatewayId: toBytes32Format(address(writePrecompile)), - switchboard: toBytes32Format(address(optConfig.switchboard)) + switchboardId: optConfig.switchboard.switchboardId() }) }); @@ -304,22 +304,22 @@ contract DeploySetup is SetupStore { feesPlug.connectSocket( toBytes32Format(address(feesManager)), address(socket), - address(switchboard) + switchboard.switchboardId() ); contractFactoryPlug.grantRole(RESCUE_ROLE, address(socketOwner)); contractFactoryPlug.connectSocket( toBytes32Format(address(writePrecompile)), address(socket), - address(switchboard) + switchboard.switchboardId() ); vm.stopPrank(); vm.startPrank(watcherEOA); configurations.setSocket(chainSlug_, toBytes32Format(address(socket))); - configurations.setSwitchboard(chainSlug_, FAST, toBytes32Format(address(switchboard))); - configurations.setSwitchboard(chainSlug_, CCTP, toBytes32Format(address(cctpSwitchboard))); + configurations.setSwitchboard(chainSlug_, FAST, switchboard.switchboardId()); + configurations.setSwitchboard(chainSlug_, CCTP, cctpSwitchboard.switchboardId()); // plugs feesManager.setFeesPlug(chainSlug_, toBytes32Format(address(feesPlug))); @@ -915,8 +915,8 @@ contract WatcherSetup is AuctionSetup { switchboard = switchboard_; bytes32 prevBatchDigestHash = writePrecompile.getPrevBatchDigestHash( - payloadParams.requestCount, - payloadParams.batchCount + uint40(payloadParams.payloadPointer >> 120), + uint40(payloadParams.payloadPointer >> 80) ); digestParams = DigestParams( toBytes32Format(address(getSocketConfig(transaction.chainSlug).socket)), @@ -960,9 +960,7 @@ contract WatcherSetup is AuctionSetup { value: digestParams.value, payload: digestParams.payload, target: fromBytes32Format(digestParams.target), - requestCount: payloadParams.requestCount, - batchCount: payloadParams.batchCount, - payloadCount: payloadParams.payloadCount, + payloadPointer: payloadParams.payloadPointer, prevBatchDigestHash: digestParams.prevBatchDigestHash, extraData: digestParams.extraData }); @@ -1014,6 +1012,7 @@ contract WatcherSetup is AuctionSetup { refundAddress: transmitterEOA }), cctpBatchParams, + getSocketConfig(chainSlug).cctpSwitchboard.switchboardId(), address(getSocketConfig(chainSlug).cctpSwitchboard) ); } @@ -1023,9 +1022,9 @@ contract WatcherSetup is AuctionSetup { PayloadParams memory payloadParams ) internal view returns (CCTPBatchParams memory cctpBatchParams) { uint40[] memory requestBatchIds = requestHandler.getRequestBatchIds( - payloadParams.requestCount + uint40(payloadParams.payloadPointer >> 120) ); - uint40 currentBatchCount = payloadParams.batchCount; + uint40 currentBatchCount = uint40(payloadParams.payloadPointer >> 80); bytes32[] memory prevBatchPayloadIds = _getPrevBatchPayloadIds( currentBatchCount, @@ -1148,14 +1147,14 @@ contract WatcherSetup is AuctionSetup { for (uint i = 0; i < contractIds_.length; i++) { bytes32 plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); - bytes32 switchboard = configurations.switchboards(chainSlug_, appGateway_.sbType()); + uint64 switchboardId = configurations.switchboards(chainSlug_, appGateway_.sbType()); if (plug != bytes32(0)) { configs[configIndex] = AppGatewayConfig({ plug: plug, chainSlug: chainSlug_, plugConfig: PlugConfigGeneric({ appGatewayId: toBytes32Format(address(appGateway_)), - switchboard: switchboard + switchboardId: switchboardId }) }); configIndex++; @@ -1273,19 +1272,9 @@ contract AppGatewayBaseSetup is WatcherSetup { ); // PayloadParams checks assertEq( - actualPayload.requestCount, - expectedPayload.requestCount, - "Payload: requestCount mismatch" - ); - assertEq( - actualPayload.batchCount, - expectedPayload.batchCount, - "Payload: batchCount mismatch" - ); - assertEq( - actualPayload.payloadCount, - expectedPayload.payloadCount, - "Payload: payloadCount mismatch" + actualPayload.payloadPointer, + expectedPayload.payloadPointer, + "Payload: payloadPointer mismatch" ); assertEq( actualPayload.callType, @@ -1353,12 +1342,14 @@ contract MessageSwitchboardSetup is DeploySetup { bytes32 triggerId = srcPlug_.getNextTriggerId(srcSocketConfig_.chainSlug); payloadCounter = srcSocketConfig_.messageSwitchboard.payloadCounter(); + uint128 payloadPointer = (uint128(srcSocketConfig_.chainSlug) << 120) | + (uint128(uint64(uint256(triggerId))) << 80) | + payloadCounter; + bytes32 payloadId = createPayloadId( - srcSocketConfig_.chainSlug, - uint40(uint64(uint256(triggerId))), - payloadCounter, - toBytes32Format(address(dstSocketConfig_.messageSwitchboard)), - dstSocketConfig_.chainSlug + payloadPointer, + dstSocketConfig_.messageSwitchboard.switchboardId(), + srcSocketConfig_.chainSlug ); digestParams = _createDigestParams( @@ -1375,10 +1366,10 @@ contract MessageSwitchboardSetup is DeploySetup { function _executeOnDestination( DigestParams memory digestParams_, bytes32 triggerId_, - uint256 payloadCount_ + uint128 payloadPointer_ ) internal { _attestPayload(digestParams_); - _execute(digestParams_, triggerId_, payloadCount_); + _execute(digestParams_, triggerId_, payloadPointer_); } // Helper function to attest a payload @@ -1445,7 +1436,7 @@ contract MessageSwitchboardSetup is DeploySetup { function _execute( DigestParams memory digestParams_, bytes32 triggerId_, - uint256 payloadCount_ + uint128 payloadPointer_ ) internal { // this is a signature for the socket batcher (only used for EVM) ExecuteParams memory executeParams = ExecuteParams({ @@ -1455,9 +1446,7 @@ contract MessageSwitchboardSetup is DeploySetup { value: digestParams_.value, payload: digestParams_.payload, target: fromBytes32Format(digestParams_.target), - requestCount: uint40(arbConfig.chainSlug), - batchCount: uint40(uint64(uint256(triggerId_))), - payloadCount: uint40(payloadCount_), + payloadPointer: payloadPointer_, prevBatchDigestHash: digestParams_.prevBatchDigestHash, extraData: digestParams_.extraData }); diff --git a/test/SocketFeeManager.t.sol b/test/SocketFeeManager.t.sol index 1fc6ce21..4d613b76 100644 --- a/test/SocketFeeManager.t.sol +++ b/test/SocketFeeManager.t.sol @@ -25,7 +25,7 @@ contract SocketFeeManagerTest is AppGatewayBaseSetup { counter = new Counter(); mockSwitchboard.registerSwitchboard(); - counter.initSocket(toBytes32Format(gateway), address(socket), address(mockSwitchboard)); + counter.initSocket(toBytes32Format(gateway), address(socket), mockSwitchboard.switchboardId()); vm.prank(owner); socket.grantRole(GOVERNANCE_ROLE, address(owner)); @@ -134,9 +134,7 @@ contract SocketFeeManagerTest is AppGatewayBaseSetup { value: 0, payload: payload, target: address(counter), - requestCount: 0, - batchCount: 0, - payloadCount: 0, + payloadPointer: 0, prevBatchDigestHash: bytes32(0), extraData: bytes("") }); diff --git a/test/Watcher.t.sol b/test/Watcher.t.sol index 4a0b9395..e1977270 100644 --- a/test/Watcher.t.sol +++ b/test/Watcher.t.sol @@ -24,7 +24,7 @@ contract WatcherTest is AppGatewayBaseSetup { arbConfig.feesPlug.initSocket( bytes32(0), address(hackerEOA), - address(arbConfig.switchboard) + arbConfig.switchboard.switchboardId() ); } } diff --git a/test/apps/app-gateways/counter/MessageCounter.sol b/test/apps/app-gateways/counter/MessageCounter.sol index 079eab9d..8f8194ca 100644 --- a/test/apps/app-gateways/counter/MessageCounter.sol +++ b/test/apps/app-gateways/counter/MessageCounter.sol @@ -15,7 +15,7 @@ contract CounterPlug is MessagePlugBase { event IncrementRequested(bytes32 triggerId, uint32 dstChainSlug); event IncrementExecuted(bytes32 triggerId, uint256 newCount); - constructor(address socket_, address switchboard_) MessagePlugBase(socket_, switchboard_) {} + constructor(address socket_, uint64 switchboardId_) MessagePlugBase(socket_, switchboardId_) {} /// @notice Increment the counter (local function) function increment() external { diff --git a/test/mock/MockFastSwitchboard.sol b/test/mock/MockFastSwitchboard.sol index 3f033f9f..2dab11dc 100644 --- a/test/mock/MockFastSwitchboard.sol +++ b/test/mock/MockFastSwitchboard.sol @@ -10,6 +10,7 @@ contract MockFastSwitchboard is ISwitchboard { // chain slug of deployed chain uint32 public immutable chainSlug; + uint64 public switchboardId; /** * @dev Constructor of SwitchboardBase @@ -30,7 +31,7 @@ contract MockFastSwitchboard is ISwitchboard { } function registerSwitchboard() external { - socket__.registerSwitchboard(); + switchboardId = socket__.registerSwitchboard(); } function processTrigger( diff --git a/test/mock/MockSocket.sol b/test/mock/MockSocket.sol index 5cf916cf..4910b242 100644 --- a/test/mock/MockSocket.sol +++ b/test/mock/MockSocket.sol @@ -18,25 +18,25 @@ contract MockSocket is ISocket { struct PlugConfigEvm { // address of the sibling plug on the remote chain bytes32 appGatewayId; - // switchboard instance for the plug connection - ISwitchboard switchboard__; + // switchboard id for the plug connection + uint64 switchboardId; } - // plug => (appGateway, switchboard__) + // plug => (appGateway, switchboardId) mapping(address => PlugConfigEvm) internal _plugConfigs; mapping(bytes32 => bytes32) public payloadIdToDigest; function getPlugConfig( address plugAddress_ - ) external view returns (bytes32 appGatewayId, address switchboard__) { + ) external view returns (bytes32 appGatewayId, uint64 switchboardId) { PlugConfigEvm memory _plugConfig = _plugConfigs[plugAddress_]; - return (_plugConfig.appGatewayId, address(_plugConfig.switchboard__)); + return (_plugConfig.appGatewayId, _plugConfig.switchboardId); } - function connect(bytes32 appGatewayId_, address switchboard_) external override {} + function connect(bytes32 appGatewayId_, uint64 switchboardId_) external override {} - function registerSwitchboard() external override {} + function registerSwitchboard() external override returns (uint64 switchboardId) {} //////////////////////////////////////////////////////// ////////////////////// ERRORS ////////////////////////// @@ -67,7 +67,7 @@ contract MockSocket is ISocket { //////////////////////////////////////////////////////////// uint64 public triggerCounter; uint32 public chainSlug; - + mapping(uint64 => address) public switchboardAddresses; /** * @dev keeps track of whether a payload has been executed or not using payload id */ @@ -94,7 +94,7 @@ contract MockSocket is ISocket { emit AppGatewayCallRequested( triggerId, plugConfig.appGatewayId, - toBytes32Format(address(plugConfig.switchboard__)), + plugConfig.switchboardId, toBytes32Format(msg.sender), overrides, payload From 2fec83882455d91e8c78e067f56df3e4e1edab4e Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 24 Jul 2025 15:31:25 +0530 Subject: [PATCH 038/139] fix: id data type --- contracts/evmx/watcher/RequestHandler.sol | 6 +++--- contracts/evmx/watcher/precompiles/WritePrecompile.sol | 1 - contracts/protocol/base/PlugBase.sol | 7 +++++-- contracts/protocol/switchboard/MessageSwitchboard.sol | 4 ++-- contracts/utils/common/Structs.sol | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/contracts/evmx/watcher/RequestHandler.sol b/contracts/evmx/watcher/RequestHandler.sol index d1f2c351..7a4936f5 100644 --- a/contracts/evmx/watcher/RequestHandler.sol +++ b/contracts/evmx/watcher/RequestHandler.sol @@ -241,9 +241,9 @@ contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, Addres result.totalEstimatedWatcherFees += estimatedFees; // create payload id - uint128 payloadPointer = (uint128(requestCount_) << 120) | - (uint128(nextBatchCount) << 80) | - uint128(payloadCounter++); + uint160 payloadPointer = (uint160(requestCount_) << 120) | + (uint160(nextBatchCount) << 80) | + uint160(payloadCounter++); bytes32 payloadId = createPayloadId( payloadPointer, diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index 30bfeadb..e2768e0a 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -170,7 +170,6 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc deadline = block.timestamp + expiryTime; fees = getPrecompileFees(payloadParams.precompileData); - // todo: fix batch count bytes32 prevBatchDigestHash = getPrevBatchDigestHash( uint40(payloadParams.payloadPointer >> 120), uint40(payloadParams.payloadPointer >> 80) diff --git a/contracts/protocol/base/PlugBase.sol b/contracts/protocol/base/PlugBase.sol index 1d854407..856ff24d 100644 --- a/contracts/protocol/base/PlugBase.sol +++ b/contracts/protocol/base/PlugBase.sol @@ -34,10 +34,13 @@ abstract contract PlugBase is IPlug { /// @param appGatewayId_ The app gateway id /// @param socket_ The socket address /// @param switchboardId_ The switchboard id - function _connectSocket(bytes32 appGatewayId_, address socket_, uint64 switchboardId_) internal { + function _connectSocket( + bytes32 appGatewayId_, + address socket_, + uint64 switchboardId_ + ) internal { _setSocket(socket_); appGatewayId = appGatewayId_; - socket__.connect(appGatewayId_, switchboardId_); } diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol index 872b7a57..81262b09 100644 --- a/contracts/protocol/switchboard/MessageSwitchboard.sol +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -158,8 +158,8 @@ contract MessageSwitchboard is SwitchboardBase { bytes32 triggerId_, bytes calldata payload_ ) internal returns (DigestParams memory digestParams, bytes32 digest) { - uint128 payloadPointer = (uint128(chainSlug) << 120) | - (uint128(uint64(uint256(triggerId_))) << 80) | + uint160 payloadPointer = (uint160(chainSlug) << 120) | + (uint160(uint64(uint256(triggerId_))) << 80) | payloadCounter++; bytes32 payloadId = createPayloadId(payloadPointer, switchboardId, chainSlug); diff --git a/contracts/utils/common/Structs.sol b/contracts/utils/common/Structs.sol index 0804e09b..133324e5 100644 --- a/contracts/utils/common/Structs.sol +++ b/contracts/utils/common/Structs.sol @@ -85,7 +85,7 @@ struct PromiseReturnData { // AM struct ExecuteParams { bytes4 callType; - uint128 payloadPointer; + uint160 payloadPointer; uint256 deadline; uint256 gasLimit; uint256 value; @@ -169,7 +169,7 @@ struct QueueParams { struct PayloadParams { bytes4 callType; - uint128 payloadPointer; + uint160 payloadPointer; address asyncPromise; address appGateway; bytes32 payloadId; From c3219f5ebf227b2546519134c5e53d980de3001f Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 24 Jul 2025 15:31:34 +0530 Subject: [PATCH 039/139] fix: setup tests --- test/MessageSwitchboardTest.t.sol | 14 +++++++--- test/SetupTest.t.sol | 46 ++++++++++++++----------------- test/Watcher.t.sol | 8 ++---- 3 files changed, 33 insertions(+), 35 deletions(-) diff --git a/test/MessageSwitchboardTest.t.sol b/test/MessageSwitchboardTest.t.sol index fede68e0..36fe93b0 100644 --- a/test/MessageSwitchboardTest.t.sol +++ b/test/MessageSwitchboardTest.t.sol @@ -10,15 +10,21 @@ contract MessageSwitchboardTest is MessageSwitchboardSetup { function setUp() public { _deploy(); - arbPlug = new CounterPlug(address(arbConfig.socket), arbConfig.messageSwitchboard.switchboardId()); - optPlug = new CounterPlug(address(optConfig.socket), optConfig.messageSwitchboard.switchboardId()); + arbPlug = new CounterPlug( + address(arbConfig.socket), + arbConfig.messageSwitchboard.switchboardId() + ); + optPlug = new CounterPlug( + address(optConfig.socket), + optConfig.messageSwitchboard.switchboardId() + ); arbPlug.registerSibling(optConfig.chainSlug, address(optPlug)); optPlug.registerSibling(arbConfig.chainSlug, address(arbPlug)); } function testIncrementWithMessageSwitchboard() public { - (uint40 payloadCounter, DigestParams memory digestParams) = _getTriggerData( + (uint160 payloadPointer, DigestParams memory digestParams) = _getTriggerData( arbPlug, optPlug, arbConfig, @@ -35,7 +41,7 @@ contract MessageSwitchboardTest is MessageSwitchboardSetup { ); arbPlug.requestIncrement{value: msgSbFees}(optConfig.chainSlug); - _executeOnDestination(digestParams, digestParams.prevBatchDigestHash, payloadCounter); + _executeOnDestination(digestParams, payloadPointer); assertEq(optPlug.count(), 1, "Counter should be incremented on destination"); } diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index c269a40e..3c15ae9d 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -313,7 +313,6 @@ contract DeploySetup is SetupStore { address(socket), switchboard.switchboardId() ); - vm.stopPrank(); vm.startPrank(watcherEOA); @@ -330,7 +329,6 @@ contract DeploySetup is SetupStore { chainSlug_, toBytes32Format(address(contractFactoryPlug)) ); - vm.stopPrank(); } @@ -848,7 +846,7 @@ contract WatcherSetup is AuctionSetup { ( uint32 chainSlug, - bytes32 switchboard, + uint64 switchboard, bytes32 digest, DigestParams memory digestParams ) = _validateAndGetDigest(payloadParams); @@ -869,12 +867,13 @@ contract WatcherSetup is AuctionSetup { function _uploadProof( bytes32 payloadId, bytes32 digest, - bytes32 switchboard, + uint64 switchboard, uint32 chainSlug ) internal returns (bytes memory proof) { + address sbAddress = getSocketConfig(chainSlug).socket.switchboardAddresses(switchboard); proof = createSignature( // create sigDigest which get signed by watcher - keccak256(abi.encodePacked(switchboard, chainSlug, digest)), + keccak256(abi.encodePacked(toBytes32Format(sbAddress), chainSlug, digest)), watcherPrivateKey ); @@ -894,7 +893,7 @@ contract WatcherSetup is AuctionSetup { view returns ( uint32 chainSlug, - bytes32 switchboard, + uint64 switchboard, bytes32 digest, DigestParams memory digestParams ) @@ -905,10 +904,10 @@ contract WatcherSetup is AuctionSetup { , uint256 gasLimit, uint256 value, - bytes32 switchboard_ + uint64 switchboard_ ) = abi.decode( payloadParams.precompileData, - (address, Transaction, WriteFinality, uint256, uint256, bytes32) + (address, Transaction, WriteFinality, uint256, uint256, uint64) ); chainSlug = transaction.chainSlug; @@ -939,7 +938,7 @@ contract WatcherSetup is AuctionSetup { function _executeWrite( uint32 chainSlug, - bytes32 switchboard, + uint64 switchboard, bytes32 digest, DigestParams memory digestParams, PayloadParams memory payloadParams, @@ -964,18 +963,17 @@ contract WatcherSetup is AuctionSetup { prevBatchDigestHash: digestParams.prevBatchDigestHash, extraData: digestParams.extraData }); - if (fromBytes32Format(switchboard) == address(getSocketConfig(chainSlug).switchboard)) { + + if (switchboard == getSocketConfig(chainSlug).switchboard.switchboardId()) { (success, returnData) = getSocketConfig(chainSlug).socketBatcher.attestAndExecute( executeParams, - fromBytes32Format(switchboard), + address(getSocketConfig(chainSlug).switchboard), digest, watcherProof, transmitterSig, transmitterEOA ); - } else if ( - fromBytes32Format(switchboard) == address(getSocketConfig(chainSlug).cctpSwitchboard) - ) { + } else if (switchboard == getSocketConfig(chainSlug).cctpSwitchboard.switchboardId()) { (success, returnData) = _executeWithCCTPBatcher( chainSlug, executeParams, @@ -1338,12 +1336,13 @@ contract MessageSwitchboardSetup is DeploySetup { SocketContracts memory srcSocketConfig_, SocketContracts memory dstSocketConfig_, bytes memory payload_ - ) internal view returns (uint40 payloadCounter, DigestParams memory digestParams) { + ) internal view returns (uint160 payloadPointer, DigestParams memory digestParams) { bytes32 triggerId = srcPlug_.getNextTriggerId(srcSocketConfig_.chainSlug); - payloadCounter = srcSocketConfig_.messageSwitchboard.payloadCounter(); + uint40 payloadCounter = srcSocketConfig_.messageSwitchboard.payloadCounter(); - uint128 payloadPointer = (uint128(srcSocketConfig_.chainSlug) << 120) | - (uint128(uint64(uint256(triggerId))) << 80) | + payloadPointer = + (uint160(srcSocketConfig_.chainSlug) << 120) | + (uint160(uint64(uint256(triggerId))) << 80) | payloadCounter; bytes32 payloadId = createPayloadId( @@ -1365,11 +1364,10 @@ contract MessageSwitchboardSetup is DeploySetup { function _executeOnDestination( DigestParams memory digestParams_, - bytes32 triggerId_, - uint128 payloadPointer_ + uint160 payloadPointer_ ) internal { _attestPayload(digestParams_); - _execute(digestParams_, triggerId_, payloadPointer_); + _execute(digestParams_, payloadPointer_); } // Helper function to attest a payload @@ -1433,11 +1431,7 @@ contract MessageSwitchboardSetup is DeploySetup { } // Helper function to execute on destination chain - function _execute( - DigestParams memory digestParams_, - bytes32 triggerId_, - uint128 payloadPointer_ - ) internal { + function _execute(DigestParams memory digestParams_, uint160 payloadPointer_) internal { // this is a signature for the socket batcher (only used for EVM) ExecuteParams memory executeParams = ExecuteParams({ callType: digestParams_.callType, diff --git a/test/Watcher.t.sol b/test/Watcher.t.sol index e1977270..b3d0e960 100644 --- a/test/Watcher.t.sol +++ b/test/Watcher.t.sol @@ -20,11 +20,9 @@ contract WatcherTest is AppGatewayBaseSetup { function testRevertInitSocketPlug() public { address hackerEOA = address(0x123); + uint64 sbId = arbConfig.switchboard.switchboardId(); + vm.expectRevert(abi.encodeWithSelector(SocketAlreadyInitialized.selector)); - arbConfig.feesPlug.initSocket( - bytes32(0), - address(hackerEOA), - arbConfig.switchboard.switchboardId() - ); + arbConfig.feesPlug.initSocket(bytes32(0), address(hackerEOA), sbId); } } From 546053e693ee797a14e0f249cf5215f00b8551f6 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 24 Jul 2025 17:05:41 +0530 Subject: [PATCH 040/139] fix: msg sb tests --- contracts/protocol/switchboard/MessageSwitchboard.sol | 2 +- test/SetupTest.t.sol | 2 +- test/TriggerTest.t.sol | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol index 81262b09..0fe72dfd 100644 --- a/contracts/protocol/switchboard/MessageSwitchboard.sol +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -162,7 +162,7 @@ contract MessageSwitchboard is SwitchboardBase { (uint160(uint64(uint256(triggerId_))) << 80) | payloadCounter++; - bytes32 payloadId = createPayloadId(payloadPointer, switchboardId, chainSlug); + bytes32 payloadId = createPayloadId(payloadPointer, switchboardId, dstChainSlug_); digestParams = DigestParams({ socket: siblingSockets[dstChainSlug_], diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 3c15ae9d..7ba86c54 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -1348,7 +1348,7 @@ contract MessageSwitchboardSetup is DeploySetup { bytes32 payloadId = createPayloadId( payloadPointer, dstSocketConfig_.messageSwitchboard.switchboardId(), - srcSocketConfig_.chainSlug + dstSocketConfig_.chainSlug ); digestParams = _createDigestParams( diff --git a/test/TriggerTest.t.sol b/test/TriggerTest.t.sol index 097c3ff0..eb4c0ea0 100644 --- a/test/TriggerTest.t.sol +++ b/test/TriggerTest.t.sol @@ -13,7 +13,7 @@ contract TriggerTest is AppGatewayBaseSetup { event AppGatewayCallRequested( bytes32 triggerId, bytes32 appGatewayId, - bytes32 switchboard, + uint64 switchboard, bytes32 plug, bytes overrides, bytes payload @@ -61,7 +61,7 @@ contract TriggerTest is AppGatewayBaseSetup { emit AppGatewayCallRequested( triggerId, toBytes32Format(address(gateway)), - toBytes32Format(address(arbConfig.switchboard)), + arbConfig.switchboard.switchboardId(), toBytes32Format(address(counter)), bytes(""), payload From 064f44e68d944dbe50931706a9c049b966179c78 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 24 Jul 2025 17:09:14 +0530 Subject: [PATCH 041/139] fix: fees test --- test/AuctionManager.t.sol | 1 - test/FeesTest.t.sol | 16 +++++----------- test/ProxyStorage.t.sol | 2 -- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/test/AuctionManager.t.sol b/test/AuctionManager.t.sol index ac087ccd..3c3cebdf 100644 --- a/test/AuctionManager.t.sol +++ b/test/AuctionManager.t.sol @@ -35,7 +35,6 @@ contract AuctionManagerTest is AppGatewayBaseSetup { approveAppGateway(address(feesManager), user); uint256 withdrawAmount = 0.5 ether; uint40 requestCount = watcher.getCurrentRequestCount(); - console.log("requestCount", requestCount); hoax(user); feesManager.withdrawCredits( diff --git a/test/FeesTest.t.sol b/test/FeesTest.t.sol index 26424c24..401f645b 100644 --- a/test/FeesTest.t.sol +++ b/test/FeesTest.t.sol @@ -90,14 +90,11 @@ contract FeesTest is AppGatewayBaseSetup { } function testDisconnectFeesPlug() public { - hoax(socketOwner); + uint64 sbId = arbConfig.switchboard.switchboardId(); // disconnect old fees plug - arbConfig.feesPlug.connectSocket( - bytes32(0), - address(arbConfig.socket), - arbConfig.switchboard.switchboardId() - ); + hoax(socketOwner); + arbConfig.feesPlug.connectSocket(bytes32(0), address(arbConfig.socket), sbId); hoax(watcherEOA); feesManager.setFeesPlug(arbChainSlug, bytes32(0)); @@ -132,14 +129,11 @@ contract FeesTest is AppGatewayBaseSetup { function testMigrateFeesPlug() public { FeesPlug oldFeesPlug = arbConfig.feesPlug; + uint64 sbId = arbConfig.switchboard.switchboardId(); // disconnect old fees plug hoax(socketOwner); - oldFeesPlug.connectSocket( - bytes32(0), - address(arbConfig.socket), - arbConfig.switchboard.switchboardId() - ); + oldFeesPlug.connectSocket(bytes32(0), address(arbConfig.socket), sbId); // deploy new fees plug arbConfig.feesPlug = new FeesPlug(address(arbConfig.socket), address(socketOwner)); diff --git a/test/ProxyStorage.t.sol b/test/ProxyStorage.t.sol index 69720ca9..3533c6df 100644 --- a/test/ProxyStorage.t.sol +++ b/test/ProxyStorage.t.sol @@ -217,8 +217,6 @@ contract ProxyStorageAssertions is AppGatewayBaseSetup { evmxSlug ); - console.log("forwarder: ", forwarder); - // first bytes32 slotValue = vm.load(address(forwarder), bytes32(uint256(FIRST_SLOT))); assertEq(uint32(uint256(slotValue)), evmxSlug); From 597176a6739dff0d424388d8bac8acf0e41400a5 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 24 Jul 2025 17:10:47 +0530 Subject: [PATCH 042/139] fix: lint --- contracts/evmx/plugs/ContractFactoryPlug.sol | 3 ++- contracts/evmx/watcher/Configurations.sol | 3 ++- contracts/evmx/watcher/precompiles/WritePrecompile.sol | 3 +-- contracts/protocol/Socket.sol | 9 +++------ test/SocketFeeManager.t.sol | 6 +++++- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/contracts/evmx/plugs/ContractFactoryPlug.sol b/contracts/evmx/plugs/ContractFactoryPlug.sol index f92f1bd4..feb06938 100644 --- a/contracts/evmx/plugs/ContractFactoryPlug.sol +++ b/contracts/evmx/plugs/ContractFactoryPlug.sol @@ -55,7 +55,8 @@ contract ContractFactoryPlug is PlugBase, AccessControl, IContractFactoryPlug { } } - if (isPlug_ == IsPlug.YES) IPlug(addr).initSocket(appGatewayId_, msg.sender, switchboardId_); + if (isPlug_ == IsPlug.YES) + IPlug(addr).initSocket(appGatewayId_, msg.sender, switchboardId_); bytes memory returnData; if (initCallData_.length > 0) { diff --git a/contracts/evmx/watcher/Configurations.sol b/contracts/evmx/watcher/Configurations.sol index 16af40c8..33d239ca 100644 --- a/contracts/evmx/watcher/Configurations.sol +++ b/contracts/evmx/watcher/Configurations.sol @@ -161,7 +161,8 @@ contract Configurations is ConfigurationsStorage, Initializable, Ownable, Watche ) external view { (bytes32 appGatewayId, uint64 switchboardId) = getPlugConfigs(chainSlug_, target_); if (appGatewayId != toBytes32Format(appGateway_)) revert InvalidGateway(); - if (switchboardId != switchboards[chainSlug_][switchboardType_]) revert InvalidSwitchboard(); + if (switchboardId != switchboards[chainSlug_][switchboardType_]) + revert InvalidSwitchboard(); } /** diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index e2768e0a..9294f780 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -160,8 +160,7 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc uint256 gasLimit, uint256 value, - ) = - abi.decode( + ) = abi.decode( payloadParams.precompileData, (address, Transaction, WriteFinality, uint256, uint256, bytes32) ); diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index 6a942ae3..5631256b 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -189,12 +189,9 @@ contract Socket is SocketUtils { triggerId = _encodeTriggerId(); // todo: need gas limit? - ISwitchboard(switchboardAddresses[plugConfig.switchboardId]).processTrigger{value: msg.value}( - msg.sender, - triggerId, - msg.data, - plugOverrides - ); + ISwitchboard(switchboardAddresses[plugConfig.switchboardId]).processTrigger{ + value: msg.value + }(msg.sender, triggerId, msg.data, plugOverrides); emit AppGatewayCallRequested( triggerId, diff --git a/test/SocketFeeManager.t.sol b/test/SocketFeeManager.t.sol index 4d613b76..eb6e6899 100644 --- a/test/SocketFeeManager.t.sol +++ b/test/SocketFeeManager.t.sol @@ -25,7 +25,11 @@ contract SocketFeeManagerTest is AppGatewayBaseSetup { counter = new Counter(); mockSwitchboard.registerSwitchboard(); - counter.initSocket(toBytes32Format(gateway), address(socket), mockSwitchboard.switchboardId()); + counter.initSocket( + toBytes32Format(gateway), + address(socket), + mockSwitchboard.switchboardId() + ); vm.prank(owner); socket.grantRole(GOVERNANCE_ROLE, address(owner)); From 7067a19ca075507c427b912c23514cc5f6a5954b Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 24 Jul 2025 17:51:53 +0530 Subject: [PATCH 043/139] feat: verify transmitter sign in sb --- contracts/protocol/Socket.sol | 48 +++++++++++-------- .../protocol/interfaces/ISwitchboard.sol | 14 ++++++ .../protocol/switchboard/SwitchboardBase.sol | 13 +++++ test/mock/MockFastSwitchboard.sol | 8 ++++ 4 files changed, 62 insertions(+), 21 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index 5631256b..4c45b303 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -83,25 +83,9 @@ contract Socket is SocketUtils { // validate the execution status _validateExecutionStatus(payloadId); - address transmitter = transmissionParams_.transmitterSignature.length > 0 - ? _recoverSigner( - keccak256(abi.encode(address(this), payloadId)), - transmissionParams_.transmitterSignature - ) - : address(0); - - // create the digest - // transmitter, payloadId, appGateway, executeParams_ and there contents are validated using digest verification from switchboard - bytes32 digest = _createDigest( - transmitter, - payloadId, - plugConfig.appGatewayId, - executeParams_ - ); - payloadIdToDigest[payloadId] = digest; // verify the digest - _verify(digest, payloadId, plugConfig.switchboardId); + _verify(payloadId, plugConfig, executeParams_, transmissionParams_.transmitterSignature); return _execute(payloadId, executeParams_, transmissionParams_); } @@ -109,13 +93,35 @@ contract Socket is SocketUtils { //////////////////////////////////////////////////////// ////////////////// INTERNAL FUNCS ////////////////////// //////////////////////////////////////////////////////// - function _verify(bytes32 digest_, bytes32 payloadId_, uint64 switchboardId_) internal view { - if (isValidSwitchboard[switchboardId_] != SwitchboardStatus.REGISTERED) + function _verify( + bytes32 payloadId_, + PlugConfigEvm memory plugConfig_, + ExecuteParams calldata executeParams_, + bytes calldata transmitterSignature_ + ) internal { + if (isValidSwitchboard[plugConfig_.switchboardId] != SwitchboardStatus.REGISTERED) revert InvalidSwitchboard(); + address transmitter = ISwitchboard(switchboardAddresses[plugConfig_.switchboardId]) + .getTransmitter(msg.sender, payloadId_, transmitterSignature_); + + // create the digest + // transmitter, payloadId, appGateway, executeParams_ and there contents are validated using digest verification from switchboard + bytes32 digest = _createDigest( + transmitter, + payloadId_, + plugConfig_.appGatewayId, + executeParams_ + ); + payloadIdToDigest[payloadId_] = digest; + // NOTE: is the the first un-trusted call in the system, another one is Plug.call - if (!ISwitchboard(switchboardAddresses[switchboardId_]).allowPayload(digest_, payloadId_)) - revert VerificationFailed(); + if ( + !ISwitchboard(switchboardAddresses[plugConfig_.switchboardId]).allowPayload( + digest, + payloadId_ + ) + ) revert VerificationFailed(); } /** diff --git a/contracts/protocol/interfaces/ISwitchboard.sol b/contracts/protocol/interfaces/ISwitchboard.sol index 3434cd45..e8518d64 100644 --- a/contracts/protocol/interfaces/ISwitchboard.sol +++ b/contracts/protocol/interfaces/ISwitchboard.sol @@ -28,4 +28,18 @@ interface ISwitchboard { bytes calldata payload_, bytes calldata overrides_ ) external payable; + + /** + * @notice Gets the transmitter for a given payload + * @notice Switchboard are required to implement this function to allow for the verification of the transmitters + * @param sender_ The sender of the payload + * @param payloadId_ The payload ID + * @param transmitterSignature_ The transmitter signature + * @return The transmitter address + */ + function getTransmitter( + address sender_, + bytes32 payloadId_, + bytes calldata transmitterSignature_ + ) external view returns (address); } diff --git a/contracts/protocol/switchboard/SwitchboardBase.sol b/contracts/protocol/switchboard/SwitchboardBase.sol index aed60da0..a6ae97cb 100644 --- a/contracts/protocol/switchboard/SwitchboardBase.sol +++ b/contracts/protocol/switchboard/SwitchboardBase.sol @@ -33,6 +33,19 @@ abstract contract SwitchboardBase is ISwitchboard, AccessControl { switchboardId = socket__.registerSwitchboard(); } + function getTransmitter( + address sender_, + bytes32 payloadId_, + bytes calldata transmitterSignature_ + ) external view returns (address transmitter) { + transmitter = transmitterSignature_.length > 0 + ? _recoverSigner( + keccak256(abi.encode(address(socket__), payloadId_)), + transmitterSignature_ + ) + : address(0); + } + /// @notice Recovers the signer from the signature /// @param digest_ The digest of the payload /// @param signature_ The signature of the watcher diff --git a/test/mock/MockFastSwitchboard.sol b/test/mock/MockFastSwitchboard.sol index 2dab11dc..24b31cd3 100644 --- a/test/mock/MockFastSwitchboard.sol +++ b/test/mock/MockFastSwitchboard.sol @@ -40,4 +40,12 @@ contract MockFastSwitchboard is ISwitchboard { bytes calldata payload_, bytes calldata overrides_ ) external payable override {} + + function getTransmitter( + address sender_, + bytes32 payloadId_, + bytes calldata transmitterSignature_ + ) external view returns (address) { + return sender_; + } } From 2075b53a3402d593e5b6ed3fc3fbab957466d7f5 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 25 Jul 2025 00:54:18 +0530 Subject: [PATCH 044/139] fix: rename transmitter sig to proof --- contracts/protocol/Socket.sol | 6 +++--- contracts/protocol/SocketBatcher.sol | 8 ++++---- contracts/utils/common/Structs.sol | 2 +- test/SetupTest.t.sol | 2 +- test/SocketFeeManager.t.sol | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index 4c45b303..fb4ec6d5 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -85,7 +85,7 @@ contract Socket is SocketUtils { _validateExecutionStatus(payloadId); // verify the digest - _verify(payloadId, plugConfig, executeParams_, transmissionParams_.transmitterSignature); + _verify(payloadId, plugConfig, executeParams_, transmissionParams_.transmitterProof); return _execute(payloadId, executeParams_, transmissionParams_); } @@ -97,13 +97,13 @@ contract Socket is SocketUtils { bytes32 payloadId_, PlugConfigEvm memory plugConfig_, ExecuteParams calldata executeParams_, - bytes calldata transmitterSignature_ + bytes calldata transmitterProof_ ) internal { if (isValidSwitchboard[plugConfig_.switchboardId] != SwitchboardStatus.REGISTERED) revert InvalidSwitchboard(); address transmitter = ISwitchboard(switchboardAddresses[plugConfig_.switchboardId]) - .getTransmitter(msg.sender, payloadId_, transmitterSignature_); + .getTransmitter(msg.sender, payloadId_, transmitterProof_); // create the digest // transmitter, payloadId, appGateway, executeParams_ and there contents are validated using digest verification from switchboard diff --git a/contracts/protocol/SocketBatcher.sol b/contracts/protocol/SocketBatcher.sol index ecaecee8..1f5237cb 100644 --- a/contracts/protocol/SocketBatcher.sol +++ b/contracts/protocol/SocketBatcher.sol @@ -37,7 +37,7 @@ contract SocketBatcher is ISocketBatcher, Ownable { * @param executeParams_ The execution parameters * @param digest_ The digest of the payload * @param proof_ The proof of the payload - * @param transmitterSignature_ The signature of the transmitter + * @param transmitterProof_ The signature of the transmitter * @return The return data after execution */ function attestAndExecute( @@ -45,7 +45,7 @@ contract SocketBatcher is ISocketBatcher, Ownable { address switchboard_, bytes32 digest_, bytes calldata proof_, - bytes calldata transmitterSignature_, + bytes calldata transmitterProof_, address refundAddress_ ) external payable returns (bool, bytes memory) { IFastSwitchboard(switchboard_).attest(digest_, proof_); @@ -53,7 +53,7 @@ contract SocketBatcher is ISocketBatcher, Ownable { socket__.execute{value: msg.value}( executeParams_, TransmissionParams({ - transmitterSignature: transmitterSignature_, + transmitterProof: transmitterProof_, socketFees: 0, extraData: executeParams_.extraData, refundAddress: refundAddress_ @@ -80,7 +80,7 @@ contract SocketBatcher is ISocketBatcher, Ownable { (bool success, bytes memory returnData) = socket__.execute{value: msg.value}( execParams_.executeParams, TransmissionParams({ - transmitterSignature: execParams_.transmitterSignature, + transmitterProof: execParams_.transmitterSignature, socketFees: 0, extraData: execParams_.executeParams.extraData, refundAddress: execParams_.refundAddress diff --git a/contracts/utils/common/Structs.sol b/contracts/utils/common/Structs.sol index 133324e5..aecf197b 100644 --- a/contracts/utils/common/Structs.sol +++ b/contracts/utils/common/Structs.sol @@ -99,7 +99,7 @@ struct TransmissionParams { uint256 socketFees; address refundAddress; bytes extraData; - bytes transmitterSignature; + bytes transmitterProof; } struct WatcherMultiCallParams { diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 7ba86c54..505d0f62 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -1449,7 +1449,7 @@ contract MessageSwitchboardSetup is DeploySetup { socketFees: 0, refundAddress: socketOwner, extraData: bytes(""), - transmitterSignature: bytes("") + transmitterProof: bytes("") }); optConfig.socket.execute(executeParams, transmissionParams); diff --git a/test/SocketFeeManager.t.sol b/test/SocketFeeManager.t.sol index eb6e6899..e696b95e 100644 --- a/test/SocketFeeManager.t.sol +++ b/test/SocketFeeManager.t.sol @@ -144,7 +144,7 @@ contract SocketFeeManagerTest is AppGatewayBaseSetup { }); TransmissionParams memory transmissionParams = TransmissionParams({ - transmitterSignature: bytes(""), + transmitterProof: bytes(""), socketFees: socketFees, extraData: bytes(""), refundAddress: transmitterEOA From d087e961b442661e786ff3fbe406a91b7d59c3cc Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 25 Jul 2025 00:54:34 +0530 Subject: [PATCH 045/139] fix: transmitter addr to bytes32 in digest --- contracts/evmx/watcher/precompiles/WritePrecompile.sol | 2 +- contracts/protocol/SocketUtils.sol | 2 +- contracts/protocol/switchboard/MessageSwitchboard.sol | 2 +- contracts/utils/common/Structs.sol | 2 +- test/SetupTest.t.sol | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index 9294f780..7e7c5919 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -177,7 +177,7 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc // create digest DigestParams memory digestParams_ = DigestParams( configurations__().sockets(transaction.chainSlug), - transmitter_, + toBytes32Format(transmitter_), payloadParams.payloadId, deadline, payloadParams.callType, diff --git a/contracts/protocol/SocketUtils.sol b/contracts/protocol/SocketUtils.sol index 46597144..3e23ede4 100644 --- a/contracts/protocol/SocketUtils.sol +++ b/contracts/protocol/SocketUtils.sol @@ -76,7 +76,7 @@ abstract contract SocketUtils is SocketConfig { keccak256( abi.encodePacked( toBytes32Format(address(this)), - transmitter_, + toBytes32Format(transmitter_), payloadId_, executeParams_.deadline, executeParams_.callType, diff --git a/contracts/protocol/switchboard/MessageSwitchboard.sol b/contracts/protocol/switchboard/MessageSwitchboard.sol index 0fe72dfd..549634eb 100644 --- a/contracts/protocol/switchboard/MessageSwitchboard.sol +++ b/contracts/protocol/switchboard/MessageSwitchboard.sol @@ -166,7 +166,7 @@ contract MessageSwitchboard is SwitchboardBase { digestParams = DigestParams({ socket: siblingSockets[dstChainSlug_], - transmitter: address(0), + transmitter: bytes32(0), payloadId: payloadId, deadline: block.timestamp + 3600, callType: WRITE, diff --git a/contracts/utils/common/Structs.sol b/contracts/utils/common/Structs.sol index aecf197b..4503068d 100644 --- a/contracts/utils/common/Structs.sol +++ b/contracts/utils/common/Structs.sol @@ -130,7 +130,7 @@ struct UserCredits { // digest: struct DigestParams { bytes32 socket; - address transmitter; + bytes32 transmitter; bytes32 payloadId; uint256 deadline; bytes4 callType; diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 505d0f62..ae6dac61 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -919,7 +919,7 @@ contract WatcherSetup is AuctionSetup { ); digestParams = DigestParams( toBytes32Format(address(getSocketConfig(transaction.chainSlug).socket)), - transmitterEOA, + toBytes32Format(transmitterEOA), payloadParams.payloadId, payloadParams.deadline, payloadParams.callType, @@ -1396,7 +1396,7 @@ contract MessageSwitchboardSetup is DeploySetup { bytes memory extraData = abi.encode(srcChainSlug_, toBytes32Format(srcPlug_)); digestParams = DigestParams({ socket: toBytes32Format(dstSocket_), - transmitter: address(0), + transmitter: bytes32(0), payloadId: payloadId_, deadline: block.timestamp + 3600, callType: WRITE, From 743519b12a528a4d3ca245fbb7462392df3f8e87 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 25 Jul 2025 00:56:47 +0530 Subject: [PATCH 046/139] feat: revert on receive --- contracts/protocol/Socket.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index fb4ec6d5..af37c697 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -218,6 +218,6 @@ contract Socket is SocketUtils { /// @notice Receive function that forwards all calls to Socket's callAppGateway receive() external payable { - // todo: handle receive + revert("Socket does not accept ETH"); } } From 07f6eebe94e22f5346b3c2e80e81a9153a730072 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 25 Jul 2025 01:11:01 +0530 Subject: [PATCH 047/139] feat: disconnect fn in socket --- contracts/evmx/plugs/FeesPlug.sol | 4 ++++ contracts/protocol/Socket.sol | 1 + contracts/protocol/SocketConfig.sol | 15 +++++++++++++++ contracts/protocol/base/PlugBase.sol | 3 +-- contracts/protocol/interfaces/ISocket.sol | 11 +++++++++++ test/FeesTest.t.sol | 6 ++---- test/mock/MockSocket.sol | 2 ++ 7 files changed, 36 insertions(+), 6 deletions(-) diff --git a/contracts/evmx/plugs/FeesPlug.sol b/contracts/evmx/plugs/FeesPlug.sol index 5c9f6124..b07942c8 100644 --- a/contracts/evmx/plugs/FeesPlug.sol +++ b/contracts/evmx/plugs/FeesPlug.sol @@ -124,6 +124,10 @@ contract FeesPlug is IFeesPlug, PlugBase, AccessControl { _connectSocket(appGatewayId_, socket_, switchboardId_); } + function disconnectSocket() external onlyOwner { + socket__.disconnect(); + } + /** * @notice Rescues funds from the contract if they are locked by mistake. This contract does not * theoretically need this function but it is added for safety. diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index af37c697..ad4939bd 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -218,6 +218,7 @@ contract Socket is SocketUtils { /// @notice Receive function that forwards all calls to Socket's callAppGateway receive() external payable { + // todo: need a fn to increase trigger fees revert("Socket does not accept ETH"); } } diff --git a/contracts/protocol/SocketConfig.sol b/contracts/protocol/SocketConfig.sol index d5fc01d9..974c8e88 100644 --- a/contracts/protocol/SocketConfig.sol +++ b/contracts/protocol/SocketConfig.sol @@ -41,6 +41,8 @@ abstract contract SocketConfig is ISocket, AccessControl { // @notice error triggered when a switchboard already exists error SwitchboardExists(); + // @notice error triggered when a plug is not connected + error PlugNotConnected(); // @notice event triggered when a new switchboard is added event SwitchboardAdded(address switchboard, uint64 switchboardId); @@ -48,6 +50,7 @@ abstract contract SocketConfig is ISocket, AccessControl { event SwitchboardDisabled(uint64 switchboardId); // @notice event triggered when a switchboard is enabled event SwitchboardEnabled(uint64 switchboardId); + // @notice event triggered when a socket fee manager is updated event SocketFeeManagerUpdated(address oldSocketFeeManager, address newSocketFeeManager); // @notice function to register a switchboard @@ -99,6 +102,18 @@ abstract contract SocketConfig is ISocket, AccessControl { emit PlugConnected(msg.sender, appGatewayId_, switchboardId_); } + /** + * @notice disconnects Plug from Socket + */ + function disconnect() external override { + PlugConfigEvm storage _plugConfig = _plugConfigs[msg.sender]; + if (_plugConfig.appGatewayId == bytes32(0)) revert PlugNotConnected(); + + _plugConfig.appGatewayId = bytes32(0); + _plugConfig.switchboardId = 0; + emit PlugDisconnected(msg.sender); + } + // @notice function to set the max copy bytes for socket // @dev only callable by governance role // @param maxCopyBytes_ max copy bytes for socket diff --git a/contracts/protocol/base/PlugBase.sol b/contracts/protocol/base/PlugBase.sol index 856ff24d..46c9bf9b 100644 --- a/contracts/protocol/base/PlugBase.sol +++ b/contracts/protocol/base/PlugBase.sol @@ -46,8 +46,7 @@ abstract contract PlugBase is IPlug { /// @notice Disconnects the plug from the socket function _disconnectSocket() internal { - (, uint64 switchboardId) = socket__.getPlugConfig(address(this)); - socket__.connect(bytes32(0), switchboardId); + socket__.disconnect(); emit ConnectorPlugDisconnected(); } diff --git a/contracts/protocol/interfaces/ISocket.sol b/contracts/protocol/interfaces/ISocket.sol index 7083c36a..04bc8d85 100644 --- a/contracts/protocol/interfaces/ISocket.sol +++ b/contracts/protocol/interfaces/ISocket.sol @@ -32,6 +32,12 @@ interface ISocket { */ event PlugConnected(address plug, bytes32 appGatewayId, uint64 switchboardId); + /** + * @notice emits the config set by a plug for a remoteChainSlug + * @param plug address of plug on current chain + */ + event PlugDisconnected(address plug); + /** * @notice emits the payload details when a new payload arrives at outbound * @param triggerId trigger id @@ -64,6 +70,11 @@ interface ISocket { */ function connect(bytes32 appGatewayId_, uint64 switchboardId_) external; + /** + * @notice disconnects Plug from Socket + */ + function disconnect() external; + /** * @notice registers a switchboard for the socket */ diff --git a/test/FeesTest.t.sol b/test/FeesTest.t.sol index 401f645b..7fdf9d3e 100644 --- a/test/FeesTest.t.sol +++ b/test/FeesTest.t.sol @@ -90,11 +90,9 @@ contract FeesTest is AppGatewayBaseSetup { } function testDisconnectFeesPlug() public { - uint64 sbId = arbConfig.switchboard.switchboardId(); - // disconnect old fees plug hoax(socketOwner); - arbConfig.feesPlug.connectSocket(bytes32(0), address(arbConfig.socket), sbId); + arbConfig.feesPlug.disconnectSocket(); hoax(watcherEOA); feesManager.setFeesPlug(arbChainSlug, bytes32(0)); @@ -133,7 +131,7 @@ contract FeesTest is AppGatewayBaseSetup { // disconnect old fees plug hoax(socketOwner); - oldFeesPlug.connectSocket(bytes32(0), address(arbConfig.socket), sbId); + oldFeesPlug.disconnectSocket(); // deploy new fees plug arbConfig.feesPlug = new FeesPlug(address(arbConfig.socket), address(socketOwner)); diff --git a/test/mock/MockSocket.sol b/test/mock/MockSocket.sol index 4910b242..a88f9b76 100644 --- a/test/mock/MockSocket.sol +++ b/test/mock/MockSocket.sol @@ -36,6 +36,8 @@ contract MockSocket is ISocket { function connect(bytes32 appGatewayId_, uint64 switchboardId_) external override {} + function disconnect() external override {} + function registerSwitchboard() external override returns (uint64 switchboardId) {} //////////////////////////////////////////////////////// From 74cbea219adc9121b3e631170a2fddb71305994d Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 25 Jul 2025 01:13:08 +0530 Subject: [PATCH 048/139] feat: dynamic gas limit buffer --- contracts/protocol/Socket.sol | 9 ++++----- contracts/protocol/SocketConfig.sol | 10 ++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index ad4939bd..02e33def 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -20,9 +20,6 @@ contract Socket is SocketUtils { // @notice mapping of payload id to execution status mapping(bytes32 => bytes32) public payloadIdToDigest; - // @notice buffer to account for gas used by current contract execution - uint256 private constant GAS_LIMIT_BUFFER = 105; - //////////////////////////////////////////////////////// ////////////////////// ERRORS ////////////////////////// //////////////////////////////////////////////////////// @@ -53,7 +50,9 @@ contract Socket is SocketUtils { uint32 chainSlug_, address owner_, string memory version_ - ) SocketUtils(chainSlug_, owner_, version_) {} + ) SocketUtils(chainSlug_, owner_, version_) { + gasLimitBuffer = 105; + } /** * @notice Executes a payload that has been delivered by transmitters and authenticated by switchboards @@ -136,7 +135,7 @@ contract Socket is SocketUtils { ) internal returns (bool success, bytes memory returnData) { // check if the gas limit is sufficient // bump by 5% to account for gas used by current contract execution - if (gasleft() < (executeParams_.gasLimit * GAS_LIMIT_BUFFER) / 100) revert LowGasLimit(); + if (gasleft() < (executeParams_.gasLimit * gasLimitBuffer) / 100) revert LowGasLimit(); // NOTE: external un-trusted call bool exceededMaxCopy; diff --git a/contracts/protocol/SocketConfig.sol b/contracts/protocol/SocketConfig.sol index 974c8e88..2a701b4a 100644 --- a/contracts/protocol/SocketConfig.sol +++ b/contracts/protocol/SocketConfig.sol @@ -39,6 +39,9 @@ abstract contract SocketConfig is ISocket, AccessControl { // @notice mapping of switchboard address to its id mapping(address => uint64) public switchboardIds; + // @notice buffer to account for gas used by current contract execution + uint256 public gasLimitBuffer; + // @notice error triggered when a switchboard already exists error SwitchboardExists(); // @notice error triggered when a plug is not connected @@ -114,6 +117,13 @@ abstract contract SocketConfig is ISocket, AccessControl { emit PlugDisconnected(msg.sender); } + // @notice function to set the gas limit buffer for socket + // @dev only callable by governance role + // @param gasLimitBuffer_ gas limit buffer for socket + function setGasLimitBuffer(uint256 gasLimitBuffer_) external onlyRole(GOVERNANCE_ROLE) { + gasLimitBuffer = gasLimitBuffer_; + } + // @notice function to set the max copy bytes for socket // @dev only callable by governance role // @param maxCopyBytes_ max copy bytes for socket From 02a1c6e0d94e28e84ef145c5aabe80ddf149b64f Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 25 Jul 2025 01:30:01 +0530 Subject: [PATCH 049/139] feat: trigger function --- contracts/protocol/Socket.sol | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index 02e33def..ad3f97dd 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -179,10 +179,20 @@ contract Socket is SocketUtils { //////////////////////////////////////////////////////// ////////////////////// Trigger ////////////////////// //////////////////////////////////////////////////////// + + /// @notice To trigger to a connected remote chain. Should only be called by a plug. + function triggerAppGateway(bytes calldata data_) external payable returns (bytes32 triggerId) { + triggerId = _triggerAppGateway(msg.sender, msg.value, data_); + } + /** * @notice To trigger to a connected remote chain. Should only be called by a plug. */ - function _triggerAppGateway(address plug_) internal returns (bytes32 triggerId) { + function _triggerAppGateway( + address plug_, + uint256 value_, + bytes calldata data_ + ) internal returns (bytes32 triggerId) { PlugConfigEvm memory plugConfig = _plugConfigs[plug_]; // if no sibling plug is found for the given chain slug, revert @@ -190,13 +200,16 @@ contract Socket is SocketUtils { if (isValidSwitchboard[plugConfig.switchboardId] != SwitchboardStatus.REGISTERED) revert InvalidSwitchboard(); - bytes memory plugOverrides = IPlug(msg.sender).overrides(); + bytes memory plugOverrides = IPlug(plug_).overrides(); triggerId = _encodeTriggerId(); // todo: need gas limit? - ISwitchboard(switchboardAddresses[plugConfig.switchboardId]).processTrigger{ - value: msg.value - }(msg.sender, triggerId, msg.data, plugOverrides); + ISwitchboard(switchboardAddresses[plugConfig.switchboardId]).processTrigger{value: value_}( + plug_, + triggerId, + data_, + plugOverrides + ); emit AppGatewayCallRequested( triggerId, @@ -204,7 +217,7 @@ contract Socket is SocketUtils { plugConfig.switchboardId, toBytes32Format(plug_), plugOverrides, - msg.data + data_ ); } @@ -212,7 +225,7 @@ contract Socket is SocketUtils { /// @dev The calldata is passed as-is to the gateways fallback(bytes calldata) external payable returns (bytes memory) { // return the trigger id - return abi.encode(_triggerAppGateway(msg.sender)); + return abi.encode(_triggerAppGateway(msg.sender, msg.value, msg.data)); } /// @notice Receive function that forwards all calls to Socket's callAppGateway From 327937c1941a70363a588ffa35ac09d5ee0cd192 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 14:58:19 +0530 Subject: [PATCH 050/139] fix: deploy scripts --- hardhat-scripts/admin/disable-sb.ts | 6 +- hardhat-scripts/admin/disconnect.ts | 36 +++--- hardhat-scripts/config/config.ts | 2 +- hardhat-scripts/constants/constants.ts | 7 +- hardhat-scripts/constants/types.ts | 2 +- hardhat-scripts/deploy/1.deploy.ts | 10 ++ hardhat-scripts/deploy/2.roles.ts | 1 + hardhat-scripts/deploy/3.configureChains.ts | 126 ++++++++++++++++---- hardhat-scripts/deploy/6.connect.ts | 20 ++-- hardhat-scripts/utils/appConfig.ts | 9 +- hardhat-scripts/utils/sign.ts | 1 + src/enums.ts | 4 + src/types.ts | 4 + 13 files changed, 165 insertions(+), 63 deletions(-) diff --git a/hardhat-scripts/admin/disable-sb.ts b/hardhat-scripts/admin/disable-sb.ts index d327cfa2..edd24d1c 100644 --- a/hardhat-scripts/admin/disable-sb.ts +++ b/hardhat-scripts/admin/disable-sb.ts @@ -1,4 +1,4 @@ -import { constants, Wallet } from "ethers"; +import { Wallet } from "ethers"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; import { chains, EVMX_CHAIN_ID, mode } from "../config"; import { DeploymentAddresses, FAST_SWITCHBOARD_TYPE } from "../constants"; @@ -68,9 +68,9 @@ export const disableSBOnEVMx = async (chain: number, watcherSigner: Wallet) => { Contracts.Configurations, "switchboards", [chain, FAST_SWITCHBOARD_TYPE], - constants.AddressZero, + "0", "setSwitchboard", - [chain, FAST_SWITCHBOARD_TYPE, constants.AddressZero], + [chain, FAST_SWITCHBOARD_TYPE, 0], watcherSigner ); } catch (error) { diff --git a/hardhat-scripts/admin/disconnect.ts b/hardhat-scripts/admin/disconnect.ts index e5931ca5..2a92d701 100644 --- a/hardhat-scripts/admin/disconnect.ts +++ b/hardhat-scripts/admin/disconnect.ts @@ -4,7 +4,7 @@ import { chains, EVMX_CHAIN_ID, getFeesPlugChains, mode } from "../config"; import { AppGatewayConfig, DeploymentAddresses, - ZERO_APP_GATEWAY_ID, + BYTES32_ZERO, } from "../constants"; import { checkIfAddressExists, @@ -12,6 +12,7 @@ import { getInstance, getSocketSigner, overrides, + toBytes32FormatHexString, } from "../utils"; import { getWatcherSigner, sendWatcherMultiCallWithNonce } from "../utils/sign"; import { isConfigSetOnEVMx, isConfigSetOnSocket } from "../utils"; @@ -50,22 +51,17 @@ async function disconnectPlug( checkIfAddressExists(switchboard, "Switchboard"); // Check if config is already set - if ( - await isConfigSetOnSocket(plug, socket, ZERO_APP_GATEWAY_ID, switchboard) - ) { + if (await isConfigSetOnSocket(plug, socket, BYTES32_ZERO, switchboard)) { console.log(`${plugContract} Socket Config on ${chain} already set!`); return; } // Connect the plug - const tx = await plug.functions["connectSocket"]( - ZERO_APP_GATEWAY_ID, - socket.address, - switchboard, - { ...(await overrides(chain as ChainSlug)) } - ); + const tx = await plug.functions["disconnectSocket"]({ + ...(await overrides(chain as ChainSlug)), + }); console.log( - `Connecting ${plugContract} on ${chain} to ${ZERO_APP_GATEWAY_ID} tx hash: ${tx.hash}` + `Disconnecting ${plugContract} on ${chain} to ${BYTES32_ZERO} tx hash: ${tx.hash}` ); await tx.wait(); } @@ -119,8 +115,8 @@ export const updateConfigEVMx = async () => { if (feesPlugChains.includes(chain) || !addresses[chain]) return; const addr = addresses[chain]!; - const appGatewayId = ZERO_APP_GATEWAY_ID; - const switchboard = constants.AddressZero; + const appGatewayId = BYTES32_ZERO; + const switchboardId = "0"; const plugContract = Contracts.FeesPlug; if (!addr[plugContract]) return; @@ -131,7 +127,7 @@ export const updateConfigEVMx = async () => { chain, addr[plugContract], appGatewayId, - switchboard + switchboardId ) ) { console.log(`Config already set on ${chain} for ${plugContract}`); @@ -139,9 +135,9 @@ export const updateConfigEVMx = async () => { appConfigs.push({ plugConfig: { appGatewayId: appGatewayId, - switchboard: switchboard, + switchboardId: switchboardId, }, - plug: addr[plugContract], + plug: toBytes32FormatHexString(addr[plugContract]), chainSlug: chain, }); } @@ -149,15 +145,17 @@ export const updateConfigEVMx = async () => { // update fees manager const currentFeesPlug = await feesManagerContract.feesPlugs(chain); - if (currentFeesPlug === constants.AddressZero) { + if (currentFeesPlug.toString() === BYTES32_ZERO.toString()) { console.log(`Fees plug already set on ${chain}`); return; } const tx = await feesManagerContract.functions["setFeesPlug"]( Number(chain), - constants.AddressZero, - { ...(await overrides(EVMX_CHAIN_ID as ChainSlug)) } + BYTES32_ZERO, + { + ...(await overrides(EVMX_CHAIN_ID as ChainSlug)), + } ); console.log(`Updating Fees Manager tx hash: ${tx.hash}`); await tx.wait(); diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 5d78ae70..84614961 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -35,7 +35,7 @@ export const getChains = () => { return [ ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA, - ChainSlug.BASE_SEPOLIA, + // ChainSlug.BASE_SEPOLIA, ]; case DeploymentMode.STAGE: return [ diff --git a/hardhat-scripts/constants/constants.ts b/hardhat-scripts/constants/constants.ts index 168d2b47..a7719397 100644 --- a/hardhat-scripts/constants/constants.ts +++ b/hardhat-scripts/constants/constants.ts @@ -9,7 +9,6 @@ export const IMPLEMENTATION_SLOT = export const FAST_SWITCHBOARD_TYPE = id("FAST"); export const CCTP_SWITCHBOARD_TYPE = id("CCTP"); -export const ZERO_APP_GATEWAY_ID = ethers.utils.hexZeroPad( - constants.AddressZero, - 32 -); +export const BYTES32_ZERO = ethers.utils.hexZeroPad(constants.AddressZero, 32); + +export const MSG_SB_FEES = "100000000"; diff --git a/hardhat-scripts/constants/types.ts b/hardhat-scripts/constants/types.ts index 3e41d235..612ff879 100644 --- a/hardhat-scripts/constants/types.ts +++ b/hardhat-scripts/constants/types.ts @@ -16,7 +16,7 @@ export interface WatcherMultiCallParams { export type AppGatewayConfig = { plugConfig: { appGatewayId: string; - switchboard: string; + switchboardId: string; }; plug: string; chainSlug: number; diff --git a/hardhat-scripts/deploy/1.deploy.ts b/hardhat-scripts/deploy/1.deploy.ts index 641e3a64..3e11dbef 100644 --- a/hardhat-scripts/deploy/1.deploy.ts +++ b/hardhat-scripts/deploy/1.deploy.ts @@ -342,6 +342,16 @@ const deploySocketContracts = async () => { ); deployUtils.addresses[contractName] = cctpSwitchboard.address; + contractName = Contracts.MessageSwitchboard; + const messageSwitchboard: Contract = await getOrDeploy( + contractName, + contractName, + `contracts/protocol/switchboard/${contractName}.sol`, + [chain as ChainSlug, socket.address, socketOwner], + deployUtils + ); + deployUtils.addresses[contractName] = messageSwitchboard.address; + if (getFeesPlugChains().includes(chain as ChainSlug)) { contractName = Contracts.FeesPlug; const feesPlug: Contract = await getOrDeploy( diff --git a/hardhat-scripts/deploy/2.roles.ts b/hardhat-scripts/deploy/2.roles.ts index 99db548c..8150ca15 100644 --- a/hardhat-scripts/deploy/2.roles.ts +++ b/hardhat-scripts/deploy/2.roles.ts @@ -17,6 +17,7 @@ export const REQUIRED_ROLES = { Chain: { FastSwitchboard: [ROLES.WATCHER_ROLE, ROLES.RESCUE_ROLE], CCTPSwitchboard: [ROLES.WATCHER_ROLE, ROLES.RESCUE_ROLE], + MessageSwitchboard: [ROLES.WATCHER_ROLE, ROLES.RESCUE_ROLE], Socket: [ ROLES.GOVERNANCE_ROLE, ROLES.RESCUE_ROLE, diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index d1484731..5bc8798a 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -21,14 +21,16 @@ import { DeploymentAddresses, FAST_SWITCHBOARD_TYPE, getFeeTokens, + MSG_SB_FEES, } from "../constants"; import { + DeployParams, getAddresses, getInstance, getSocketSigner, getWatcherSigner, overrides, - toBytes32Format, + storeAddresses, toBytes32FormatHexString, updateContractSettings, } from "../utils"; @@ -49,26 +51,43 @@ export const configureChains = async (addresses: DeploymentAddresses) => { let chainAddresses: ChainAddressesObj = addresses[chain] ? (addresses[chain] as ChainAddressesObj) : ({} as ChainAddressesObj); - const signer: Wallet = getSocketSigner(chain as ChainSlug); + let deployUtils: DeployParams = { + addresses: chainAddresses, + mode, + signer: signer, + currentChainSlug: chain as ChainSlug, + }; + const socketContract = ( await getInstance(Contracts.Socket, chainAddresses[Contracts.Socket]) ).connect(signer); - await registerSb( + const fastSwitchboardId = await registerSb( chain, chainAddresses[Contracts.FastSwitchboard], signer, socketContract ); + deployUtils.addresses[Contracts.FastSwitchboardId] = fastSwitchboardId; - await registerSb( + const cctpSwitchboardId = await registerSb( chain, chainAddresses[Contracts.CCTPSwitchboard], signer, socketContract ); + deployUtils.addresses[Contracts.CCTPSwitchboardId] = cctpSwitchboardId; + + const messageSwitchboardId = await registerSb( + chain, + chainAddresses[Contracts.MessageSwitchboard], + signer, + socketContract + ); + deployUtils.addresses[Contracts.MessageSwitchboardId] = + messageSwitchboardId; if (chainAddresses[Contracts.FeesPlug]) { await whitelistToken(chain, chainAddresses[Contracts.FeesPlug], signer); @@ -76,7 +95,12 @@ export const configureChains = async (addresses: DeploymentAddresses) => { await setMaxMsgValueLimit(chain); - await setOnchainContracts(chain, addresses); + await setOnchainContracts( + chain, + addresses, + fastSwitchboardId, + cctpSwitchboardId + ); await addRemoteEndpointsToCCTPSwitchboard( chain, @@ -84,6 +108,9 @@ export const configureChains = async (addresses: DeploymentAddresses) => { signer, socketContract ); + + await setSiblingConfig(chain, addresses, signer, socketContract); + await storeAddresses(deployUtils.addresses, chain, mode); } }; @@ -104,15 +131,14 @@ export const setMaxMsgValueLimit = async (chain: number) => { async function setOnchainContracts( chain: number, - addresses: DeploymentAddresses + addresses: DeploymentAddresses, + fastSwitchboardId: string, + cctpSwitchboardId: string ) { console.log("Setting onchain contracts"); const signer: Wallet = getWatcherSigner(); const chainAddresses = addresses[chain] as ChainAddressesObj; - const switchboard = toBytes32FormatHexString( - chainAddresses[Contracts.FastSwitchboard] - ); const socket = toBytes32FormatHexString(chainAddresses[Contracts.Socket]); const feesPlug = toBytes32FormatHexString( chainAddresses[Contracts.FeesPlug]! @@ -126,9 +152,9 @@ async function setOnchainContracts( Contracts.Configurations, "switchboards", [chain, FAST_SWITCHBOARD_TYPE], - switchboard, + fastSwitchboardId, "setSwitchboard", - [chain, FAST_SWITCHBOARD_TYPE, toBytes32Format(switchboard)], + [chain, FAST_SWITCHBOARD_TYPE, fastSwitchboardId], signer ); @@ -137,19 +163,20 @@ async function setOnchainContracts( Contracts.Configurations, "switchboards", [chain, CCTP_SWITCHBOARD_TYPE], - chainAddresses[Contracts.CCTPSwitchboard], + cctpSwitchboardId, "setSwitchboard", - [chain, CCTP_SWITCHBOARD_TYPE, chainAddresses[Contracts.CCTPSwitchboard]], + [chain, CCTP_SWITCHBOARD_TYPE, cctpSwitchboardId], signer ); + await updateContractSettings( EVMX_CHAIN_ID, Contracts.Configurations, "sockets", [chain], - socket, + toBytes32FormatHexString(socket), "setSocket", - [chain, socket], + [chain, toBytes32FormatHexString(socket)], signer ); @@ -159,9 +186,9 @@ async function setOnchainContracts( Contracts.FeesManager, "feesPlugs", [chain], - feesPlug, + toBytes32FormatHexString(feesPlug).toString(), "setFeesPlug", - [chain, toBytes32Format(feesPlug)], + [chain, toBytes32FormatHexString(feesPlug)], signer ); @@ -170,13 +197,66 @@ async function setOnchainContracts( Contracts.WritePrecompile, "contractFactoryPlugs", [chain], - contractFactory, + toBytes32FormatHexString(contractFactory).toString(), "setContractFactoryPlugs", - [chain, toBytes32Format(contractFactory)], + [chain, toBytes32FormatHexString(contractFactory)], signer ); } +const setSiblingConfig = async ( + chain: number, + addresses: DeploymentAddresses, + signer: Wallet, + socket: Contract +) => { + try { + console.log("Setting sibling config"); + const chainAddresses = addresses[chain] as ChainAddressesObj; + const sbAddress = chainAddresses[Contracts.MessageSwitchboard]; + const switchboard = ( + await getInstance(Contracts.MessageSwitchboard, sbAddress) + ).connect(signer); + + const remoteChainSlugs = getRemoteChainSlugs(chain); + + for (const remoteChainSlug of remoteChainSlugs) { + const remoteSwitchboardAddress = + addresses[remoteChainSlug]?.[Contracts.MessageSwitchboard]; + + if (!remoteSwitchboardAddress) { + console.log( + `Remote switchboard address not found for ${remoteChainSlug}` + ); + continue; + } + + const remoteSocket = addresses[remoteChainSlug]?.[Contracts.Socket]; + + if (!remoteSocket) { + console.log(`Remote socket address not found for ${remoteChainSlug}`); + continue; + } + + const registerTx = await switchboard.setSiblingConfig( + remoteChainSlug, + MSG_SB_FEES, + toBytes32FormatHexString(remoteSocket), + toBytes32FormatHexString(remoteSwitchboardAddress), + { + ...(await overrides(chain)), + } + ); + console.log( + `Setting sibling config ${remoteChainSlug} to ${sbAddress}: ${registerTx.hash}` + ); + await registerTx.wait(); + } + } catch (error) { + throw error; + } +}; + const addRemoteEndpointsToCCTPSwitchboard = async ( chain: number, addresses: DeploymentAddresses, @@ -246,7 +326,8 @@ const registerSb = async ( sbAddress: string, signer: Wallet, socket: Contract -) => { +): Promise => { + let switchboardId: string = "0"; try { console.log("Registering switchboard"); // used fast switchboard here as all have same function signature @@ -267,7 +348,12 @@ const registerSb = async ( }); console.log(`Registering Switchboard ${sbAddress}: ${registerTx.hash}`); await registerTx.wait(); + + switchboardId = await switchboard.switchboardId(); + console.log(`Switchboard ID: ${switchboardId}`); } + + return switchboardId; } catch (error) { throw error; } diff --git a/hardhat-scripts/deploy/6.connect.ts b/hardhat-scripts/deploy/6.connect.ts index 5d427734..b5812421 100644 --- a/hardhat-scripts/deploy/6.connect.ts +++ b/hardhat-scripts/deploy/6.connect.ts @@ -45,13 +45,13 @@ async function connectPlug( await getInstance(Contracts.Socket, addr[Contracts.Socket]) ).connect(socketSigner); - // Get switchboard and app gateway addresses - const switchboard = addr[Contracts.FastSwitchboard]; - checkIfAddressExists(switchboard, "Switchboard"); + // Get switchboard id and app gateway addresses + const switchboardId = addr[Contracts.FastSwitchboardId]; + checkIfAddressExists(switchboardId, "SwitchboardId"); const appGatewayId = getAppGatewayId(plugContract, addresses); checkIfAppGatewayIdExists(appGatewayId, "AppGatewayId"); // Check if config is already set - if (await isConfigSetOnSocket(plug, socket, appGatewayId, switchboard)) { + if (await isConfigSetOnSocket(plug, socket, appGatewayId, switchboardId)) { console.log(`${plugContract} Socket Config on ${chain} already set!`); return; } @@ -60,7 +60,7 @@ async function connectPlug( const tx = await plug.functions["connectSocket"]( appGatewayId, socket.address, - switchboard, + switchboardId, { ...(await overrides(chain)) } ); console.log( @@ -114,11 +114,9 @@ export const updateConfigEVMx = async () => { for (const plugContract of plugs) { const appGatewayId = getAppGatewayId(plugContract, addresses); - const switchboardBytes32Hex = toBytes32FormatHexString( - addr[Contracts.FastSwitchboard] - ); + const switchboardId = addr[Contracts.FastSwitchboardId]; const plugBytes32Hex = toBytes32FormatHexString(addr[plugContract]); - // checkIfAddressExists(switchboard, "Switchboard"); + checkIfAddressExists(switchboardId, "SwitchboardId"); checkIfAppGatewayIdExists(appGatewayId, "AppGatewayId"); if (!addr[plugContract]) { @@ -132,7 +130,7 @@ export const updateConfigEVMx = async () => { chain, plugBytes32Hex, appGatewayId, - switchboardBytes32Hex + switchboardId ) ) { console.log(`Config already set on ${chain} for ${plugContract}`); @@ -141,7 +139,7 @@ export const updateConfigEVMx = async () => { appConfigs.push({ plugConfig: { appGatewayId: appGatewayId, - switchboard: switchboardBytes32Hex, + switchboardId: switchboardId, }, plug: plugBytes32Hex, chainSlug: chain, diff --git a/hardhat-scripts/utils/appConfig.ts b/hardhat-scripts/utils/appConfig.ts index 0172655f..636e7884 100644 --- a/hardhat-scripts/utils/appConfig.ts +++ b/hardhat-scripts/utils/appConfig.ts @@ -5,13 +5,14 @@ export const isConfigSetOnSocket = async ( plug: Contract, socket: Contract, appGatewayId: string, - switchboard: string + switchboardId: string ) => { const plugConfigRegistered = await socket.getPlugConfig(plug.address); return ( plugConfigRegistered.appGatewayId.toLowerCase() === appGatewayId.toLowerCase() && - plugConfigRegistered.switchboard.toLowerCase() === switchboard.toLowerCase() + plugConfigRegistered.switchboardId.toLowerCase() === + switchboardId.toLowerCase() ); }; @@ -20,7 +21,7 @@ export const isConfigSetOnEVMx = async ( chain: number, plug: string, appGatewayId: string, - switchboard: string + switchboardId: string ) => { const plugConfigRegistered = await watcher.getPlugConfigs( chain, @@ -28,6 +29,6 @@ export const isConfigSetOnEVMx = async ( ); return ( plugConfigRegistered[0].toLowerCase() === appGatewayId?.toLowerCase() && - plugConfigRegistered[1].toLowerCase() === switchboard.toLowerCase() + plugConfigRegistered[1].toLowerCase() === switchboardId.toLowerCase() ); }; diff --git a/hardhat-scripts/utils/sign.ts b/hardhat-scripts/utils/sign.ts index 00afdcb4..01bcb6e5 100644 --- a/hardhat-scripts/utils/sign.ts +++ b/hardhat-scripts/utils/sign.ts @@ -62,6 +62,7 @@ export const sendWatcherMultiCallWithNonce = async ( nonce, signature, }; + // Call watcherMultiCall function with single call data return await watcherContract.watcherMultiCall([params], { ...(await overrides(EVMX_CHAIN_ID as ChainSlug)), diff --git a/src/enums.ts b/src/enums.ts index a9bcceac..e9b3f49b 100644 --- a/src/enums.ts +++ b/src/enums.ts @@ -55,7 +55,11 @@ export enum Contracts { FeesPlug = "FeesPlug", ContractFactoryPlug = "ContractFactoryPlug", FastSwitchboard = "FastSwitchboard", + FastSwitchboardId = "FastSwitchboardId", CCTPSwitchboard = "CCTPSwitchboard", + CCTPSwitchboardId = "CCTPSwitchboardId", + MessageSwitchboard = "MessageSwitchboard", + MessageSwitchboardId = "MessageSwitchboardId", SocketBatcher = "SocketBatcher", SocketFeeManager = "SocketFeeManager", AddressResolver = "AddressResolver", diff --git a/src/types.ts b/src/types.ts index ba32e046..ba31d81e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -20,6 +20,10 @@ export type ChainAddressesObj = { SocketBatcher: string; FastSwitchboard: string; CCTPSwitchboard: string; + MessageSwitchboard: string; + FastSwitchboardId: string; + CCTPSwitchboardId: string; + MessageSwitchboardId: string; ContractFactoryPlug: string; SocketFeesManager?: string; FeesPlug?: string; From 31fb72ed0bbb795296a5563ad6add3905a0245cb Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 15:49:13 +0530 Subject: [PATCH 051/139] fix: sb id as input in batcher --- contracts/protocol/SocketBatcher.sol | 12 ++++++------ contracts/protocol/interfaces/ISocketBatcher.sol | 2 +- test/SetupTest.t.sol | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/contracts/protocol/SocketBatcher.sol b/contracts/protocol/SocketBatcher.sol index 1f5237cb..85710e77 100644 --- a/contracts/protocol/SocketBatcher.sol +++ b/contracts/protocol/SocketBatcher.sol @@ -42,13 +42,13 @@ contract SocketBatcher is ISocketBatcher, Ownable { */ function attestAndExecute( ExecuteParams calldata executeParams_, - address switchboard_, + uint64 switchboardId_, bytes32 digest_, bytes calldata proof_, bytes calldata transmitterProof_, address refundAddress_ ) external payable returns (bool, bytes memory) { - IFastSwitchboard(switchboard_).attest(digest_, proof_); + IFastSwitchboard(socket__.switchboardAddresses(switchboardId_)).attest(digest_, proof_); return socket__.execute{value: msg.value}( executeParams_, @@ -64,15 +64,15 @@ contract SocketBatcher is ISocketBatcher, Ownable { function attestCCTPAndProveAndExecute( CCTPExecutionParams calldata execParams_, CCTPBatchParams calldata cctpParams_, - uint64 switchboardId_, - address switchboard_ + uint64 switchboardId_ ) external payable returns (bool, bytes memory) { + address switchboard = socket__.switchboardAddresses(switchboardId_); bytes32 payloadId = createPayloadId( execParams_.executeParams.payloadPointer, switchboardId_, socket__.chainSlug() ); - ICCTPSwitchboard(switchboard_).attestVerifyAndProveExecutions( + ICCTPSwitchboard(switchboard).attestVerifyAndProveExecutions( execParams_, cctpParams_, payloadId @@ -87,7 +87,7 @@ contract SocketBatcher is ISocketBatcher, Ownable { }) ); - ICCTPSwitchboard(switchboard_).syncOut(payloadId, cctpParams_.nextBatchRemoteChainSlugs); + ICCTPSwitchboard(switchboard).syncOut(payloadId, cctpParams_.nextBatchRemoteChainSlugs); return (success, returnData); } diff --git a/contracts/protocol/interfaces/ISocketBatcher.sol b/contracts/protocol/interfaces/ISocketBatcher.sol index dfd146ac..662a477e 100644 --- a/contracts/protocol/interfaces/ISocketBatcher.sol +++ b/contracts/protocol/interfaces/ISocketBatcher.sol @@ -18,7 +18,7 @@ interface ISocketBatcher { */ function attestAndExecute( ExecuteParams calldata executeParams_, - address switchboard_, + uint64 switchboardId_, bytes32 digest_, bytes calldata proof_, bytes calldata transmitterSignature_, diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index ae6dac61..303935a2 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -967,7 +967,7 @@ contract WatcherSetup is AuctionSetup { if (switchboard == getSocketConfig(chainSlug).switchboard.switchboardId()) { (success, returnData) = getSocketConfig(chainSlug).socketBatcher.attestAndExecute( executeParams, - address(getSocketConfig(chainSlug).switchboard), + getSocketConfig(chainSlug).switchboard.switchboardId(), digest, watcherProof, transmitterSig, @@ -1010,8 +1010,7 @@ contract WatcherSetup is AuctionSetup { refundAddress: transmitterEOA }), cctpBatchParams, - getSocketConfig(chainSlug).cctpSwitchboard.switchboardId(), - address(getSocketConfig(chainSlug).cctpSwitchboard) + getSocketConfig(chainSlug).cctpSwitchboard.switchboardId() ); } From 52943d198fed66986a170c52b9e7bf9afbea3787 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 15:50:07 +0530 Subject: [PATCH 052/139] fix: scripts --- hardhat-scripts/constants/feeConstants.ts | 2 +- hardhat-scripts/deploy/3.configureChains.ts | 10 +++++----- hardhat-scripts/deploy/6.connect.ts | 2 -- hardhat-scripts/utils/appConfig.ts | 5 ++--- hardhat-scripts/utils/overrides.ts | 6 +++--- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index 66ddb4dd..0d0ce6be 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -20,7 +20,7 @@ const tokens: TokenMap = { const feePools: { [key: string]: string } = { [DeploymentMode.LOCAL]: "0x9De353dD1131aB4e502590D3a1832652FA316268", - [DeploymentMode.DEV]: "0xc20Be67ef742202dc93A78aa741E7C3715eA1DFd", + [DeploymentMode.DEV]: "0x13A3018920c7b56B20dd34E29C298121025E6de4", [DeploymentMode.STAGE]: "0xe2054B575664dfDBD7a7FbAf2B12420ae88DE0FF", }; diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 5bc8798a..b466bf52 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -70,7 +70,7 @@ export const configureChains = async (addresses: DeploymentAddresses) => { signer, socketContract ); - deployUtils.addresses[Contracts.FastSwitchboardId] = fastSwitchboardId; + deployUtils.addresses[Contracts.FastSwitchboardId] = fastSwitchboardId.toString(); const cctpSwitchboardId = await registerSb( chain, @@ -78,7 +78,7 @@ export const configureChains = async (addresses: DeploymentAddresses) => { signer, socketContract ); - deployUtils.addresses[Contracts.CCTPSwitchboardId] = cctpSwitchboardId; + deployUtils.addresses[Contracts.CCTPSwitchboardId] = cctpSwitchboardId.toString(); const messageSwitchboardId = await registerSb( chain, @@ -87,7 +87,7 @@ export const configureChains = async (addresses: DeploymentAddresses) => { socketContract ); deployUtils.addresses[Contracts.MessageSwitchboardId] = - messageSwitchboardId; + messageSwitchboardId.toString(); if (chainAddresses[Contracts.FeesPlug]) { await whitelistToken(chain, chainAddresses[Contracts.FeesPlug], signer); @@ -338,11 +338,11 @@ const registerSb = async ( // send overrides while reading capacitor to avoid errors on mantle chain // some chains give balance error if gas price is used with from address as zero // therefore override from address as well - let sb = await socket.isValidSwitchboard(sbAddress, { + switchboardId = await socket.switchboardIds(sbAddress, { from: signer.address, }); - if (Number(sb) == 0) { + if (Number(switchboardId) == 0) { const registerTx = await switchboard.registerSwitchboard({ ...(await overrides(chain)), }); diff --git a/hardhat-scripts/deploy/6.connect.ts b/hardhat-scripts/deploy/6.connect.ts index b5812421..a04fd0de 100644 --- a/hardhat-scripts/deploy/6.connect.ts +++ b/hardhat-scripts/deploy/6.connect.ts @@ -47,7 +47,6 @@ async function connectPlug( // Get switchboard id and app gateway addresses const switchboardId = addr[Contracts.FastSwitchboardId]; - checkIfAddressExists(switchboardId, "SwitchboardId"); const appGatewayId = getAppGatewayId(plugContract, addresses); checkIfAppGatewayIdExists(appGatewayId, "AppGatewayId"); // Check if config is already set @@ -116,7 +115,6 @@ export const updateConfigEVMx = async () => { const appGatewayId = getAppGatewayId(plugContract, addresses); const switchboardId = addr[Contracts.FastSwitchboardId]; const plugBytes32Hex = toBytes32FormatHexString(addr[plugContract]); - checkIfAddressExists(switchboardId, "SwitchboardId"); checkIfAppGatewayIdExists(appGatewayId, "AppGatewayId"); if (!addr[plugContract]) { diff --git a/hardhat-scripts/utils/appConfig.ts b/hardhat-scripts/utils/appConfig.ts index 636e7884..7b612e55 100644 --- a/hardhat-scripts/utils/appConfig.ts +++ b/hardhat-scripts/utils/appConfig.ts @@ -10,9 +10,8 @@ export const isConfigSetOnSocket = async ( const plugConfigRegistered = await socket.getPlugConfig(plug.address); return ( plugConfigRegistered.appGatewayId.toLowerCase() === - appGatewayId.toLowerCase() && - plugConfigRegistered.switchboardId.toLowerCase() === - switchboardId.toLowerCase() + appGatewayId.toLowerCase() && + plugConfigRegistered.switchboardId.toString() === switchboardId ); }; diff --git a/hardhat-scripts/utils/overrides.ts b/hardhat-scripts/utils/overrides.ts index 5d49ab6e..cc8383d2 100644 --- a/hardhat-scripts/utils/overrides.ts +++ b/hardhat-scripts/utils/overrides.ts @@ -34,9 +34,9 @@ export const chainOverrides: { gasPrice: 100_629_157, }, [EVMX_CHAIN_ID as ChainSlug]: { - type: 0, - // gasLimit: 1_000_000_000, - gasPrice: 0, + // type: 0, + // // gasLimit: 1_000_000_000, + // gasPrice: 0, }, }; From 64da9013f86f26a5b6b05004d797a4b792fd8d11 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 15:56:10 +0530 Subject: [PATCH 053/139] feat: dev deployments --- deployments/dev_addresses.json | 93 +++++----- deployments/dev_verification.json | 285 +++++++++++++++++------------ hardhat-scripts/utils/appConfig.ts | 2 +- 3 files changed, 218 insertions(+), 162 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index e41f9235..748be2a2 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -1,55 +1,54 @@ { - "84532": { - "CCTPSwitchboard": "0xb2B779ab8FC851bCE986d25B2824933B0Cd101d9", - "ContractFactoryPlug": "0x2e0fE75Bd247d7441f279388CD0e3a77FEcddADf", - "FastSwitchboard": "0xaFFfaD81e6DDE509Bd83Ab2024225b2FF537BeA7", - "FeesPlug": "0x1dc20d27F06876cA74ee4e2E9a4724f06a4a5E54", - "Socket": "0x9B06e2Dae351ed8B1112C036e5c306E8fBe4C9c5", - "SocketBatcher": "0xd627BFe7d2fCAC1147c996a6F2CAaB2E1e1bD344", - "startBlock": 27234828 - }, "421614": { - "CCTPSwitchboard": "0x74A4aa989515b088A1aC33C5D59897f69cA66B91", - "ContractFactoryPlug": "0x25190648330361f35d00a0D41BD347de8E1B838C", - "FastSwitchboard": "0x39d21e679312Bf0e3681bd0254c587E3528dd2a3", - "FeesPlug": "0xe9BDa44a39F8d29eaF1956EB05442551794871f3", - "Socket": "0x86264607bAD260e9032add9e4E2DA74f71E354E0", - "SocketBatcher": "0x5B83E4104E37c7ECDf6Aeb62a4E204E4c63ac8D5", - "startBlock": 157984273 + "CCTPSwitchboard": "0xaF912b7eaD59f5d8c8179f8606A3fa93459a612C", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0x2784a207d51DD8c1A5323C05Fb868B68a854326C", + "FastSwitchboard": "0xd8DDEA0c49C0bcbFD31272c262a4b31FfB44a8Bc", + "FastSwitchboardId": "1", + "FeesPlug": "0x3CFe3e7eCc62232B3d29454DCABeE4f2B921e3a2", + "MessageSwitchboard": "0x0C049f6Dd92eA5dA05058b9B309755Cb347587C9", + "MessageSwitchboardId": "3", + "Socket": "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", + "SocketBatcher": "0xd726FeF96aD21AAD24443FAE933DDa9c79716a93", + "startBlock": 178158322 }, "7625382": { - "AddressResolver": "0x67790E222c41b0E787C278e757b7c40f03Fa5709", - "AddressResolverImpl": "0x89C928379fED43B7117b852931e2968ce39C8380", - "AsyncDeployer": "0x1C70bc3043667e884222B8835E0Ae554eb512810", - "AsyncDeployerImpl": "0x09a762309c63a4e19cd3d822aA340Fe964Ba9C92", - "AuctionManager": "0xC12aDF88dfc116CAF88816d150FE498843dABEEe", - "AuctionManagerImpl": "0x55b76897b3BF6ED04188cbaa7DC21ae14b35D3eE", - "Configurations": "0x377431bD1A3321C401542C8B1EC6E0c23E125042", - "ConfigurationsImpl": "0xDe5DedAe6e17f906D1269D5e84BEfB06F3926310", - "DeployForwarder": "0xd48218b2DafF9063177b0c6Bae229ec6C5f086a9", - "DeployForwarderImpl": "0x8e178161BB3B36a28C15DFBe3142afF8757B8993", - "ERC1967Factory": "0x870fCA8803bEFd119B1317AFB6794F97af7e515e", - "FeesManager": "0x761A9024D267006061ec943d02e3949678906f3E", - "FeesManagerImpl": "0x29C583B64FD2d7b70f8F6253C2a28D60af364Cb5", - "FeesPool": "0x9De353dD1131aB4e502590D3a1832652FA316268", - "PromiseResolver": "0x73b1B3dF6C71e0aa912f9d6933920D4461ae9718", - "ReadPrecompile": "0x58f49313816c1876417EE53De8F5de047359fB2C", - "RequestHandler": "0x63a6D7096b5a2F5c9Ce7D8632A7A2034A85b7F01", - "RequestHandlerImpl": "0x593f4844ceEA828bC6d9D78A0ef7Ce64F42190dC", - "SchedulePrecompile": "0xF77d2059a66026Efac11334D30372429553CAaC3", - "startBlock": 8626651, - "Watcher": "0xe4D1B4B8c0eEE90ac1f5314e758446CBa201BBA8", - "WatcherImpl": "0x7726e559A5129A9174f89F7E2029f7212B66dD13", - "WritePrecompile": "0xd8be408E271EEe9d3D0f28305bB9b6003589E1A9", - "WritePrecompileImpl": "0xE24c4b0f67f566Fa558b3FE85f1780CD330f1F4D" + "AddressResolver": "0xaBD3955e51bd83ACe4f9F403517F95be706A0424", + "AddressResolverImpl": "0x8fa6EF5A80E4Eca1302d2dfB85ae151275a4eA6A", + "AsyncDeployer": "0xDcb9387DB4675C585a9a2CB55C15F7fD96E3eae6", + "AsyncDeployerImpl": "0xcdbA9Ad5Da86d61a69ea94a52210C1f2008A849f", + "AuctionManager": "0x2C1A9c2aBcAc6468f4D828665093192807Bc31be", + "AuctionManagerImpl": "0x32a6E6F8c09823d8F8ddB285346b2c61Ed1F03b8", + "Configurations": "0xA551ea338E12F20EF47374DbdbfeAf83b14Ea615", + "ConfigurationsImpl": "0xbb163A49239260a5BE19f6aD9B5839f11F6aC24F", + "DeployForwarder": "0xA802b0F34379Ed2eD850c9906C7F32E3348c38AE", + "DeployForwarderImpl": "0x2682de36DFBf618dBEdFa4d18c265bdc04F7C9bb", + "ERC1967Factory": "0x32767D5390C2CD3619799c66f9F4E426c317Cd2F", + "FeesManager": "0x13079557a25aD9EdD85025D77e172f75ac8f2C92", + "FeesManagerImpl": "0x8DA71DE564096Ea4A43E794E1dEcA8F1692B69D7", + "FeesPool": "0x13A3018920c7b56B20dd34E29C298121025E6de4", + "PromiseResolver": "0xe0047f9b97c4C73948fe23F1bA807FE7906040C0", + "ReadPrecompile": "0x8D8770876e587300828Bc2B235C89F06CE473170", + "RequestHandler": "0x23B719aDd0CEeC1A5A05c3789204886E1A94c612", + "RequestHandlerImpl": "0x95aB9c53FDa2ad009B6698d814735D0030796805", + "SchedulePrecompile": "0x1D530df25aE08F7A440CA155c9d53540C2c50A82", + "startBlock": 10845, + "Watcher": "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB", + "WatcherImpl": "0x26d5DFaaB493292c7d2Cc8C1eD447bd944127935", + "WritePrecompile": "0x239C1fCdB2B45EB65dE80836Bcf13d1f12d7f320", + "WritePrecompileImpl": "0x4F1FB4E9169f4A604e3eb9833987338D48B8Dd77" }, "11155420": { - "CCTPSwitchboard": "0xf9A93a92c0754084f6320f3fC1D54584C2e0439d", - "ContractFactoryPlug": "0xAA78A6c96DF690d30eF161490f6590fCAb8f4406", - "FastSwitchboard": "0x696d7d0Af367cFE3d3c56BD61ca16B3A0939618b", - "FeesPlug": "0xC6Fb338F2009B5AD1e1bbA2dd2c9f52e9dE2C91C", - "Socket": "0x4B5718c1f739A83EF5c75f64776f2c9D4D460B1D", - "SocketBatcher": "0xc9E18b73C1A575D8A5975754a01CD19BE8400037", - "startBlock": 28356082 + "CCTPSwitchboard": "0x1801b7e2E553c7233c2fd7c9e8647f6b91ff7a76", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0xC5B314127DFa001f00e5773EA55765A9007320a6", + "FastSwitchboard": "0x9f1DE81ff3274eD6678a5A1644F430b06EF0992D", + "FastSwitchboardId": "1", + "FeesPlug": "0x72708A701Fa94B8a1746c2ED1A1dd41C56dA7b33", + "MessageSwitchboard": "0xE3756057aEd63488Acbfa6DC31a3E99bFBcf0d4A", + "MessageSwitchboardId": "3", + "Socket": "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", + "SocketBatcher": "0x87C9a09e05D0D2A885eb7B2644c3CBB8E70763b6", + "startBlock": 30946234 } } diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index d491459d..cac99a23 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1,224 +1,281 @@ { - "421614": [], - "7625382": [ - [ - "0x5b460B29750648f6D569Ed57139967BE589174F8", - "FeesManager", - "contracts/evmx/fees/FeesManager.sol", - [] - ], - [ - "0x872bb254118a2210e3C491918133F2ab4D7Bc362", - "Watcher", - "contracts/evmx/watcher/Watcher.sol", - [] - ], + "421614": [ [ - "0x7D6F2A4aDf7e5Cfcf9627CC7FCA1d39fD19C07fc", - "SchedulePrecompile", - "contracts/evmx/watcher/precompiles/SchedulePrecompile.sol", + "0xd726FeF96aD21AAD24443FAE933DDa9c79716a93", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", [ - "0xD5b30DC89D96ee7303Dc2726491996B46089F693", - 86400, - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - 300 + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B" ] ], [ - "0x254Dc9e0623426A79F02D2001E367cd32B50aaaA", - "ReadPrecompile", - "contracts/evmx/watcher/precompiles/ReadPrecompile.sol", + "0x2784a207d51DD8c1A5323C05Fb868B68a854326C", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", [ - "0xD5b30DC89D96ee7303Dc2726491996B46089F693", - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - 300 + "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" ] ], [ - "0xD3aEb53da0a72788C16eAf5a23a5aBae6708C073", - "WritePrecompile", - "contracts/evmx/watcher/precompiles/WritePrecompile.sol", - [] - ], - [ - "0xcfFda1dF8668266E6A77809EcA9CCA8A632ecaF3", - "PromiseResolver", - "contracts/evmx/watcher/PromiseResolver.sol", - ["0xD5b30DC89D96ee7303Dc2726491996B46089F693"] - ], - [ - "0x3d9578B252ed1F5A66348Cc40E482dacc32Ae790", - "RequestHandler", - "contracts/evmx/watcher/RequestHandler.sol", - [] + "0x3CFe3e7eCc62232B3d29454DCABeE4f2B921e3a2", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] ], [ - "0x0d2646fC08af29A7799Af435c5ABBA1b020C4dC7", - "Configurations", - "contracts/evmx/watcher/Configurations.sol", - [] + "0x0C049f6Dd92eA5dA05058b9B309755Cb347587C9", + "MessageSwitchboard", + "contracts/protocol/switchboard/MessageSwitchboard.sol", + [ + 421614, + "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] ], [ - "0xCe95fca954a0BF43c299c79d5152f2c164C02b7A", - "DeployForwarder", - "contracts/evmx/helpers/DeployForwarder.sol", - [] + "0xaF912b7eaD59f5d8c8179f8606A3fa93459a612C", + "CCTPSwitchboard", + "contracts/protocol/switchboard/CCTPSwitchboard.sol", + [ + 421614, + "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaCF1ceeF35caAc005e15888dDb8A3515C41B4872" + ] ], [ - "0x42109F6212765ABeb589f9b2c14Bee4b8DB3e638", - "AuctionManager", - "contracts/evmx/AuctionManager.sol", - [] + "0xd8DDEA0c49C0bcbFD31272c262a4b31FfB44a8Bc", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 421614, + "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] ], [ - "0xFa9B9271A4153eEABa76ae10bfc4F128651c25D7", - "Watcher", - "contracts/evmx/watcher/Watcher.sol", - [] + "0xA2a494e206cEf22e3F2f65e45dd05114ACca43C9", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B" + ] ], [ - "0x80CFbD3B6134Fb2D2B7d21FC132a9F7c115e7B72", - "AsyncDeployer", - "contracts/evmx/helpers/AsyncDeployer.sol", - [] - ], + "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", + "Socket", + "contracts/protocol/Socket.sol", + [ + 421614, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "7625382": [ [ - "0x6975302A1B7aF61d89F85a13855B66D15221Cf8D", + "0x8DA71DE564096Ea4A43E794E1dEcA8F1692B69D7", "FeesManager", "contracts/evmx/fees/FeesManager.sol", [] ], [ - "0x91e548d87768313C03da8405D01171b83912c430", - "AddressResolver", - "contracts/evmx/helpers/AddressResolver.sol", - [] - ], - [ - "0xb0364Fd8f158071831ac87E7EE2C792Ab509a524", - "ERC1967Factory", - "lib/solady/src/utils/ERC1967Factory.sol", - [] + "0x13A3018920c7b56B20dd34E29C298121025E6de4", + "FeesPool", + "contracts/evmx/fees/FeesPool.sol", + [ + "0xb62505feacC486e809392c65614Ce4d7b051923b" + ] ], [ - "0x09A1A0A7BB8266171855871c4c0Af200a30922BE", - "WritePrecompile", - "contracts/evmx/watcher/precompiles/WritePrecompile.sol", + "0xC3f93140EF2f57a87FDdCe7DdADB544873b67C7D", + "FeesManager", + "contracts/evmx/fees/FeesManager.sol", [] ], [ - "0xDa60303321dc6aA8AeF32557bDe914008a3196eC", + "0x1D530df25aE08F7A440CA155c9d53540C2c50A82", "SchedulePrecompile", "contracts/evmx/watcher/precompiles/SchedulePrecompile.sol", [ - "0x60005b459Dc46D9a63bcb61D01Ad002130644a4F", + "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB", 86400, { "type": "BigNumber", - "hex": "0xe8d4a51000" + "hex": "0x02540be400" }, { "type": "BigNumber", "hex": "0xe8d4a51000" }, - 300 + 3600 ] ], [ - "0xddeEDDD5F156123fDbf77B86A66A043568AEfcda", + "0x8D8770876e587300828Bc2B235C89F06CE473170", "ReadPrecompile", "contracts/evmx/watcher/precompiles/ReadPrecompile.sol", [ - "0x60005b459Dc46D9a63bcb61D01Ad002130644a4F", + "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB", { "type": "BigNumber", "hex": "0xe8d4a51000" }, - 300 + 3600 ] ], [ - "0xb64D07B0dDb23cc54eE5EDe294E0cD15f08CC971", + "0x4F1FB4E9169f4A604e3eb9833987338D48B8Dd77", "WritePrecompile", "contracts/evmx/watcher/precompiles/WritePrecompile.sol", [] ], [ - "0xF24B41A8C9F814d70FAD9E617CE32C74EcCB1A25", + "0xe0047f9b97c4C73948fe23F1bA807FE7906040C0", "PromiseResolver", "contracts/evmx/watcher/PromiseResolver.sol", - ["0x60005b459Dc46D9a63bcb61D01Ad002130644a4F"] + [ + "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB" + ] ], [ - "0x1fa5D12C7dC1F3615c28B842A6053f5f151230F8", + "0x95aB9c53FDa2ad009B6698d814735D0030796805", "RequestHandler", "contracts/evmx/watcher/RequestHandler.sol", [] ], [ - "0x8d41aBDbE6Bbd208D68Dd4E671c4B72474525C7B", + "0xbb163A49239260a5BE19f6aD9B5839f11F6aC24F", "Configurations", "contracts/evmx/watcher/Configurations.sol", [] ], [ - "0xD9CF47342c8a256fcD8B51aaABA810cd5D05F726", + "0x2682de36DFBf618dBEdFa4d18c265bdc04F7C9bb", "DeployForwarder", "contracts/evmx/helpers/DeployForwarder.sol", [] ], [ - "0x1C40B5d5f6E9be1Ca4557d92cb7dba35e721a322", + "0x32a6E6F8c09823d8F8ddB285346b2c61Ed1F03b8", "AuctionManager", "contracts/evmx/AuctionManager.sol", [] ], [ - "0x812EcdF5366036B045e41Fe2dD95B72ecc26d8f3", + "0x26d5DFaaB493292c7d2Cc8C1eD447bd944127935", "Watcher", "contracts/evmx/watcher/Watcher.sol", [] ], [ - "0xF4f5606189Bc091528680b2ca1c82167641d3cAf", + "0xcdbA9Ad5Da86d61a69ea94a52210C1f2008A849f", "AsyncDeployer", "contracts/evmx/helpers/AsyncDeployer.sol", [] ], [ - "0x255fBaD02F8f2Aae0Faf7074249a8701371890D2", + "0xBD3d78023FAf3590fFcF65013b5cC058Efeb13C8", "FeesManager", "contracts/evmx/fees/FeesManager.sol", [] ], [ - "0x865A24Cf706027639124489e0dA2A28766efB96A", + "0x8fa6EF5A80E4Eca1302d2dfB85ae151275a4eA6A", "AddressResolver", "contracts/evmx/helpers/AddressResolver.sol", [] ], [ - "0xc20Be67ef742202dc93A78aa741E7C3715eA1DFd", - "FeesPool", - "contracts/evmx/fees/FeesPool.sol", - ["0xb62505feacC486e809392c65614Ce4d7b051923b"] - ], - [ - "0x1b0F1aA38F8BBbe779A6C1fCe7e3Ff00380fa9CE", + "0x32767D5390C2CD3619799c66f9F4E426c317Cd2F", "ERC1967Factory", "lib/solady/src/utils/ERC1967Factory.sol", [] ] ], - "11155420": [] + "11155420": [ + [ + "0x87C9a09e05D0D2A885eb7B2644c3CBB8E70763b6", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073" + ] + ], + [ + "0xC5B314127DFa001f00e5773EA55765A9007320a6", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x72708A701Fa94B8a1746c2ED1A1dd41C56dA7b33", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xE3756057aEd63488Acbfa6DC31a3E99bFBcf0d4A", + "MessageSwitchboard", + "contracts/protocol/switchboard/MessageSwitchboard.sol", + [ + 11155420, + "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x1801b7e2E553c7233c2fd7c9e8647f6b91ff7a76", + "CCTPSwitchboard", + "contracts/protocol/switchboard/CCTPSwitchboard.sol", + [ + 11155420, + "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD" + ] + ], + [ + "0x9f1DE81ff3274eD6678a5A1644F430b06EF0992D", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 11155420, + "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xE261C9c292101da254B9E52430a2EB9728BFD60A", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073" + ] + ], + [ + "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", + "Socket", + "contracts/protocol/Socket.sol", + [ + 11155420, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ] } diff --git a/hardhat-scripts/utils/appConfig.ts b/hardhat-scripts/utils/appConfig.ts index 7b612e55..f61f3337 100644 --- a/hardhat-scripts/utils/appConfig.ts +++ b/hardhat-scripts/utils/appConfig.ts @@ -28,6 +28,6 @@ export const isConfigSetOnEVMx = async ( ); return ( plugConfigRegistered[0].toLowerCase() === appGatewayId?.toLowerCase() && - plugConfigRegistered[1].toLowerCase() === switchboardId.toLowerCase() + plugConfigRegistered[1].toString() === switchboardId.toString() ); }; From fc69064a724684a8b6838c67d9a0bc77fe39316d Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 15:57:45 +0530 Subject: [PATCH 054/139] chore: update readme and fix lint --- Errors.md | 30 ++++-- EventTopics.md | 62 ++++++++---- FunctionSignatures.md | 103 +++++++++++++------- foundry.toml | 47 +++++---- hardhat-scripts/deploy/3.configureChains.ts | 6 +- hardhat-scripts/utils/appConfig.ts | 2 +- 6 files changed, 159 insertions(+), 91 deletions(-) diff --git a/Errors.md b/Errors.md index 7b6fd946..ae06096c 100644 --- a/Errors.md +++ b/Errors.md @@ -32,12 +32,6 @@ | `InvalidDepositAmount()` | `0xfe9ba5cd` | | `TokenNotWhitelisted(address)` | `0xea3bff2e` | -## evmx/watcher/Configurations.sol - -| Error | Signature | -| ----------------------------------------- | ------------ | -| `InvalidSwitchboardTest(bytes32,bytes32)` | `0x702f36a1` | - ## evmx/watcher/RequestHandler.sol | Error | Signature | @@ -55,10 +49,10 @@ ## protocol/SocketConfig.sol -| Error | Signature | -| ------------------------------- | ------------ | -| `SwitchboardExists()` | `0x2dff8555` | -| `SwitchboardExistsOrDisabled()` | `0x1c7d2487` | +| Error | Signature | +| --------------------- | ------------ | +| `SwitchboardExists()` | `0x2dff8555` | +| `PlugNotConnected()` | `0x411d0255` | ## protocol/SocketFeeManager.sol @@ -74,6 +68,12 @@ | `OnlyOffChain()` | `0x9cbfe066` | | `SimulationFailed()` | `0x2fbab3ac` | +## protocol/base/MessagePlugBase.sol + +| Error | Signature | +| ---------------- | ------------ | +| `NotSupported()` | `0xa0387940` | + ## protocol/switchboard/CCTPSwitchboard.sol | Error | Signature | @@ -92,6 +92,16 @@ | `AlreadyAttested()` | `0x35d90805` | | `WatcherNotFound()` | `0xa278e4ad` | +## protocol/switchboard/MessageSwitchboard.sol + +| Error | Signature | +| ----------------------------- | ------------ | +| `AlreadyAttested()` | `0x35d90805` | +| `WatcherNotFound()` | `0xa278e4ad` | +| `SiblingNotFound()` | `0xb3b47851` | +| `InvalidTargetVerification()` | `0xe9377a19` | +| `InvalidMsgValue()` | `0x1841b4e1` | + ## utils/AccessControl.sol | Error | Signature | diff --git a/EventTopics.md b/EventTopics.md index 73f06674..0a408806 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -19,21 +19,27 @@ ## Socket -| Event | Arguments | Topic | -| ---------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `AppGatewayCallRequested` | `(triggerId: bytes32, appGatewayId: bytes32, switchboard: bytes32, plug: bytes32, overrides: bytes, payload: bytes)` | `0xf83cee1d13047d8a1785495ac352da7c9ac5725641f76506899def19750c7696` | -| `ExecutionFailed` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x385334bc68a32c4d164625189adc7633e6074eb1b837fb4d11d768245151e4ce` | -| `ExecutionSuccess` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x324d63a433b21a12b90e79cd2ba736b2a5238be6165e03b750fa4a7d5193d5d9` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `PlugConnected` | `(plug: address, appGatewayId: bytes32, switchboard: address)` | `0x90c5924e27cfb6e3a688e729083681f30494ae2615ae14aac3bc807a0c436a88` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SocketFeeManagerUpdated` | `(oldSocketFeeManager: address, newSocketFeeManager: address)` | `0xdcb02e10d5220346a4638aa2826eaab1897306623bc40a427049e4ebd12255b4` | -| `SwitchboardAdded` | `(switchboard: address)` | `0x1595852923edfbbf906f09fc8523e4cfb022a194773c4d1509446b614146ee88` | -| `SwitchboardDisabled` | `(switchboard: address)` | `0x1b4ee41596b4e754e5665f01ed6122b356f7b36ea0a02030804fac7fa0fdddfc` | -| `SwitchboardEnabled` | `(switchboard: address)` | `0x6909a9974e3eec619bc479ba882d30a5ef1219b72ab1ce6a354516e91be317b8` | +| Event | Arguments | Topic | +| ---------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `AppGatewayCallRequested` | `(triggerId: bytes32, appGatewayId: bytes32, switchboardId: uint64, plug: bytes32, overrides: bytes, payload: bytes)` | `0x8ff0599581fd62c5733e52cea3abd7874731f4a9f86ebb929e5e4afe103f74d4` | +| `ExecutionFailed` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x385334bc68a32c4d164625189adc7633e6074eb1b837fb4d11d768245151e4ce` | +| `ExecutionSuccess` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x324d63a433b21a12b90e79cd2ba736b2a5238be6165e03b750fa4a7d5193d5d9` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `PlugConnected` | `(plug: address, appGatewayId: bytes32, switchboardId: uint64)` | `0xb2a45daaee4fc6ced936700efec176684095e7b77c4cb1419b578ecc6f2ebce6` | +| `PlugDisconnected` | `(plug: address)` | `0x474a53f61630e976f47075b6029ba8d55d0563151bdb9222c5dbdc88f7af6f51` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SocketFeeManagerUpdated` | `(oldSocketFeeManager: address, newSocketFeeManager: address)` | `0xdcb02e10d5220346a4638aa2826eaab1897306623bc40a427049e4ebd12255b4` | +| `SwitchboardAdded` | `(switchboard: address, switchboardId: uint64)` | `0x2f945cce0a82eacc4841d996b3d0429e01c7c603f3f900253d21b428c760dce1` | +| `SwitchboardDisabled` | `(switchboardId: uint64)` | `0x9ab25a32266417ee52a390121ebca0463374e76cecb25596a0f68e9d96a9e0ff` | +| `SwitchboardEnabled` | `(switchboardId: uint64)` | `0xa1cea6c3e73c288db1f2e2d7f04d9fd5f12463c30019b4ed354ba8bc7bc26f28` | + +## IFastSwitchboard + +| Event | Arguments | Topic | +| ----- | --------- | ----- | ## SocketBatcher @@ -186,7 +192,7 @@ | `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | | `PlugAdded` | `(appGatewayId: bytes32, chainSlug: uint32, plug: bytes32)` | `0x3734a2406c5c2f2556c82a0819c51e42a135dd102465cc9856594481ea2f1637` | | `SocketSet` | `(chainSlug: uint32, socket: bytes32)` | `0x3200bf6ad2ab31b9220ed9d2f83089d7a1332f55aaa3825c57510743a315165b` | -| `SwitchboardSet` | `(chainSlug: uint32, sbType: bytes32, switchboard: bytes32)` | `0xcdfbfa261040f4dffb03c7d9493f74b575f2ae533bb43fd7b5d5b24ac9d804f4` | +| `SwitchboardSet` | `(chainSlug: uint32, sbType: bytes32, switchboardId: uint64)` | `0x5aeb296e3ed47512d11032a96d11f93d8538b9eb87aa1db45d412e7165d6850a` | ## PromiseResolver @@ -208,7 +214,7 @@ | `RequestCancelled` | `(requestCount: uint40)` | `0xff191657769be72fc08def44c645014c60d18cb24b9ca05c9a33406a28253245` | | `RequestCompletedWithErrors` | `(requestCount: uint40)` | `0xd8d9915dc14b5a29b66cb263e1ea1e99e60418fc21d97f0fbf09cae1281291e2` | | `RequestSettled` | `(requestCount: uint40, winner: address)` | `0x1234f98acbe1548b214f4528461a5377f1e2349569c04caa59325e488e7d2aa4` | -| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0x762bac43d5d7689b8911c5654a9d5550804373cead33bc98282067e6166e518f` | +| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0xb730ca5523e3f80e88b4bb71e1e78d447553069cd9a7143bb0032b957135b530` | ## Watcher @@ -224,6 +230,11 @@ | `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | | `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | +## IMessageSwitchboard + +| Event | Arguments | Topic | +| ----- | --------- | ----- | + ## ICCTPSwitchboard | Event | Arguments | Topic | @@ -251,6 +262,21 @@ | `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | | `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +## MessageSwitchboard + +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Attested` | `(payloadId: bytes32, digest: bytes32, watcher: address)` | `0x2f8e66b1207a4b70274a2a3da88ffb5737c8214576490da1b35acc38b2d62db6` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SiblingConfigSet` | `(chainSlug: uint32, fee: uint256, socket: bytes32, switchboard: bytes32)` | `0xc34c3d0f0300f406c0f0608f6f6d70b36f5e90ccd1f1e1065bbe899f64cc81f0` | +| `SiblingRegistered` | `(chainSlug: uint32, plugAddress: address, siblingPlug: bytes32)` | `0xbb232aa6c0cb95b30a887c06b678538c818d3eac0dfd4d83299a18867cae220b` | +| `SwitchboardFeesSet` | `(chainSlug: uint32, feeAmount: uint256)` | `0x5e544c79c5017ebf2ea6aa546cd1c37272d5b4335247f0ceaabef51903dc5260` | +| `TriggerProcessed` | `(dstChainSlug: uint32, switchboardFees: uint256, digest: bytes32, digestParams: tuple)` | `0x0d585f64e2ebf6cc2b04ccbbaf63459f3b52c84111559988d28d6872185caa32` | + ## ReadPrecompile | Event | Arguments | Topic | @@ -282,5 +308,5 @@ | `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | | `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | | `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WriteProofRequested` | `(transmitter: address, digest: bytes32, prevBatchDigestHash: bytes32, deadline: uint256, payloadParams: tuple)` | `0x3247df5b4e8df4ac60c2c1f803b404ee16bc9d84a6b7649865464a8a397b9acb` | +| `WriteProofRequested` | `(transmitter: address, digest: bytes32, prevBatchDigestHash: bytes32, deadline: uint256, payloadParams: tuple)` | `0xe3e3e322b3c2964670f4b62d06647c2f711440be782105fc1c0a60cc934bb40a` | | `WriteProofUploaded` | `(payloadId: bytes32, proof: bytes)` | `0xd8fe3a99a88c9630360418877afdf14e3e79f0f25fee162aeb230633ea740156` | diff --git a/FunctionSignatures.md b/FunctionSignatures.md index 8f333d53..e929f6b7 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -58,14 +58,16 @@ | `cancelOwnershipHandover` | `0x54d1f13d` | | `chainSlug` | `0xb349ba65` | | `completeOwnershipHandover` | `0xf04e283e` | -| `connect` | `0xb3bde1aa` | -| `disableSwitchboard` | `0xc4d9a820` | -| `enableSwitchboard` | `0xf97a498a` | -| `execute` | `0xafa8b480` | +| `connect` | `0xf3aebe4d` | +| `disableSwitchboard` | `0x25e94caf` | +| `disconnect` | `0xd9374bff` | +| `enableSwitchboard` | `0xea072f06` | +| `execute` | `0x2e4d89fb` | +| `gasLimitBuffer` | `0xe4d728f0` | | `getPlugConfig` | `0xf9778ee0` | | `grantRole` | `0x2f2ff15d` | | `hasRole` | `0x91d14854` | -| `isValidSwitchboard` | `0xb2d67675` | +| `isValidSwitchboard` | `0xb30fe8ff` | | `maxCopyBytes` | `0x212249d4` | | `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | @@ -76,30 +78,19 @@ | `requestOwnershipHandover` | `0x25692962` | | `rescueFunds` | `0x6ccae054` | | `revokeRole` | `0xd547741f` | +| `setGasLimitBuffer` | `0x1f0cfa78` | | `setMaxCopyBytes` | `0x4fc7d6e9` | | `setSocketFeeManager` | `0x25bd97e5` | | `simulate` | `0x91bf8275` | | `socketFeeManager` | `0xde5b8838` | +| `switchboardAddresses` | `0x9cf0af93` | +| `switchboardIdCounter` | `0x5f850dfd` | +| `switchboardIds` | `0x91db23d3` | | `transferOwnership` | `0xf2fde38b` | +| `triggerAppGateway` | `0x29e654e1` | | `triggerCounter` | `0x8b0021de` | | `version` | `0x54fd4d50` | -## SocketBatcher - -| Function | Signature | -| ------------------------------ | ------------ | -| `attestAndExecute` | `0x66c7748a` | -| `attestCCTPAndProveAndExecute` | `0x6c5fd05f` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | - ## SocketFeeManager | Function | Signature | @@ -111,7 +102,7 @@ | `hasRole` | `0x91d14854` | | `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payAndCheckFees` | `0xd9d29ae3` | +| `payAndCheckFees` | `0x0b2b48ed` | | `renounceOwnership` | `0x715018a6` | | `requestOwnershipHandover` | `0x25692962` | | `rescueFunds` | `0x6ccae054` | @@ -339,12 +330,12 @@ | `appGatewayId` | `0x1c335f49` | | `cancelOwnershipHandover` | `0x54d1f13d` | | `completeOwnershipHandover` | `0xf04e283e` | -| `connectSocket` | `0x258d19c8` | -| `deployContract` | `0xa0695389` | +| `connectSocket` | `0x943103c3` | +| `deployContract` | `0xff8caf37` | | `getAddress` | `0x94ca2cb5` | | `grantRole` | `0x2f2ff15d` | | `hasRole` | `0x91d14854` | -| `initSocket` | `0xa07d8545` | +| `initSocket` | `0x18b7ff72` | | `isSocketInitialized` | `0x9a7d9a9b` | | `overrides` | `0x4a85f041` | | `owner` | `0x8da5cb5b` | @@ -370,10 +361,10 @@ | `renounceOwnership` | `0x715018a6` | | `requestOwnershipHandover` | `0x25692962` | | `rescueFunds` | `0x6ccae054` | -| `setAppGatewayConfigs` | `0xebfb22cd` | +| `setAppGatewayConfigs` | `0x831c8195` | | `setIsValidPlug` | `0x4842c37a` | | `setSocket` | `0x38d4de67` | -| `setSwitchboard` | `0x491eac1f` | +| `setSwitchboard` | `0x4fc059a0` | | `sockets` | `0xb44a23ab` | | `switchboards` | `0xaa539546` | | `transferOwnership` | `0xf2fde38b` | @@ -481,12 +472,13 @@ | `allowPacket` | `0x21e9ec80` | | `allowPayload` | `0x31c23f66` | | `attest` | `0x63671b60` | -| `attestVerifyAndProveExecutions` | `0x3e9e97e2` | +| `attestVerifyAndProveExecutions` | `0x6c913e2f` | | `cancelOwnershipHandover` | `0x54d1f13d` | | `chainSlug` | `0xb349ba65` | | `chainSlugToRemoteEndpoint` | `0xa4500424` | | `completeOwnershipHandover` | `0xf04e283e` | | `domainToRemoteEndpoint` | `0xc24964fe` | +| `getTransmitter` | `0x73e7d880` | | `grantRole` | `0x2f2ff15d` | | `handleReceiveMessage` | `0x96abeb70` | | `hasRole` | `0x91d14854` | @@ -496,7 +488,8 @@ | `messageTransmitter` | `0x7b04c181` | | `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `proveRemoteExecutions` | `0xc36f2ca2` | +| `processTrigger` | `0x7f3352bc` | +| `proveRemoteExecutions` | `0x893289f8` | | `registerSwitchboard` | `0x74f5b1fc` | | `remoteExecutedDigests` | `0xecbf77d9` | | `renounceOwnership` | `0x715018a6` | @@ -504,6 +497,7 @@ | `rescueFunds` | `0x6ccae054` | | `revokeRole` | `0xd547741f` | | `socket__` | `0xc6a261d2` | +| `switchboardId` | `0xd3be4120` | | `syncOut` | `0x69a60ff0` | | `transferOwnership` | `0xf2fde38b` | | `verifyAttestations` | `0x6f30514c` | @@ -517,17 +511,54 @@ | `cancelOwnershipHandover` | `0x54d1f13d` | | `chainSlug` | `0xb349ba65` | | `completeOwnershipHandover` | `0xf04e283e` | +| `getTransmitter` | `0x73e7d880` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `processTrigger` | `0x7f3352bc` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `switchboardId` | `0xd3be4120` | +| `transferOwnership` | `0xf2fde38b` | + +## MessageSwitchboard + +| Function | Signature | +| ---------------------------- | ------------ | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x4cc621d2` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getSwitchboardFees` | `0x99de43bf` | +| `getTransmitter` | `0x73e7d880` | | `grantRole` | `0x2f2ff15d` | | `hasRole` | `0x91d14854` | | `isAttested` | `0xc13c2396` | | `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `payloadCounter` | `0x550ce1d5` | +| `processTrigger` | `0x7f3352bc` | +| `registerSibling` | `0x4f58b88c` | | `registerSwitchboard` | `0x74f5b1fc` | | `renounceOwnership` | `0x715018a6` | | `requestOwnershipHandover` | `0x25692962` | | `rescueFunds` | `0x6ccae054` | | `revokeRole` | `0xd547741f` | +| `setSiblingConfig` | `0xacfbfc03` | +| `setSwitchboardFees` | `0x476bfc49` | +| `siblingPlugs` | `0x25fc3bcc` | +| `siblingSockets` | `0xce3483a5` | +| `siblingSwitchboards` | `0x51de49c9` | | `socket__` | `0xc6a261d2` | +| `switchboardFees` | `0xb2a71ee7` | +| `switchboardId` | `0xd3be4120` | | `transferOwnership` | `0xf2fde38b` | ## ReadPrecompile @@ -536,10 +567,10 @@ | ------------------------------ | ------------ | | `expiryTime` | `0x99bc0aea` | | `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x1d5e1d98` | +| `handlePayload` | `0x62974d96` | | `readFees` | `0xe06357a2` | | `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0xea92e825` | +| `resolvePayload` | `0x7f0b2207` | | `setExpiryTime` | `0x30fc4cff` | | `setFees` | `0x3d18678e` | | `validateAndGetPrecompileData` | `0x997f5bef` | @@ -551,10 +582,10 @@ | ------------------------------ | ------------ | | `expiryTime` | `0x99bc0aea` | | `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x1d5e1d98` | +| `handlePayload` | `0x62974d96` | | `maxScheduleDelayInSeconds` | `0x3ef01cdb` | | `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0xea92e825` | +| `resolvePayload` | `0x7f0b2207` | | `scheduleCallbackFees` | `0x4c5b6007` | | `scheduleFeesPerSecond` | `0x852a74c1` | | `setExpiryTime` | `0x30fc4cff` | @@ -574,17 +605,17 @@ | `contractFactoryPlugs` | `0x35426631` | | `digestHashes` | `0xd1a862bf` | | `expiryTime` | `0x99bc0aea` | -| `getDigest` | `0x91b6288b` | +| `getDigest` | `0x3554edc7` | | `getPrecompileFees` | `0xb7a3d04c` | | `getPrevBatchDigestHash` | `0x372863a1` | -| `handlePayload` | `0x1d5e1d98` | +| `handlePayload` | `0x62974d96` | | `initialize` | `0xeb990c59` | | `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | | `renounceOwnership` | `0x715018a6` | | `requestOwnershipHandover` | `0x25692962` | | `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0xea92e825` | +| `resolvePayload` | `0x7f0b2207` | | `setContractFactoryPlugs` | `0x8b198f5c` | | `setExpiryTime` | `0x30fc4cff` | | `setFees` | `0x3d18678e` | diff --git a/foundry.toml b/foundry.toml index 4c30208e..7ec67782 100644 --- a/foundry.toml +++ b/foundry.toml @@ -10,27 +10,26 @@ evm_version = 'paris' via_ir = false [labels] -0x531b5626BD2514c746ae08D2D2BbAED6948C802F = "AddressResolver" -0x4Fe8DCD92026E29f8D8393611fA225c342E00db8 = "AddressResolverImpl" -0xACEBD9E6089Af301abE05d74f3a8d5A5a1A262f3 = "AsyncDeployer" -0x422214a85832DAAd3D8ABDf0cf67B47a8c889139 = "AsyncDeployerImpl" -0xC388B7c73321B1DE8d523061c6668EC38CfDA486 = "AuctionManager" -0x387d44F7CdcC8924Aa4B4a9b6Ea72Ed1059A041F = "AuctionManagerImpl" -0x9318Be24d10051ca03CC475b03eC6a844F95e724 = "Configurations" -0xBBC5Da309288Ada3C0704d7F2cA95a00DAc7aF81 = "ConfigurationsImpl" -0x8B89Aea83e86786310287118F78508E940bd4395 = "DeployForwarder" -0xf8bda7d44BACB038a7F9eA09301e75e640226717 = "DeployForwarderImpl" -0x003b65f7D0d91C994Db0048DA148571E7f038861 = "ERC1967Factory" -0x16132fa79CB1EE693B0a7d2c0C888870e5B0ef91 = "FeesManager" -0x82C8EAbEFb20E1a2798f121F80bDcf1e7eD6119D = "FeesManagerImpl" -0x9De353dD1131aB4e502590D3a1832652FA316268 = "FeesPool" -0x478Dd0858d6857C2c950E6a08CAB2A96756a3721 = "PromiseResolver" -0x208E78F90713235c5638Fc55Aa15b27ec7CBae9e = "ReadPrecompile" -0xa5d02842BA8B48c5aA22919Cb71D8366252dB452 = "RequestHandler" -0x2e03FEDC25923F7684827bC8f0c8D8dD49a9Bb8A = "RequestHandlerImpl" -0x47eDE68C04f09db20331B85570150a7096c02D86 = "SchedulePrecompile" -0x1A1b863100202c72Db1e4b2aedA11E9381A25f8c = "Watcher" -0x0f2B8e35189F498067886e1093528e32418C1DCb = "WatcherImpl" -0x59F89D9092db218b1D287B93E7bbF754aCFaEE33 = "WritePrecompile" -0x28380539d14F2475881E0E4693593AB09Ba116D0 = "WritePrecompileImpl" -0x5b0a2656b79212f7Fa6FD77F9583290386860EC4 = "APP_GATEWAY" +0xaBD3955e51bd83ACe4f9F403517F95be706A0424 = "AddressResolver" +0x8fa6EF5A80E4Eca1302d2dfB85ae151275a4eA6A = "AddressResolverImpl" +0xDcb9387DB4675C585a9a2CB55C15F7fD96E3eae6 = "AsyncDeployer" +0xcdbA9Ad5Da86d61a69ea94a52210C1f2008A849f = "AsyncDeployerImpl" +0x2C1A9c2aBcAc6468f4D828665093192807Bc31be = "AuctionManager" +0x32a6E6F8c09823d8F8ddB285346b2c61Ed1F03b8 = "AuctionManagerImpl" +0xA551ea338E12F20EF47374DbdbfeAf83b14Ea615 = "Configurations" +0xbb163A49239260a5BE19f6aD9B5839f11F6aC24F = "ConfigurationsImpl" +0xA802b0F34379Ed2eD850c9906C7F32E3348c38AE = "DeployForwarder" +0x2682de36DFBf618dBEdFa4d18c265bdc04F7C9bb = "DeployForwarderImpl" +0x32767D5390C2CD3619799c66f9F4E426c317Cd2F = "ERC1967Factory" +0x13079557a25aD9EdD85025D77e172f75ac8f2C92 = "FeesManager" +0x8DA71DE564096Ea4A43E794E1dEcA8F1692B69D7 = "FeesManagerImpl" +0x13A3018920c7b56B20dd34E29C298121025E6de4 = "FeesPool" +0xe0047f9b97c4C73948fe23F1bA807FE7906040C0 = "PromiseResolver" +0x8D8770876e587300828Bc2B235C89F06CE473170 = "ReadPrecompile" +0x23B719aDd0CEeC1A5A05c3789204886E1A94c612 = "RequestHandler" +0x95aB9c53FDa2ad009B6698d814735D0030796805 = "RequestHandlerImpl" +0x1D530df25aE08F7A440CA155c9d53540C2c50A82 = "SchedulePrecompile" +0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB = "Watcher" +0x26d5DFaaB493292c7d2Cc8C1eD447bd944127935 = "WatcherImpl" +0x239C1fCdB2B45EB65dE80836Bcf13d1f12d7f320 = "WritePrecompile" +0x4F1FB4E9169f4A604e3eb9833987338D48B8Dd77 = "WritePrecompileImpl" diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index b466bf52..5149d872 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -70,7 +70,8 @@ export const configureChains = async (addresses: DeploymentAddresses) => { signer, socketContract ); - deployUtils.addresses[Contracts.FastSwitchboardId] = fastSwitchboardId.toString(); + deployUtils.addresses[Contracts.FastSwitchboardId] = + fastSwitchboardId.toString(); const cctpSwitchboardId = await registerSb( chain, @@ -78,7 +79,8 @@ export const configureChains = async (addresses: DeploymentAddresses) => { signer, socketContract ); - deployUtils.addresses[Contracts.CCTPSwitchboardId] = cctpSwitchboardId.toString(); + deployUtils.addresses[Contracts.CCTPSwitchboardId] = + cctpSwitchboardId.toString(); const messageSwitchboardId = await registerSb( chain, diff --git a/hardhat-scripts/utils/appConfig.ts b/hardhat-scripts/utils/appConfig.ts index f61f3337..5f2b4b9b 100644 --- a/hardhat-scripts/utils/appConfig.ts +++ b/hardhat-scripts/utils/appConfig.ts @@ -10,7 +10,7 @@ export const isConfigSetOnSocket = async ( const plugConfigRegistered = await socket.getPlugConfig(plug.address); return ( plugConfigRegistered.appGatewayId.toLowerCase() === - appGatewayId.toLowerCase() && + appGatewayId.toLowerCase() && plugConfigRegistered.switchboardId.toString() === switchboardId ); }; From 4bae8b33a2f5851d650e62235b05ef9f0280a1b2 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 16:05:44 +0530 Subject: [PATCH 055/139] chore: verify contracts --- deployments/dev_verification.json | 160 +----------------------------- 1 file changed, 2 insertions(+), 158 deletions(-) diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index cac99a23..2e71d741 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1,83 +1,5 @@ { - "421614": [ - [ - "0xd726FeF96aD21AAD24443FAE933DDa9c79716a93", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B" - ] - ], - [ - "0x2784a207d51DD8c1A5323C05Fb868B68a854326C", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0x3CFe3e7eCc62232B3d29454DCABeE4f2B921e3a2", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0x0C049f6Dd92eA5dA05058b9B309755Cb347587C9", - "MessageSwitchboard", - "contracts/protocol/switchboard/MessageSwitchboard.sol", - [ - 421614, - "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0xaF912b7eaD59f5d8c8179f8606A3fa93459a612C", - "CCTPSwitchboard", - "contracts/protocol/switchboard/CCTPSwitchboard.sol", - [ - 421614, - "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0xaCF1ceeF35caAc005e15888dDb8A3515C41B4872" - ] - ], - [ - "0xd8DDEA0c49C0bcbFD31272c262a4b31FfB44a8Bc", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 421614, - "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0xA2a494e206cEf22e3F2f65e45dd05114ACca43C9", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B" - ] - ], - [ - "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", - "Socket", - "contracts/protocol/Socket.sol", - [ - 421614, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] - ] - ], + "421614": [], "7625382": [ [ "0x8DA71DE564096Ea4A43E794E1dEcA8F1692B69D7", @@ -199,83 +121,5 @@ [] ] ], - "11155420": [ - [ - "0x87C9a09e05D0D2A885eb7B2644c3CBB8E70763b6", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073" - ] - ], - [ - "0xC5B314127DFa001f00e5773EA55765A9007320a6", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0x72708A701Fa94B8a1746c2ED1A1dd41C56dA7b33", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0xE3756057aEd63488Acbfa6DC31a3E99bFBcf0d4A", - "MessageSwitchboard", - "contracts/protocol/switchboard/MessageSwitchboard.sol", - [ - 11155420, - "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0x1801b7e2E553c7233c2fd7c9e8647f6b91ff7a76", - "CCTPSwitchboard", - "contracts/protocol/switchboard/CCTPSwitchboard.sol", - [ - 11155420, - "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD" - ] - ], - [ - "0x9f1DE81ff3274eD6678a5A1644F430b06EF0992D", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 11155420, - "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0xE261C9c292101da254B9E52430a2EB9728BFD60A", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073" - ] - ], - [ - "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", - "Socket", - "contracts/protocol/Socket.sol", - [ - 11155420, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] - ] - ] + "11155420": [] } From 143682b3b7bdbbea6560c7ab87a41ec5e60ac033 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 28 Jul 2025 16:06:11 +0530 Subject: [PATCH 056/139] fix: deploy-scripts --- deployments/dev_addresses.json | 2 +- hardhat-scripts/config/config.ts | 2 +- hardhat-scripts/deploy/1.deploy.ts | 8 +++++++- hardhat-scripts/deploy/9.setupTransmitter.ts | 4 ++-- hardhat-scripts/utils/sign.ts | 10 +++++----- hardhat.config.ts | 4 ++-- src/signer.ts | 10 +++++++++- 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 748be2a2..ffa4bd71 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -12,7 +12,7 @@ "SocketBatcher": "0xd726FeF96aD21AAD24443FAE933DDa9c79716a93", "startBlock": 178158322 }, - "7625382": { + "14323": { "AddressResolver": "0xaBD3955e51bd83ACe4f9F403517F95be706A0424", "AddressResolverImpl": "0x8fa6EF5A80E4Eca1302d2dfB85ae151275a4eA6A", "AsyncDeployer": "0xDcb9387DB4675C585a9a2CB55C15F7fD96E3eae6", diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 84614961..e55b7045 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -87,7 +87,7 @@ export const mainnetChains: Array = [ export const chains: Array = getChains(); export const EVM_CHAIN_ID_MAP: Record = { [DeploymentMode.LOCAL]: 7625382, - [DeploymentMode.DEV]: 7625382, + [DeploymentMode.DEV]: 14323, [DeploymentMode.STAGE]: 43, [DeploymentMode.PROD]: 3605, }; diff --git a/hardhat-scripts/deploy/1.deploy.ts b/hardhat-scripts/deploy/1.deploy.ts index 3e11dbef..0bbf2b65 100644 --- a/hardhat-scripts/deploy/1.deploy.ts +++ b/hardhat-scripts/deploy/1.deploy.ts @@ -465,7 +465,13 @@ const deployContractWithProxy = async ( const proxyAddress = receipt.events?.find((e) => e.event === "Deployed")?.args ?.proxy; deployUtils.addresses[contractName] = proxyAddress; - + console.log( + "Deployed proxy contract", + contractName, + proxyAddress, + "implementation:", + implementation.address + ); return deployUtils; }; diff --git a/hardhat-scripts/deploy/9.setupTransmitter.ts b/hardhat-scripts/deploy/9.setupTransmitter.ts index 279be8b1..a0d68336 100644 --- a/hardhat-scripts/deploy/9.setupTransmitter.ts +++ b/hardhat-scripts/deploy/9.setupTransmitter.ts @@ -20,8 +20,9 @@ let transmitterAddress: string; export const main = async () => { console.log("Setting up transmitter..."); await init(); - await approveAuctionManager(); await checkAndDepositCredits(); + await checkAndDepositNative(); + await approveAuctionManager(); console.log("Transmitter setup complete!"); }; @@ -38,7 +39,6 @@ export const init = async () => { }; export const approveAuctionManager = async () => { - console.log("Approving auction manager"); const auctionManagerAddress = evmxAddresses[Contracts.AuctionManager]; const isAlreadyApproved = await feesManagerContract .connect(transmitterSigner) diff --git a/hardhat-scripts/utils/sign.ts b/hardhat-scripts/utils/sign.ts index 01bcb6e5..b296d565 100644 --- a/hardhat-scripts/utils/sign.ts +++ b/hardhat-scripts/utils/sign.ts @@ -1,5 +1,5 @@ import { ethers } from "ethers"; -import { ChainSlug, Contracts } from "../../src"; +import { ChainSlug, Contracts, EVMxAddressesObj } from "../../src"; import { EVMX_CHAIN_ID, mode } from "../config/config"; import { getProviderFromChainSlug } from "./networks"; import { signWatcherMultiCallMessage } from "../../src/signer"; @@ -30,9 +30,9 @@ export const signWatcherMessage = async ( targetContractAddress: string, calldata: string ) => { - const addresses = getAddresses(mode); + const evmxAddresses = getAddresses(mode)[EVMX_CHAIN_ID] as EVMxAddressesObj; return await signWatcherMultiCallMessage( - addresses[EVMX_CHAIN_ID][Contracts.Watcher], + evmxAddresses[Contracts.Watcher] as string, EVMX_CHAIN_ID, targetContractAddress, calldata, @@ -44,11 +44,11 @@ export const sendWatcherMultiCallWithNonce = async ( targetContractAddress: string, calldata: string ) => { - const addresses = getAddresses(mode); + const evmxAddresses = getAddresses(mode)[EVMX_CHAIN_ID] as EVMxAddressesObj; const watcherContract = ( await getInstance( Contracts.Watcher, - addresses[EVMX_CHAIN_ID][Contracts.Watcher] + evmxAddresses[Contracts.Watcher] as string ) ).connect(getWatcherSigner()); const { nonce, signature } = await signWatcherMessage( diff --git a/hardhat.config.ts b/hardhat.config.ts index f9745fe6..d94a5db6 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -139,8 +139,8 @@ const config: HardhatUserConfig = { network: "EVMX", chainId: EVMX_CHAIN_ID, urls: { - apiURL: "https://evmx.cloud.blockscout.com/api", - browserURL: "https://evmx.cloud.blockscout.com/", + apiURL: "https://explorer-evmx-1dpy1f56o4.t.conduit.xyz/api", + browserURL: "https://explorer-evmx-1dpy1f56o4.t.conduit.xyz/", }, }, ], diff --git a/src/signer.ts b/src/signer.ts index 9ec27359..a553046d 100644 --- a/src/signer.ts +++ b/src/signer.ts @@ -7,7 +7,7 @@ export const signWatcherMultiCallMessage = async ( calldata: string, signer: ethers.Signer ) => { - const signatureNonce = Date.now(); + const signatureNonce = getNonce(); const digest = ethers.utils.keccak256( ethers.utils.defaultAbiCoder.encode( ["address", "uint32", "uint256", "address", "bytes"], @@ -23,3 +23,11 @@ export const signWatcherMultiCallMessage = async ( const signature = await signer.signMessage(ethers.utils.arrayify(digest)); return { nonce: signatureNonce, signature }; }; + + +export const getNonce = () => { + const timestamp = Date.now(); + const random = Math.floor(Math.random() * 1000); + const nonce = Number(String(timestamp) + String(random)); + return nonce; +}; \ No newline at end of file From ce204b6c7b98c8d721b83692acae1377d3a51ef2 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 16:19:25 +0530 Subject: [PATCH 057/139] fix: lint --- Errors.md | 179 ++++--- EventTopics.md | 298 +++++------ FunctionSignatures.md | 660 ++++++++++++------------- contracts/evmx/base/AppGatewayBase.sol | 3 +- contracts/evmx/fees/Credit.sol | 7 +- deployments/dev_verification.json | 8 +- setupInfraContracts.sh | 26 +- src/signer.ts | 3 +- 8 files changed, 587 insertions(+), 597 deletions(-) diff --git a/Errors.md b/Errors.md index 2d7920b4..ae06096c 100644 --- a/Errors.md +++ b/Errors.md @@ -1,52 +1,51 @@ # Custom Error Codes - ## evmx/fees/FeesPool.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ------------------ | ------------ | | `TransferFailed()` | `0x90b8ec18` | ## evmx/helpers/AsyncPromise.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| -------------------------- | ------------ | | `PromiseAlreadyResolved()` | `0x56b63537` | -| `OnlyInvoker()` | `0x74ed21f5` | -| `PromiseAlreadySetUp()` | `0x927c53d5` | -| `PromiseRevertFailed()` | `0x0175b9de` | -| `NotLatestPromise()` | `0x39ca95d3` | +| `OnlyInvoker()` | `0x74ed21f5` | +| `PromiseAlreadySetUp()` | `0x927c53d5` | +| `PromiseRevertFailed()` | `0x0175b9de` | +| `NotLatestPromise()` | `0x39ca95d3` | ## evmx/plugs/ContractFactoryPlug.sol -| Error | Signature | -|-------|-----------| -| `DeploymentFailed()` | `0x30116425` | +| Error | Signature | +| -------------------------------- | ------------ | +| `DeploymentFailed()` | `0x30116425` | | `ExecutionFailed(bytes32,bytes)` | `0xd255d8a3` | -| `information(bool,,bytes)` | `0x3a82a1f3` | +| `information(bool,,bytes)` | `0x3a82a1f3` | ## evmx/plugs/FeesPlug.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| --------------------------------------------------- | ------------ | | `InsufficientTokenBalance(address,uint256,uint256)` | `0xebd6ced9` | -| `InvalidDepositAmount()` | `0xfe9ba5cd` | -| `TokenNotWhitelisted(address)` | `0xea3bff2e` | +| `InvalidDepositAmount()` | `0xfe9ba5cd` | +| `TokenNotWhitelisted(address)` | `0xea3bff2e` | ## evmx/watcher/RequestHandler.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ----------------------- | ------------ | | `InsufficientMaxFees()` | `0x0e5bc492` | ## protocol/Socket.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ----------------------------------------- | ------------ | | `PayloadAlreadyExecuted(ExecutionStatus)` | `0xf4c54edd` | -| `VerificationFailed()` | `0x439cc0cd` | -| `LowGasLimit()` | `0xd38edae0` | -| `InsufficientMsgValue()` | `0x78f38f76` | +| `VerificationFailed()` | `0x439cc0cd` | +| `LowGasLimit()` | `0xd38edae0` | +| `InsufficientMsgValue()` | `0x78f38f76` | ## protocol/SocketConfig.sol @@ -57,16 +56,16 @@ ## protocol/SocketFeeManager.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| -------------------- | ------------ | | `InsufficientFees()` | `0x8d53e553` | -| `FeeTooLow()` | `0x732f9413` | +| `FeeTooLow()` | `0x732f9413` | ## protocol/SocketUtils.sol -| Error | Signature | -|-------|-----------| -| `OnlyOffChain()` | `0x9cbfe066` | +| Error | Signature | +| -------------------- | ------------ | +| `OnlyOffChain()` | `0x9cbfe066` | | `SimulationFailed()` | `0x2fbab3ac` | ## protocol/base/MessagePlugBase.sol @@ -88,8 +87,8 @@ ## protocol/switchboard/FastSwitchboard.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ------------------- | ------------ | | `AlreadyAttested()` | `0x35d90805` | | `WatcherNotFound()` | `0xa278e4ad` | @@ -105,8 +104,8 @@ ## utils/AccessControl.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ------------------- | ------------ | | `NoPermit(bytes32)` | `0x962f6333` | ## utils/common/Converters.sol @@ -117,60 +116,60 @@ ## utils/common/Errors.sol -| Error | Signature | -|-------|-----------| -| `ZeroAddress()` | `0xd92e233d` | -| `InvalidTransmitter()` | `0x58a70a0a` | -| `InvalidTokenAddress()` | `0x1eb00b06` | -| `InvalidSwitchboard()` | `0xf63c9e4d` | -| `SocketAlreadyInitialized()` | `0xc9500b00` | -| `NotSocket()` | `0xc59f8f7c` | -| `PlugNotFound()` | `0x5f1ac76a` | -| `ResolvingScheduleTooEarly()` | `0x207e8731` | -| `CallFailed()` | `0x3204506f` | -| `InvalidAppGateway()` | `0x82ded261` | -| `AppGatewayAlreadyCalled()` | `0xb224683f` | -| `InvalidCallerTriggered()` | `0x3292d247` | -| `InvalidPromise()` | `0x45f2d176` | -| `InvalidWatcherSignature()` | `0x5029f14f` | -| `NonceUsed()` | `0x1f6d5aef` | -| `AsyncModifierNotSet()` | `0xcae106f9` | -| `WatcherNotSet()` | `0x42d473a7` | -| `InvalidTarget()` | `0x82d5d76a` | -| `InvalidIndex()` | `0x63df8171` | -| `InvalidChainSlug()` | `0xbff6b106` | -| `InvalidPayloadSize()` | `0xfbdf7954` | -| `InvalidOnChainAddress()` | `0xb758c606` | -| `InvalidScheduleDelay()` | `0x9a993219` | -| `AuctionClosed()` | `0x36b6b46d` | -| `AuctionNotOpen()` | `0xf0460077` | -| `BidExceedsMaxFees()` | `0x4c923f3c` | -| `LowerBidAlreadyExists()` | `0xaaa1f709` | -| `RequestCountMismatch()` | `0x98bbcbff` | -| `InvalidAmount()` | `0x2c5211c6` | -| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | -| `InsufficientBalance()` | `0xf4d678b8` | -| `InvalidCaller()` | `0x48f5c3ed` | -| `InvalidGateway()` | `0xfc9dfe85` | -| `RequestAlreadyCancelled()` | `0xc70f47d8` | -| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | -| `InvalidBid()` | `0xc6388ef7` | -| `MaxReAuctionCountReached()` | `0xf2b4388c` | -| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | -| `OnlyWatcherAllowed()` | `0xdf7d227c` | -| `InvalidPrecompileData()` | `0x320062c0` | -| `InvalidCallType()` | `0x39d2eb55` | -| `NotRequestHandler()` | `0x8f8cba5b` | -| `NotInvoker()` | `0x8a6353d1` | -| `NotPromiseResolver()` | `0x86d876b2` | -| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | -| `InsufficientFees()` | `0x8d53e553` | -| `RequestAlreadySettled()` | `0x66fad465` | -| `NoWriteRequest()` | `0x9dcd3065` | -| `AlreadyAssigned()` | `0x9688dc51` | -| `OnlyAppGateway()` | `0xfec944ea` | +| Error | Signature | +| --------------------------------------------- | ------------ | +| `ZeroAddress()` | `0xd92e233d` | +| `InvalidTransmitter()` | `0x58a70a0a` | +| `InvalidTokenAddress()` | `0x1eb00b06` | +| `InvalidSwitchboard()` | `0xf63c9e4d` | +| `SocketAlreadyInitialized()` | `0xc9500b00` | +| `NotSocket()` | `0xc59f8f7c` | +| `PlugNotFound()` | `0x5f1ac76a` | +| `ResolvingScheduleTooEarly()` | `0x207e8731` | +| `CallFailed()` | `0x3204506f` | +| `InvalidAppGateway()` | `0x82ded261` | +| `AppGatewayAlreadyCalled()` | `0xb224683f` | +| `InvalidCallerTriggered()` | `0x3292d247` | +| `InvalidPromise()` | `0x45f2d176` | +| `InvalidWatcherSignature()` | `0x5029f14f` | +| `NonceUsed()` | `0x1f6d5aef` | +| `AsyncModifierNotSet()` | `0xcae106f9` | +| `WatcherNotSet()` | `0x42d473a7` | +| `InvalidTarget()` | `0x82d5d76a` | +| `InvalidIndex()` | `0x63df8171` | +| `InvalidChainSlug()` | `0xbff6b106` | +| `InvalidPayloadSize()` | `0xfbdf7954` | +| `InvalidOnChainAddress()` | `0xb758c606` | +| `InvalidScheduleDelay()` | `0x9a993219` | +| `AuctionClosed()` | `0x36b6b46d` | +| `AuctionNotOpen()` | `0xf0460077` | +| `BidExceedsMaxFees()` | `0x4c923f3c` | +| `LowerBidAlreadyExists()` | `0xaaa1f709` | +| `RequestCountMismatch()` | `0x98bbcbff` | +| `InvalidAmount()` | `0x2c5211c6` | +| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | +| `InsufficientBalance()` | `0xf4d678b8` | +| `InvalidCaller()` | `0x48f5c3ed` | +| `InvalidGateway()` | `0xfc9dfe85` | +| `RequestAlreadyCancelled()` | `0xc70f47d8` | +| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | +| `InvalidBid()` | `0xc6388ef7` | +| `MaxReAuctionCountReached()` | `0xf2b4388c` | +| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | +| `OnlyWatcherAllowed()` | `0xdf7d227c` | +| `InvalidPrecompileData()` | `0x320062c0` | +| `InvalidCallType()` | `0x39d2eb55` | +| `NotRequestHandler()` | `0x8f8cba5b` | +| `NotInvoker()` | `0x8a6353d1` | +| `NotPromiseResolver()` | `0x86d876b2` | +| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | +| `InsufficientFees()` | `0x8d53e553` | +| `RequestAlreadySettled()` | `0x66fad465` | +| `NoWriteRequest()` | `0x9dcd3065` | +| `AlreadyAssigned()` | `0x9688dc51` | +| `OnlyAppGateway()` | `0xfec944ea` | | `NewMaxFeesLowerThanCurrent(uint256,uint256)` | `0x1345dda1` | -| `InvalidContract()` | `0x6eefed20` | -| `InvalidData()` | `0x5cb045db` | -| `InvalidSignature()` | `0x8baa579f` | -| `DeadlinePassed()` | `0x70f65caa` | +| `InvalidContract()` | `0x6eefed20` | +| `InvalidData()` | `0x5cb045db` | +| `InvalidSignature()` | `0x8baa579f` | +| `DeadlinePassed()` | `0x70f65caa` | diff --git a/EventTopics.md b/EventTopics.md index a23587b6..0a408806 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -2,20 +2,20 @@ ## AuctionManager -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AuctionEndDelaySecondsSet` | `(auctionEndDelaySeconds: uint256)` | `0xf38f0d9dc8459cf5426728c250d115196a4c065ebc1a6c29da24764a8c0da722` | -| `AuctionEnded` | `(requestCount: uint40, winningBid: tuple)` | `0xede4ec1efc469fac10dcb4930f70be4cd21f3700ed61c91967c19a7cd7c0d86e` | -| `AuctionRestarted` | `(requestCount: uint40)` | `0x071867b21946ec4655665f0d4515d3757a5a52f144c762ecfdfb11e1da542b82` | -| `AuctionStarted` | `(requestCount: uint40)` | `0xcd040613cf8ef0cfcaa3af0d711783e827a275fc647c116b74595bf17cb9364f` | -| `BidPlaced` | `(requestCount: uint40, bid: tuple)` | `0x7f79485e4c9aeea5d4899bc6f7c63b22ac1f4c01d2d28c801e94732fee657b5d` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `MaxReAuctionCountSet` | `(maxReAuctionCount: uint256)` | `0x2f6fadde7ab8ab83d21ab10c3bc09dde179f8696d47c4176581facf0c6f96bbf` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ---------------------------- | ------------------------------------------- | -------------------------------------------------------------------- | +| `AuctionEndDelaySecondsSet` | `(auctionEndDelaySeconds: uint256)` | `0xf38f0d9dc8459cf5426728c250d115196a4c065ebc1a6c29da24764a8c0da722` | +| `AuctionEnded` | `(requestCount: uint40, winningBid: tuple)` | `0xede4ec1efc469fac10dcb4930f70be4cd21f3700ed61c91967c19a7cd7c0d86e` | +| `AuctionRestarted` | `(requestCount: uint40)` | `0x071867b21946ec4655665f0d4515d3757a5a52f144c762ecfdfb11e1da542b82` | +| `AuctionStarted` | `(requestCount: uint40)` | `0xcd040613cf8ef0cfcaa3af0d711783e827a275fc647c116b74595bf17cb9364f` | +| `BidPlaced` | `(requestCount: uint40, bid: tuple)` | `0x7f79485e4c9aeea5d4899bc6f7c63b22ac1f4c01d2d28c801e94732fee657b5d` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `MaxReAuctionCountSet` | `(maxReAuctionCount: uint256)` | `0x2f6fadde7ab8ab83d21ab10c3bc09dde179f8696d47c4176581facf0c6f96bbf` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## Socket @@ -43,143 +43,143 @@ ## SocketBatcher -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## SocketFeeManager -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SocketFeesUpdated` | `(oldFees: uint256, newFees: uint256)` | `0xcbd4d756fb6198bbcc2e4013cce929f504ad46e9d97c543ef9a8dfea3e407053` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SocketFeesUpdated` | `(oldFees: uint256, newFees: uint256)` | `0xcbd4d756fb6198bbcc2e4013cce929f504ad46e9d97c543ef9a8dfea3e407053` | ## FeesManager -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `CreditsBlocked` | `(requestCount: uint40, consumeFrom: address, amount: uint256)` | `0xf037c15aef41440aa823cf1fdeaea332105d8b23d52557f6670189b5d76f1eed` | -| `CreditsTransferred` | `(from: address, to: address, amount: uint256)` | `0xed198cadddd93e734cbf04cb1c3226d9bafaeb504cedbd8ee36b830b0cb9e7a5` | -| `CreditsUnblocked` | `(requestCount: uint40, consumeFrom: address)` | `0x45db29ef2701319155cac058aa2f56ce1f73e0e238161d3db9f8c9a47655210d` | -| `CreditsUnblockedAndAssigned` | `(requestCount: uint40, consumeFrom: address, transmitter: address, amount: uint256)` | `0x38fd327622576a468e1b2818b00f50c8854703633ef8e583e1f31662888ffac2` | -| `CreditsUnwrapped` | `(consumeFrom: address, amount: uint256)` | `0xdcc9473b722b4c953617ab373840b365298a520bc7f20ce94fa7314f4a857774` | -| `CreditsWrapped` | `(consumeFrom: address, amount: uint256)` | `0x40246503613721eb4acf4020c6c56b6a16e5d08713316db0bea5210e8819c592` | -| `Deposited` | `(chainSlug: uint32, token: address, depositTo: address, creditAmount: uint256, nativeAmount: uint256)` | `0x72aedd284699bbd7a987e6942b824cfd6c627e354cb5a0760ac5768acd473f4a` | -| `FeesPlugSet` | `(chainSlug: uint32, feesPlug: address)` | `0xa8c4be32b96cca895f1f0f4684e6b377b2c4513bc35eb57a13afb6b5efb2c0ce` | -| `FeesPoolSet` | `(feesPool: address)` | `0xd07af3fd70b48ab3c077a8d45c3a288498d905d0e3d1e65bc171f6c2e890d8ef` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WithdrawFailed` | `(payloadId: bytes32)` | `0xea147eb2109f71b4bda9e57528ba08b84821087a31cb43a7851dc6ff743d9be7` | +| Event | Arguments | Topic | +| ----------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `CreditsBlocked` | `(requestCount: uint40, consumeFrom: address, amount: uint256)` | `0xf037c15aef41440aa823cf1fdeaea332105d8b23d52557f6670189b5d76f1eed` | +| `CreditsTransferred` | `(from: address, to: address, amount: uint256)` | `0xed198cadddd93e734cbf04cb1c3226d9bafaeb504cedbd8ee36b830b0cb9e7a5` | +| `CreditsUnblocked` | `(requestCount: uint40, consumeFrom: address)` | `0x45db29ef2701319155cac058aa2f56ce1f73e0e238161d3db9f8c9a47655210d` | +| `CreditsUnblockedAndAssigned` | `(requestCount: uint40, consumeFrom: address, transmitter: address, amount: uint256)` | `0x38fd327622576a468e1b2818b00f50c8854703633ef8e583e1f31662888ffac2` | +| `CreditsUnwrapped` | `(consumeFrom: address, amount: uint256)` | `0xdcc9473b722b4c953617ab373840b365298a520bc7f20ce94fa7314f4a857774` | +| `CreditsWrapped` | `(consumeFrom: address, amount: uint256)` | `0x40246503613721eb4acf4020c6c56b6a16e5d08713316db0bea5210e8819c592` | +| `Deposited` | `(chainSlug: uint32, token: address, depositTo: address, creditAmount: uint256, nativeAmount: uint256)` | `0x72aedd284699bbd7a987e6942b824cfd6c627e354cb5a0760ac5768acd473f4a` | +| `FeesPlugSet` | `(chainSlug: uint32, feesPlug: bytes32)` | `0x677a00737c8099aa9e6c554104ca7941deb59125335cfb3d0d9f604f178db59c` | +| `FeesPoolSet` | `(feesPool: address)` | `0xd07af3fd70b48ab3c077a8d45c3a288498d905d0e3d1e65bc171f6c2e890d8ef` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WithdrawFailed` | `(payloadId: bytes32)` | `0xea147eb2109f71b4bda9e57528ba08b84821087a31cb43a7851dc6ff743d9be7` | ## FeesPool -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `NativeDeposited` | `(from: address, amount: uint256)` | `0xb5d7700fb0cf415158b8db7cc7c39f0eab16a825c92e221404b4c8bb099b4bbb` | -| `NativeWithdrawn` | `(success: bool, to: address, amount: uint256)` | `0xa81f1c8490022ee829d2e1a231053f5dbecad46caee71f6ea38a9db663a3f12b` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ---------------------------- | ----------------------------------------------- | -------------------------------------------------------------------- | +| `NativeDeposited` | `(from: address, amount: uint256)` | `0xb5d7700fb0cf415158b8db7cc7c39f0eab16a825c92e221404b4c8bb099b4bbb` | +| `NativeWithdrawn` | `(success: bool, to: address, amount: uint256)` | `0xa81f1c8490022ee829d2e1a231053f5dbecad46caee71f6ea38a9db663a3f12b` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## AddressResolver -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AsyncDeployerUpdated` | `(asyncDeployer_: address)` | `0x4df9cdd01544e8f6b0326650bc0b55611f47ce5ba2faa522d21fb675e9fc1f73` | -| `ContractAddressUpdated` | `(contractId_: bytes32, contractAddress_: address)` | `0xdf5ec2c15e11ce657bb21bc09c0b5ba95e315b4dba9934c6e311f47559babf28` | -| `DefaultAuctionManagerUpdated` | `(defaultAuctionManager_: address)` | `0x60f296739208a505ead7fb622df0f76b7791b824481b120a2300bdaf85e3e3d6` | -| `DeployForwarderUpdated` | `(deployForwarder_: address)` | `0x237b9bc9fef7508a02ca9ccca81f6965e500064a58024cae1218035da865fd2b` | -| `FeesManagerUpdated` | `(feesManager_: address)` | `0x94e67aa1341a65767dfde81e62fd265bfbade1f5744bfd3cd73f99a6eca0572a` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WatcherUpdated` | `(watcher_: address)` | `0xc13081d38d92b454cdb6ca20bbc65c12fa43a7a14a1529204ced5b6350052bb0` | +| Event | Arguments | Topic | +| ------------------------------ | --------------------------------------------------- | -------------------------------------------------------------------- | +| `AsyncDeployerUpdated` | `(asyncDeployer_: address)` | `0x4df9cdd01544e8f6b0326650bc0b55611f47ce5ba2faa522d21fb675e9fc1f73` | +| `ContractAddressUpdated` | `(contractId_: bytes32, contractAddress_: address)` | `0xdf5ec2c15e11ce657bb21bc09c0b5ba95e315b4dba9934c6e311f47559babf28` | +| `DefaultAuctionManagerUpdated` | `(defaultAuctionManager_: address)` | `0x60f296739208a505ead7fb622df0f76b7791b824481b120a2300bdaf85e3e3d6` | +| `DeployForwarderUpdated` | `(deployForwarder_: address)` | `0x237b9bc9fef7508a02ca9ccca81f6965e500064a58024cae1218035da865fd2b` | +| `FeesManagerUpdated` | `(feesManager_: address)` | `0x94e67aa1341a65767dfde81e62fd265bfbade1f5744bfd3cd73f99a6eca0572a` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WatcherUpdated` | `(watcher_: address)` | `0xc13081d38d92b454cdb6ca20bbc65c12fa43a7a14a1529204ced5b6350052bb0` | ## AsyncDeployer -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AsyncPromiseDeployed` | `(newAsyncPromise: address, salt: bytes32)` | `0xb6c5491cf83e09749b1a4dd6a9f07b0e925fcb0a915ac8c2b40e8ab28191c270` | -| `ForwarderDeployed` | `(newForwarder: address, salt: bytes32)` | `0x4dbbecb9cf9c8b93da9743a2b48ea52efe68d69230ab1c1b711891d9d223b29f` | -| `ImplementationUpdated` | `(contractName: string, newImplementation: address)` | `0xa1e41aa2c2f3f20d9b63ac06b634d2788768d6034f3d9192cdf7d07374bb16f4` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------------------- | -------------------------------------------------------------------- | +| `AsyncPromiseDeployed` | `(newAsyncPromise: address, salt: bytes32)` | `0xb6c5491cf83e09749b1a4dd6a9f07b0e925fcb0a915ac8c2b40e8ab28191c270` | +| `ForwarderDeployed` | `(newForwarder: address, salt: bytes32)` | `0x4dbbecb9cf9c8b93da9743a2b48ea52efe68d69230ab1c1b711891d9d223b29f` | +| `ImplementationUpdated` | `(contractName: string, newImplementation: address)` | `0xa1e41aa2c2f3f20d9b63ac06b634d2788768d6034f3d9192cdf7d07374bb16f4` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## AsyncPromise -| Event | Arguments | Topic | -| ----- | --------- | ----- | +| Event | Arguments | Topic | +| ------------- | ------------------- | -------------------------------------------------------------------- | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | ## DeployForwarder -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## Forwarder -| Event | Arguments | Topic | -| ----- | --------- | ----- | +| Event | Arguments | Topic | +| ------------- | ------------------- | -------------------------------------------------------------------- | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | ## ProxyFactory -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AdminChanged` | `(proxy: address, admin: address)` | `0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f` | -| `Deployed` | `(proxy: address, implementation: address, admin: address)` | `0xc95935a66d15e0da5e412aca0ad27ae891d20b2fb91cf3994b6a3bf2b8178082` | -| `Upgraded` | `(proxy: address, implementation: address)` | `0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7` | +| Event | Arguments | Topic | +| -------------- | ----------------------------------------------------------- | -------------------------------------------------------------------- | +| `AdminChanged` | `(proxy: address, admin: address)` | `0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f` | +| `Deployed` | `(proxy: address, implementation: address, admin: address)` | `0xc95935a66d15e0da5e412aca0ad27ae891d20b2fb91cf3994b6a3bf2b8178082` | +| `Upgraded` | `(proxy: address, implementation: address)` | `0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7` | ## TestUSDC -| Event | Arguments | Topic | -| ----- | --------- | ----- | +| Event | Arguments | Topic | +| ---------- | ----------------------------------------------------- | -------------------------------------------------------------------- | | `Approval` | `(owner: address, spender: address, amount: uint256)` | `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` | -| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | +| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | ## ContractFactoryPlug -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | -| `Deployed` | `(addr: address, salt: bytes32, returnData: bytes)` | `0x1246c6f8fd9f4abc542c7c8c8f793cfcde6b67aed1976a38aa134fc24af2dfe3` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ---------------------------- | --------------------------------------------------- | -------------------------------------------------------------------- | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `Deployed` | `(addr: address, salt: bytes32, returnData: bytes)` | `0x1246c6f8fd9f4abc542c7c8c8f793cfcde6b67aed1976a38aa134fc24af2dfe3` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## FeesPlug -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | -| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256)` | `0xeb4e1b24b7fe377de69f80f7380bda5ba4b43176c6a4d300a3be9009c49f4228` | -| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | -| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | +| Event | Arguments | Topic | +| ---------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256)` | `0xeb4e1b24b7fe377de69f80f7380bda5ba4b43176c6a4d300a3be9009c49f4228` | +| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | +| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | ## Configurations @@ -196,11 +196,11 @@ ## PromiseResolver -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `MarkedRevert` | `(payloadId: bytes32, isRevertingOnchain: bool)` | `0xcf1fd844cb4d32cbebb5ca6ce4ac834fe98da3ddac44deb77fffd22ad933824c` | -| `PromiseNotResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0xbcf0d0c678940566e9e64f0c871439395bd5fb5c39bca3547b126fe6ee467937` | -| `PromiseResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0x1b1b5810494fb3e17f7c46547e6e67cd6ad3e6001ea6fb7d12ea0241ba13c4ba` | +| Event | Arguments | Topic | +| -------------------- | ------------------------------------------------ | -------------------------------------------------------------------- | +| `MarkedRevert` | `(payloadId: bytes32, isRevertingOnchain: bool)` | `0xcf1fd844cb4d32cbebb5ca6ce4ac834fe98da3ddac44deb77fffd22ad933824c` | +| `PromiseNotResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0xbcf0d0c678940566e9e64f0c871439395bd5fb5c39bca3547b126fe6ee467937` | +| `PromiseResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0x1b1b5810494fb3e17f7c46547e6e67cd6ad3e6001ea6fb7d12ea0241ba13c4ba` | ## RequestHandler @@ -218,17 +218,17 @@ ## Watcher -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | -| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | -| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | -| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | +| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | +| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | +| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | +| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | ## IMessageSwitchboard @@ -253,14 +253,14 @@ ## FastSwitchboard -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ---------------------------- | ----------------------------------------- | -------------------------------------------------------------------- | +| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## MessageSwitchboard @@ -279,22 +279,22 @@ ## ReadPrecompile -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `ReadFeesSet` | `(readFees: uint256)` | `0xc674cb6dde3a59f84dbf226832e606ffc54ac8a169e1568fc834c7813010f926` | -| `ReadRequested` | `(transaction: tuple, readAtBlockNumber: uint256, payloadId: bytes32)` | `0x42d9c65d4f6e45462ae6206adb3e388e046b7daa1dc8699d9380cac72ff5db0b` | +| Event | Arguments | Topic | +| --------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `ReadFeesSet` | `(readFees: uint256)` | `0xc674cb6dde3a59f84dbf226832e606ffc54ac8a169e1568fc834c7813010f926` | +| `ReadRequested` | `(transaction: tuple, readAtBlockNumber: uint256, payloadId: bytes32)` | `0xbcad63ac625c0f3cb23b62b126567728fcf5950ca8e559150e764eced73e794a` | ## SchedulePrecompile -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | -| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | -| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | -| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256)` | `0xd099d3e3d0f0e2c9c40e0066affeea125aab71d763b7ab0a279ccec3dff70b64` | -| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | +| Event | Arguments | Topic | +| ------------------------------ | ---------------------------------------------------------------- | -------------------------------------------------------------------- | +| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | +| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | +| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | +| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256)` | `0xd099d3e3d0f0e2c9c40e0066affeea125aab71d763b7ab0a279ccec3dff70b64` | +| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | ## WritePrecompile diff --git a/FunctionSignatures.md b/FunctionSignatures.md index a05ffdba..e929f6b7 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -2,53 +2,53 @@ ## AuctionManager -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `auctionEndDelaySeconds` | `0x9087dfdb` | -| `auctionManager` | `0xb0192f9a` | -| `auctionStatus` | `0xd7d5fbf6` | -| `bid` | `0xfcdf49c2` | -| `bidTimeout` | `0x94090d0b` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `consumeFrom` | `0x40dd78be` | -| `creationCodeWithArgs` | `0xc126dcc4` | -| `deployForwarder__` | `0xd4e3b034` | -| `endAuction` | `0x1212e653` | -| `evmxSlug` | `0x8bae77c2` | -| `expireBid` | `0x1dd5022c` | -| `feesManager__` | `0x70568b58` | -| `forwarderAddresses` | `0x5390fdcb` | -| `getOnChainAddress` | `0xb6abffd7` | -| `getOverrideParams` | `0x54f0a866` | -| `grantRole` | `0x2f2ff15d` | -| `handleRevert` | `0x44792f25` | -| `hasRole` | `0x91d14854` | -| `initialize` | `0x86891c9b` | -| `initializeOnChain` | `0x86f01739` | -| `isAsyncModifierSet` | `0xb69e0c4a` | -| `isValidPromise` | `0xb690b962` | -| `maxFees` | `0xe83e34b1` | -| `maxReAuctionCount` | `0xc367b376` | -| `onCompleteData` | `0xb52fa926` | -| `onDeployComplete` | `0xfa3dbd1e` | -| `overrideParams` | `0xec5490fe` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `auctionEndDelaySeconds` | `0x9087dfdb` | +| `auctionManager` | `0xb0192f9a` | +| `auctionStatus` | `0xd7d5fbf6` | +| `bid` | `0xfcdf49c2` | +| `bidTimeout` | `0x94090d0b` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `consumeFrom` | `0x40dd78be` | +| `creationCodeWithArgs` | `0xc126dcc4` | +| `deployForwarder__` | `0xd4e3b034` | +| `endAuction` | `0x1212e653` | +| `evmxSlug` | `0x8bae77c2` | +| `expireBid` | `0x1dd5022c` | +| `feesManager__` | `0x70568b58` | +| `forwarderAddresses` | `0x5390fdcb` | +| `getOnChainAddress` | `0xb6abffd7` | +| `getOverrideParams` | `0x54f0a866` | +| `grantRole` | `0x2f2ff15d` | +| `handleRevert` | `0x44792f25` | +| `hasRole` | `0x91d14854` | +| `initialize` | `0x86891c9b` | +| `initializeOnChain` | `0x86f01739` | +| `isAsyncModifierSet` | `0xb69e0c4a` | +| `isValidPromise` | `0xb690b962` | +| `maxFees` | `0xe83e34b1` | +| `maxReAuctionCount` | `0xc367b376` | +| `onCompleteData` | `0xb52fa926` | +| `onRequestComplete` | `0x5ed1f959` | +| `overrideParams` | `0xec5490fe` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `reAuctionCount` | `0x9b4b22d3` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `sbType` | `0x745de344` | -| `setAddress` | `0x85bf312c` | -| `setAuctionEndDelaySeconds` | `0x88606b1a` | -| `setMaxReAuctionCount` | `0x64c71403` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | -| `winningBids` | `0x9133f232` | +| `reAuctionCount` | `0x9b4b22d3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `sbType` | `0x745de344` | +| `setAddress` | `0x85bf312c` | +| `setAuctionEndDelaySeconds` | `0x88606b1a` | +| `setMaxReAuctionCount` | `0x64c71403` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | +| `winningBids` | `0x9133f232` | ## Socket @@ -93,14 +93,14 @@ ## SocketFeeManager -| Function | Signature | -| -------- | --------- | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getMinSocketFees` | `0xd383b688` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getMinSocketFees` | `0xd383b688` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | | `payAndCheckFees` | `0x0b2b48ed` | | `renounceOwnership` | `0x715018a6` | @@ -113,214 +113,215 @@ ## FeesManager -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `approveAppGateway` | `0xa3b53d8b` | +| Function | Signature | +| -------------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `approveAppGateway` | `0xa3b53d8b` | | `approveAppGatewayWithSignature` | `0x94b649ec` | -| `approveAppGateways` | `0x86d23ab2` | -| `asyncDeployer__` | `0x2a39e801` | -| `blockCredits` | `0x9e434307` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployForwarder__` | `0xd4e3b034` | -| `deposit` | `0x5671d329` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `feesPlugs` | `0x23f5ee8a` | -| `feesPool` | `0x6b259690` | -| `getAvailableCredits` | `0xb065a8e5` | -| `handleRevert` | `0x44792f25` | -| `initialize` | `0xbf2c8539` | -| `isApproved` | `0xa389783e` | -| `isCreditSpendable` | `0x4f8990fd` | -| `isNonceUsed` | `0xcab7e8eb` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestBlockedCredits` | `0xb62d25ac` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `sbType` | `0x745de344` | -| `setFeesPlug` | `0xeab75f36` | -| `setFeesPool` | `0xd6684588` | -| `tokenOnChainBalances` | `0x3b27866d` | -| `transferCredits` | `0xf1686c89` | -| `transferOwnership` | `0xf2fde38b` | -| `unblockAndAssignCredits` | `0x01958181` | -| `unblockCredits` | `0xa0b32314` | -| `unwrap` | `0x7647691d` | -| `userCredits` | `0x20babb92` | -| `watcher__` | `0x300bb063` | -| `withdrawCredits` | `0xcfc6dbd9` | -| `wrap` | `0x023276f0` | +| `approveAppGateways` | `0x86d23ab2` | +| `asyncDeployer__` | `0x2a39e801` | +| `blockCredits` | `0x9e434307` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployForwarder__` | `0xd4e3b034` | +| `deposit` | `0x5671d329` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `feesPlugs` | `0x23f5ee8a` | +| `feesPool` | `0x6b259690` | +| `getAvailableCredits` | `0xb065a8e5` | +| `handleRevert` | `0x44792f25` | +| `initialize` | `0xbf2c8539` | +| `isApproved` | `0xa389783e` | +| `isCreditSpendable` | `0x4f8990fd` | +| `isNonceUsed` | `0xcab7e8eb` | +| `onRequestComplete` | `0x5ed1f959` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestBlockedCredits` | `0xb62d25ac` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `sbType` | `0x745de344` | +| `setFeesPlug` | `0xd6a9a8b7` | +| `setFeesPool` | `0xd6684588` | +| `tokenOnChainBalances` | `0x3b27866d` | +| `transferCredits` | `0xf1686c89` | +| `transferOwnership` | `0xf2fde38b` | +| `unblockAndAssignCredits` | `0x01958181` | +| `unblockCredits` | `0xa0b32314` | +| `unwrap` | `0x7647691d` | +| `userCredits` | `0x20babb92` | +| `watcher__` | `0x300bb063` | +| `withdrawCredits` | `0xcfc6dbd9` | +| `wrap` | `0x023276f0` | ## FeesPool -| Function | Signature | -| -------- | --------- | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getBalance` | `0x12065fe0` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getBalance` | `0x12065fe0` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `revokeRole` | `0xd547741f` | -| `transferOwnership` | `0xf2fde38b` | -| `withdraw` | `0xf3fef3a3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `revokeRole` | `0xd547741f` | +| `transferOwnership` | `0xf2fde38b` | +| `withdraw` | `0xf3fef3a3` | ## AddressResolver -| Function | Signature | -| -------- | --------- | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `contractAddresses` | `0xf689e892` | -| `defaultAuctionManager` | `0x8f27cdc6` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0xc4d66de8` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `contractAddresses` | `0xf689e892` | +| `defaultAuctionManager` | `0x8f27cdc6` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0xc4d66de8` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setAsyncDeployer` | `0xcb0ffff8` | -| `setContractAddress` | `0xe001f841` | -| `setDefaultAuctionManager` | `0xede8b4b5` | -| `setDeployForwarder` | `0xaeaee8a6` | -| `setFeesManager` | `0x1c89382a` | -| `setWatcher` | `0x24f48bc5` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setAsyncDeployer` | `0xcb0ffff8` | +| `setContractAddress` | `0xe001f841` | +| `setDefaultAuctionManager` | `0xede8b4b5` | +| `setDeployForwarder` | `0xaeaee8a6` | +| `setFeesManager` | `0x1c89382a` | +| `setWatcher` | `0x24f48bc5` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncDeployer -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `asyncPromiseBeacon` | `0xc0fbc0ef` | -| `asyncPromiseCounter` | `0x97cdbf4c` | -| `asyncPromiseImplementation` | `0x59531b8d` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployAsyncPromiseContract` | `0x9851be0b` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `forwarderBeacon` | `0x945709ae` | -| `forwarderImplementation` | `0xe38d60a1` | -| `getAsyncPromiseAddress` | `0x104f39b4` | -| `getForwarderAddress` | `0x48c0b3e0` | -| `getOrDeployForwarderContract` | `0x0aa178de` | -| `initialize` | `0x485cc955` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| ------------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `asyncPromiseBeacon` | `0xc0fbc0ef` | +| `asyncPromiseCounter` | `0x97cdbf4c` | +| `asyncPromiseImplementation` | `0x59531b8d` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployAsyncPromiseContract` | `0x9851be0b` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `forwarderBeacon` | `0x945709ae` | +| `forwarderImplementation` | `0xe38d60a1` | +| `getAsyncPromiseAddress` | `0x104f39b4` | +| `getForwarderAddress` | `0x9c038b01` | +| `getOrDeployForwarderContract` | `0xe9bf1edf` | +| `initialize` | `0x485cc955` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | | `setAsyncPromiseImplementation` | `0xeb506eab` | -| `setForwarderImplementation` | `0x83b1e974` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `setForwarderImplementation` | `0x83b1e974` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncPromise -| Function | Signature | -| -------- | --------- | +| Function | Signature | +| ------------------- | ------------ | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `callbackData` | `0xef44c272` | -| `callbackSelector` | `0x2764f92f` | +| `asyncDeployer__` | `0x2a39e801` | +| `callbackData` | `0xef44c272` | +| `callbackSelector` | `0x2764f92f` | | `deployForwarder__` | `0xd4e3b034` | -| `exceededMaxCopy` | `0xaf598c7c` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x0ece6089` | -| `localInvoker` | `0x45eb87f4` | +| `exceededMaxCopy` | `0xaf598c7c` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x0ece6089` | +| `localInvoker` | `0x45eb87f4` | | `markOnchainRevert` | `0xd0e7af1b` | -| `markResolved` | `0x822d5d1f` | -| `requestCount` | `0x5badbe4c` | -| `rescueFunds` | `0x6ccae054` | -| `returnData` | `0xebddbaf6` | -| `state` | `0xc19d93fb` | -| `then` | `0x0bf2ba15` | -| `watcher__` | `0x300bb063` | +| `markResolved` | `0x822d5d1f` | +| `requestCount` | `0x5badbe4c` | +| `rescueFunds` | `0x6ccae054` | +| `returnData` | `0xebddbaf6` | +| `state` | `0xc19d93fb` | +| `then` | `0x0bf2ba15` | +| `watcher__` | `0x300bb063` | ## DeployForwarder -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deploy` | `0x940f11af` | -| `deployForwarder__` | `0xd4e3b034` | -| `deployerSwitchboardType` | `0xaa381f9a` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x6133f985` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deploy` | `0x940f11af` | +| `deployForwarder__` | `0xd4e3b034` | +| `deployerSwitchboardType` | `0xaa381f9a` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x6133f985` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `saltCounter` | `0xa04c6809` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `saltCounter` | `0xa04c6809` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## Forwarder -| Function | Signature | -| -------- | --------- | +| Function | Signature | +| ------------------- | ------------ | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `chainSlug` | `0xb349ba65` | +| `asyncDeployer__` | `0x2a39e801` | +| `chainSlug` | `0xb349ba65` | | `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getChainSlug` | `0x0b8c6568` | +| `feesManager__` | `0x70568b58` | +| `getChainSlug` | `0x0b8c6568` | | `getOnChainAddress` | `0x9da48789` | -| `initialize` | `0x647c576c` | -| `onChainAddress` | `0x8bd0b363` | -| `rescueFunds` | `0x6ccae054` | -| `watcher__` | `0x300bb063` | +| `initialize` | `0x148841cb` | +| `onChainAddress` | `0x8bd0b363` | +| `rescueFunds` | `0x6ccae054` | +| `watcher__` | `0x300bb063` | ## ProxyFactory -| Function | Signature | -| -------- | --------- | -| `adminOf` | `0x2abbef15` | -| `changeAdmin` | `0x1acfd02a` | -| `deploy` | `0x545e7c61` | -| `deployAndCall` | `0x4314f120` | -| `deployDeterministic` | `0x3729f922` | -| `deployDeterministicAndCall` | `0xa97b90d5` | -| `initCodeHash` | `0xdb4c545e` | +| Function | Signature | +| ----------------------------- | ------------ | +| `adminOf` | `0x2abbef15` | +| `changeAdmin` | `0x1acfd02a` | +| `deploy` | `0x545e7c61` | +| `deployAndCall` | `0x4314f120` | +| `deployDeterministic` | `0x3729f922` | +| `deployDeterministicAndCall` | `0xa97b90d5` | +| `initCodeHash` | `0xdb4c545e` | | `predictDeterministicAddress` | `0x5414dff0` | -| `upgrade` | `0x99a88ec4` | -| `upgradeAndCall` | `0x9623609d` | +| `upgrade` | `0x99a88ec4` | +| `upgradeAndCall` | `0x9623609d` | ## TestUSDC -| Function | Signature | -| -------- | --------- | +| Function | Signature | +| ------------------ | ------------ | | `DOMAIN_SEPARATOR` | `0x3644e515` | -| `allowance` | `0xdd62ed3e` | -| `approve` | `0x095ea7b3` | -| `balanceOf` | `0x70a08231` | -| `decimals` | `0x313ce567` | -| `mint` | `0x40c10f19` | -| `name` | `0x06fdde03` | -| `nonces` | `0x7ecebe00` | -| `owner` | `0x8da5cb5b` | -| `permit` | `0xd505accf` | -| `symbol` | `0x95d89b41` | -| `totalSupply` | `0x18160ddd` | -| `transfer` | `0xa9059cbb` | -| `transferFrom` | `0x23b872dd` | +| `allowance` | `0xdd62ed3e` | +| `approve` | `0x095ea7b3` | +| `balanceOf` | `0x70a08231` | +| `decimals` | `0x313ce567` | +| `mint` | `0x40c10f19` | +| `name` | `0x06fdde03` | +| `nonces` | `0x7ecebe00` | +| `owner` | `0x8da5cb5b` | +| `permit` | `0xd505accf` | +| `symbol` | `0x95d89b41` | +| `totalSupply` | `0x18160ddd` | +| `transfer` | `0xa9059cbb` | +| `transferFrom` | `0x23b872dd` | ## ContractFactoryPlug @@ -339,23 +340,23 @@ | `overrides` | `0x4a85f041` | | `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## Configurations -| Function | Signature | -| -------- | --------- | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getPlugConfigs` | `0x8a028c38` | -| `initialize` | `0x485cc955` | -| `isValidPlug` | `0xec8aef74` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getPlugConfigs` | `0x25945c1a` | +| `initialize` | `0x485cc955` | +| `isValidPlug` | `0x00f9b9f4` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | | `renounceOwnership` | `0x715018a6` | | `requestOwnershipHandover` | `0x25692962` | @@ -372,96 +373,96 @@ ## PromiseResolver -| Function | Signature | -| -------- | --------- | -| `markRevert` | `0x56501015` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| ----------------- | ------------ | +| `markRevert` | `0x56501015` | +| `rescueFunds` | `0x6ccae054` | | `resolvePromises` | `0xbf8484b8` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## RequestHandler -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `assignTransmitter` | `0xae5e9c48` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x3b5fd6fb` | -| `cancelRequestForReverts` | `0x82970278` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getBatchPayloadIds` | `0xfd83cd1f` | -| `getPayload` | `0xb48fd0fe` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequest` | `0xcf39abf6` | -| `getRequestBatchIds` | `0xe138fadb` | -| `handleRevert` | `0xcc88d3f9` | -| `increaseFees` | `0x10205541` | -| `initialize` | `0x485cc955` | -| `nextBatchCount` | `0x333a3963` | -| `nextRequestCount` | `0xfef72893` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadCounter` | `0x550ce1d5` | -| `precompiles` | `0x9932450b` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setPrecompile` | `0x122e0042` | -| `setRequestPayloadCountLimit` | `0x8526582b` | -| `submitRequest` | `0xbb299a2c` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| ------------------------------ | ------------ | +| `addressResolver__` | `0x6a750469` | +| `assignTransmitter` | `0xae5e9c48` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x3b5fd6fb` | +| `cancelRequestForReverts` | `0x82970278` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `getBatchPayloadIds` | `0xfd83cd1f` | +| `getPayload` | `0xb48fd0fe` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequest` | `0xcf39abf6` | +| `getRequestBatchIds` | `0xe138fadb` | +| `handleRevert` | `0xcc88d3f9` | +| `increaseFees` | `0x10205541` | +| `initialize` | `0x485cc955` | +| `nextBatchCount` | `0x333a3963` | +| `nextRequestCount` | `0xfef72893` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `payloadCounter` | `0x550ce1d5` | +| `precompiles` | `0x9932450b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setPrecompile` | `0x122e0042` | +| `setRequestPayloadCountLimit` | `0x8526582b` | +| `submitRequest` | `0xf91ba7cc` | +| `transferOwnership` | `0xf2fde38b` | | `updateRequestAndProcessBatch` | `0x46464471` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## Watcher -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `appGatewayTemp` | `0x1394c029` | -| `asyncDeployer__` | `0x2a39e801` | -| `callAppGateways` | `0x0050bef1` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x50ad0779` | -| `clearQueue` | `0xf22cb874` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `configurations__` | `0x52a3bbeb` | -| `deployForwarder__` | `0xd4e3b034` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `getCurrentRequestCount` | `0x5715abbb` | -| `getPayloadParams` | `0xae5eeb77` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequestParams` | `0x71263d0d` | -| `increaseFees` | `0xe9b304da` | -| `initialize` | `0xaaf7fc1a` | -| `isAppGatewayCalled` | `0xa79da6c7` | -| `isNonceUsed` | `0x5d00bb12` | -| `isWatcher` | `0x84785ecd` | -| `latestAsyncPromise` | `0xb8a8ba52` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `appGatewayTemp` | `0x1394c029` | +| `asyncDeployer__` | `0x2a39e801` | +| `callAppGateways` | `0x0050bef1` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x50ad0779` | +| `clearQueue` | `0xf22cb874` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `configurations__` | `0x52a3bbeb` | +| `deployForwarder__` | `0xd4e3b034` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `getCurrentRequestCount` | `0x5715abbb` | +| `getPayloadParams` | `0xae5eeb77` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequestParams` | `0x71263d0d` | +| `increaseFees` | `0xe9b304da` | +| `initialize` | `0xaaf7fc1a` | +| `isAppGatewayCalled` | `0xa79da6c7` | +| `isNonceUsed` | `0x5d00bb12` | +| `isWatcher` | `0x84785ecd` | +| `latestAsyncPromise` | `0xb8a8ba52` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadQueue` | `0x74f00ffb` | -| `promiseResolver__` | `0xdee152be` | -| `queue` | `0xf03ca7f7` | -| `queueAndSubmit` | `0xf0fb9665` | -| `renounceOwnership` | `0x715018a6` | -| `requestHandler__` | `0x55184561` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0xa58c6fc5` | -| `setCoreContracts` | `0xefa891c4` | -| `setIsValidPlug` | `0x7fc82ff6` | -| `setTriggerFees` | `0xaeb30511` | -| `submitRequest` | `0x4890b5ef` | -| `transferOwnership` | `0xf2fde38b` | -| `triggerFees` | `0x73f76aec` | -| `triggerFromChainSlug` | `0xd12b4f12` | -| `triggerFromPlug` | `0x3b847d12` | -| `watcherMultiCall` | `0x8021e82b` | -| `watcher__` | `0x300bb063` | +| `payloadQueue` | `0x74f00ffb` | +| `promiseResolver__` | `0xdee152be` | +| `queue` | `0x65967f1a` | +| `queueAndSubmit` | `0x9d4c9df7` | +| `renounceOwnership` | `0x715018a6` | +| `requestHandler__` | `0x55184561` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0xa58c6fc5` | +| `setCoreContracts` | `0xefa891c4` | +| `setIsValidPlug` | `0x06c0a40a` | +| `setTriggerFees` | `0xaeb30511` | +| `submitRequest` | `0x4890b5ef` | +| `transferOwnership` | `0xf2fde38b` | +| `triggerFees` | `0x73f76aec` | +| `triggerFromChainSlug` | `0xd12b4f12` | +| `triggerFromPlug` | `0x3b847d12` | +| `watcherMultiCall` | `0x8021e82b` | +| `watcher__` | `0x300bb063` | ## CCTPSwitchboard @@ -589,10 +590,10 @@ | `scheduleFeesPerSecond` | `0x852a74c1` | | `setExpiryTime` | `0x30fc4cff` | | `setMaxScheduleDelayInSeconds` | `0x12953318` | -| `setScheduleCallbackFees` | `0xec8fd71e` | -| `setScheduleFeesPerSecond` | `0x28e59e57` | -| `validateAndGetPrecompileData` | `0xab172aab` | -| `watcher__` | `0x300bb063` | +| `setScheduleCallbackFees` | `0xec8fd71e` | +| `setScheduleFeesPerSecond` | `0x28e59e57` | +| `validateAndGetPrecompileData` | `0x997f5bef` | +| `watcher__` | `0x300bb063` | ## WritePrecompile @@ -620,9 +621,8 @@ | `setFees` | `0x3d18678e` | | `transferOwnership` | `0xf2fde38b` | | `updateChainMaxMsgValueLimits` | `0x6a7aa6ac` | -| `uploadProof` | `0x81b48fcf` | -| `validateAndGetPrecompileData` | `0xab172aab` | -| `watcherProofs` | `0x3fa3166b` | -| `watcher__` | `0x300bb063` | -| `writeFees` | `0x5c664aeb` | - +| `uploadProof` | `0x81b48fcf` | +| `validateAndGetPrecompileData` | `0x997f5bef` | +| `watcherProofs` | `0x3fa3166b` | +| `watcher__` | `0x300bb063` | +| `writeFees` | `0x5c664aeb` | diff --git a/contracts/evmx/base/AppGatewayBase.sol b/contracts/evmx/base/AppGatewayBase.sol index 5bca560d..58c78652 100644 --- a/contracts/evmx/base/AppGatewayBase.sol +++ b/contracts/evmx/base/AppGatewayBase.sol @@ -172,7 +172,8 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { return bytes32(0); } - onChainAddress = IForwarder(forwarderAddresses[contractId_][chainSlug_]).getOnChainAddress(); + onChainAddress = IForwarder(forwarderAddresses[contractId_][chainSlug_]) + .getOnChainAddress(); } //////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 5a1fd70c..fd001d24 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -70,12 +70,7 @@ abstract contract FeesManagerStorage is IFeesManager { /// @title UserUtils /// @notice Contract for managing user utils -abstract contract Credit is - FeesManagerStorage, - Initializable, - Ownable, - AppGatewayBase -{ +abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatewayBase { /// @notice Emitted when fees deposited are updated /// @param chainSlug The chain identifier /// @param token The token address diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 2e71d741..0dc2621f 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -11,9 +11,7 @@ "0x13A3018920c7b56B20dd34E29C298121025E6de4", "FeesPool", "contracts/evmx/fees/FeesPool.sol", - [ - "0xb62505feacC486e809392c65614Ce4d7b051923b" - ] + ["0xb62505feacC486e809392c65614Ce4d7b051923b"] ], [ "0xC3f93140EF2f57a87FDdCe7DdADB544873b67C7D", @@ -62,9 +60,7 @@ "0xe0047f9b97c4C73948fe23F1bA807FE7906040C0", "PromiseResolver", "contracts/evmx/watcher/PromiseResolver.sol", - [ - "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB" - ] + ["0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB"] ], [ "0x95aB9c53FDa2ad009B6698d814735D0030796805", diff --git a/setupInfraContracts.sh b/setupInfraContracts.sh index c08fed42..91f41df8 100644 --- a/setupInfraContracts.sh +++ b/setupInfraContracts.sh @@ -1,16 +1,16 @@ -if [ "$1" = "skip-compile" ]; then - time npx hardhat run hardhat-scripts/deploy/1.deploy.ts --no-compile -else - time npx hardhat run hardhat-scripts/deploy/1.deploy.ts -fi -time npx hardhat run hardhat-scripts/deploy/2.roles.ts --no-compile -time npx hardhat run hardhat-scripts/deploy/3.configureChains.ts --no-compile -time npx hardhat run hardhat-scripts/deploy/4.configureEVMx.ts --no-compile -time npx hardhat run hardhat-scripts/deploy/5.fundTransfers.ts --no-compile -time npx hardhat run hardhat-scripts/deploy/6.connect.ts --no-compile -time npx ts-node hardhat-scripts/deploy/7.upload.ts -time npx ts-node hardhat-scripts/deploy/8.setupEnv.ts -time npx hardhat run hardhat-scripts/deploy/9.setupTransmitter.ts --no-compile +# if [ "$1" = "skip-compile" ]; then +# time npx hardhat run hardhat-scripts/deploy/1.deploy.ts --no-compile +# else +# time npx hardhat run hardhat-scripts/deploy/1.deploy.ts +# fi +# time npx hardhat run hardhat-scripts/deploy/2.roles.ts --no-compile +# time npx hardhat run hardhat-scripts/deploy/3.configureChains.ts --no-compile +# time npx hardhat run hardhat-scripts/deploy/4.configureEVMx.ts --no-compile +# time npx hardhat run hardhat-scripts/deploy/5.fundTransfers.ts --no-compile +# time npx hardhat run hardhat-scripts/deploy/6.connect.ts --no-compile +# time npx ts-node hardhat-scripts/deploy/7.upload.ts +# time npx ts-node hardhat-scripts/deploy/8.setupEnv.ts +# time npx hardhat run hardhat-scripts/deploy/9.setupTransmitter.ts --no-compile time npx hardhat run hardhat-scripts/misc-scripts/errorCodes.ts --no-compile time npx hardhat run hardhat-scripts/misc-scripts/eventTopics.ts --no-compile time npx hardhat run hardhat-scripts/misc-scripts/functionSigs.ts --no-compile diff --git a/src/signer.ts b/src/signer.ts index a553046d..78a6d8a1 100644 --- a/src/signer.ts +++ b/src/signer.ts @@ -24,10 +24,9 @@ export const signWatcherMultiCallMessage = async ( return { nonce: signatureNonce, signature }; }; - export const getNonce = () => { const timestamp = Date.now(); const random = Math.floor(Math.random() * 1000); const nonce = Number(String(timestamp) + String(random)); return nonce; -}; \ No newline at end of file +}; From 9bdbc2eb5852e56b689b91faf0d2826c05da19ef Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 16:19:35 +0530 Subject: [PATCH 058/139] fix: write precompile data --- contracts/evmx/watcher/precompiles/WritePrecompile.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index 7e7c5919..2eea6870 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -162,7 +162,7 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc ) = abi.decode( payloadParams.precompileData, - (address, Transaction, WriteFinality, uint256, uint256, bytes32) + (address, Transaction, WriteFinality, uint256, uint256, uint64) ); precompileData = payloadParams.precompileData; From fc2a9d72eb70652b9fbe779938ac9fceb688a52a Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 16:19:59 +0530 Subject: [PATCH 059/139] chore: uncomment --- setupInfraContracts.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/setupInfraContracts.sh b/setupInfraContracts.sh index 91f41df8..c08fed42 100644 --- a/setupInfraContracts.sh +++ b/setupInfraContracts.sh @@ -1,16 +1,16 @@ -# if [ "$1" = "skip-compile" ]; then -# time npx hardhat run hardhat-scripts/deploy/1.deploy.ts --no-compile -# else -# time npx hardhat run hardhat-scripts/deploy/1.deploy.ts -# fi -# time npx hardhat run hardhat-scripts/deploy/2.roles.ts --no-compile -# time npx hardhat run hardhat-scripts/deploy/3.configureChains.ts --no-compile -# time npx hardhat run hardhat-scripts/deploy/4.configureEVMx.ts --no-compile -# time npx hardhat run hardhat-scripts/deploy/5.fundTransfers.ts --no-compile -# time npx hardhat run hardhat-scripts/deploy/6.connect.ts --no-compile -# time npx ts-node hardhat-scripts/deploy/7.upload.ts -# time npx ts-node hardhat-scripts/deploy/8.setupEnv.ts -# time npx hardhat run hardhat-scripts/deploy/9.setupTransmitter.ts --no-compile +if [ "$1" = "skip-compile" ]; then + time npx hardhat run hardhat-scripts/deploy/1.deploy.ts --no-compile +else + time npx hardhat run hardhat-scripts/deploy/1.deploy.ts +fi +time npx hardhat run hardhat-scripts/deploy/2.roles.ts --no-compile +time npx hardhat run hardhat-scripts/deploy/3.configureChains.ts --no-compile +time npx hardhat run hardhat-scripts/deploy/4.configureEVMx.ts --no-compile +time npx hardhat run hardhat-scripts/deploy/5.fundTransfers.ts --no-compile +time npx hardhat run hardhat-scripts/deploy/6.connect.ts --no-compile +time npx ts-node hardhat-scripts/deploy/7.upload.ts +time npx ts-node hardhat-scripts/deploy/8.setupEnv.ts +time npx hardhat run hardhat-scripts/deploy/9.setupTransmitter.ts --no-compile time npx hardhat run hardhat-scripts/misc-scripts/errorCodes.ts --no-compile time npx hardhat run hardhat-scripts/misc-scripts/eventTopics.ts --no-compile time npx hardhat run hardhat-scripts/misc-scripts/functionSigs.ts --no-compile From 64a5446ee905547bdf8e0bd07ff336ad70c93432 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 28 Jul 2025 22:15:01 +0530 Subject: [PATCH 060/139] fix: scripts --- deployments/dev_addresses.json | 66 +++++++++------- deployments/dev_verification.json | 9 +-- foundry.toml | 45 +++++------ hardhat-scripts/config/config.ts | 4 +- hardhat-scripts/constants/feeConstants.ts | 2 +- hardhat-scripts/deploy/3.configureChains.ts | 11 ++- hardhat-scripts/s3Config/buildConfig.ts | 1 + package.json | 3 +- src/types.ts | 2 + yarn.lock | 85 ++++++++++++++++++++- 10 files changed, 166 insertions(+), 62 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index ffa4bd71..800d41be 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -1,4 +1,30 @@ { + "14323": { + "AddressResolver": "0x774f608eD8fc03B05a9da51588F8571ced4c2eb2", + "AddressResolverImpl": "0x9c58dAABeBE7D6DfD8F70097c6f9c87FEC9b83DE", + "AsyncDeployer": "0xF1D3ebDF91Cf4b1bc7C9A1D78413CD1Ed2d3123d", + "AsyncDeployerImpl": "0x8daf174Be9Bb708c04b708A92b88Cc89bd223498", + "AuctionManager": "0xE4243383566fcA32aA6815dE83e8EA86b2027b8b", + "AuctionManagerImpl": "0x122beAFCfc2E99D825322a78EAFD8a11fa2d9E0b", + "Configurations": "0x6a6697A2AD51DB9a41BaEE78e194335c1aD7369d", + "ConfigurationsImpl": "0x8A9256F31b0bb85863c253F8CAE800A32Cb2d595", + "DeployForwarder": "0xE986bCd19b8725ea3417C2A7728158ecABA6C8bE", + "DeployForwarderImpl": "0xfBe803842B50d8A2a91DA3dD88B67E92D5C0bd97", + "ERC1967Factory": "0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79", + "FeesManager": "0xa6D93e7B2cde3C8d318f45890dE3dB0a2E54058B", + "FeesManagerImpl": "0x38A7558D2C3b4097c2098444a46D625D51E7336F", + "FeesPool": "0x13A3018920c7b56B20dd34E29C298121025E6de4", + "PromiseResolver": "0x40834274ee715B1748e450A67cFf2B52b0388eC3", + "ReadPrecompile": "0xE693bEc40e39223749AC351156E713b7256541B0", + "RequestHandler": "0xE785Fdbd049D0647e8B2Bd28C75a679dEBaD9D6f", + "RequestHandlerImpl": "0x5332d341cd7B423C2f75AF7Ca295455e5F08fAcb", + "SchedulePrecompile": "0x99af65efe676C4899F6e500DF18d4fD84dbe0A1D", + "startBlock": 10904, + "Watcher": "0x96ACe2d4a36a1Fd6e3eeE1cD3FeDA36eA62E3064", + "WatcherImpl": "0xE5542FAB56B652A95aBD05a08E920687d1ef3849", + "WritePrecompile": "0x27794dd1166ED0c6A70c655C297BB79bF06bf44A", + "WritePrecompileImpl": "0xc2Ca571f4d4C2008Da4Bd750BaD3d50A5705ffF8" + }, "421614": { "CCTPSwitchboard": "0xaF912b7eaD59f5d8c8179f8606A3fa93459a612C", "CCTPSwitchboardId": "2", @@ -10,33 +36,12 @@ "MessageSwitchboardId": "3", "Socket": "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", "SocketBatcher": "0xd726FeF96aD21AAD24443FAE933DDa9c79716a93", - "startBlock": 178158322 - }, - "14323": { - "AddressResolver": "0xaBD3955e51bd83ACe4f9F403517F95be706A0424", - "AddressResolverImpl": "0x8fa6EF5A80E4Eca1302d2dfB85ae151275a4eA6A", - "AsyncDeployer": "0xDcb9387DB4675C585a9a2CB55C15F7fD96E3eae6", - "AsyncDeployerImpl": "0xcdbA9Ad5Da86d61a69ea94a52210C1f2008A849f", - "AuctionManager": "0x2C1A9c2aBcAc6468f4D828665093192807Bc31be", - "AuctionManagerImpl": "0x32a6E6F8c09823d8F8ddB285346b2c61Ed1F03b8", - "Configurations": "0xA551ea338E12F20EF47374DbdbfeAf83b14Ea615", - "ConfigurationsImpl": "0xbb163A49239260a5BE19f6aD9B5839f11F6aC24F", - "DeployForwarder": "0xA802b0F34379Ed2eD850c9906C7F32E3348c38AE", - "DeployForwarderImpl": "0x2682de36DFBf618dBEdFa4d18c265bdc04F7C9bb", - "ERC1967Factory": "0x32767D5390C2CD3619799c66f9F4E426c317Cd2F", - "FeesManager": "0x13079557a25aD9EdD85025D77e172f75ac8f2C92", - "FeesManagerImpl": "0x8DA71DE564096Ea4A43E794E1dEcA8F1692B69D7", - "FeesPool": "0x13A3018920c7b56B20dd34E29C298121025E6de4", - "PromiseResolver": "0xe0047f9b97c4C73948fe23F1bA807FE7906040C0", - "ReadPrecompile": "0x8D8770876e587300828Bc2B235C89F06CE473170", - "RequestHandler": "0x23B719aDd0CEeC1A5A05c3789204886E1A94c612", - "RequestHandlerImpl": "0x95aB9c53FDa2ad009B6698d814735D0030796805", - "SchedulePrecompile": "0x1D530df25aE08F7A440CA155c9d53540C2c50A82", - "startBlock": 10845, - "Watcher": "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB", - "WatcherImpl": "0x26d5DFaaB493292c7d2Cc8C1eD447bd944127935", - "WritePrecompile": "0x239C1fCdB2B45EB65dE80836Bcf13d1f12d7f320", - "WritePrecompileImpl": "0x4F1FB4E9169f4A604e3eb9833987338D48B8Dd77" + "startBlock": 178158322, + "SwitchboardIdToAddressMap": { + "1": "0xd8DDEA0c49C0bcbFD31272c262a4b31FfB44a8Bc", + "2": "0xaF912b7eaD59f5d8c8179f8606A3fa93459a612C", + "3": "0x0C049f6Dd92eA5dA05058b9B309755Cb347587C9" + } }, "11155420": { "CCTPSwitchboard": "0x1801b7e2E553c7233c2fd7c9e8647f6b91ff7a76", @@ -49,6 +54,11 @@ "MessageSwitchboardId": "3", "Socket": "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", "SocketBatcher": "0x87C9a09e05D0D2A885eb7B2644c3CBB8E70763b6", - "startBlock": 30946234 + "startBlock": 30946234, + "SwitchboardIdToAddressMap": { + "1": "0x9f1DE81ff3274eD6678a5A1644F430b06EF0992D", + "2": "0x1801b7e2E553c7233c2fd7c9e8647f6b91ff7a76", + "3": "0xE3756057aEd63488Acbfa6DC31a3E99bFBcf0d4A" + } } } diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 2e71d741..3b3f4600 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1,4 +1,5 @@ { + "14323": [], "421614": [], "7625382": [ [ @@ -11,9 +12,7 @@ "0x13A3018920c7b56B20dd34E29C298121025E6de4", "FeesPool", "contracts/evmx/fees/FeesPool.sol", - [ - "0xb62505feacC486e809392c65614Ce4d7b051923b" - ] + ["0xb62505feacC486e809392c65614Ce4d7b051923b"] ], [ "0xC3f93140EF2f57a87FDdCe7DdADB544873b67C7D", @@ -62,9 +61,7 @@ "0xe0047f9b97c4C73948fe23F1bA807FE7906040C0", "PromiseResolver", "contracts/evmx/watcher/PromiseResolver.sol", - [ - "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB" - ] + ["0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB"] ], [ "0x95aB9c53FDa2ad009B6698d814735D0030796805", diff --git a/foundry.toml b/foundry.toml index 7ec67782..0ddd48f5 100644 --- a/foundry.toml +++ b/foundry.toml @@ -10,26 +10,27 @@ evm_version = 'paris' via_ir = false [labels] -0xaBD3955e51bd83ACe4f9F403517F95be706A0424 = "AddressResolver" -0x8fa6EF5A80E4Eca1302d2dfB85ae151275a4eA6A = "AddressResolverImpl" -0xDcb9387DB4675C585a9a2CB55C15F7fD96E3eae6 = "AsyncDeployer" -0xcdbA9Ad5Da86d61a69ea94a52210C1f2008A849f = "AsyncDeployerImpl" -0x2C1A9c2aBcAc6468f4D828665093192807Bc31be = "AuctionManager" -0x32a6E6F8c09823d8F8ddB285346b2c61Ed1F03b8 = "AuctionManagerImpl" -0xA551ea338E12F20EF47374DbdbfeAf83b14Ea615 = "Configurations" -0xbb163A49239260a5BE19f6aD9B5839f11F6aC24F = "ConfigurationsImpl" -0xA802b0F34379Ed2eD850c9906C7F32E3348c38AE = "DeployForwarder" -0x2682de36DFBf618dBEdFa4d18c265bdc04F7C9bb = "DeployForwarderImpl" -0x32767D5390C2CD3619799c66f9F4E426c317Cd2F = "ERC1967Factory" -0x13079557a25aD9EdD85025D77e172f75ac8f2C92 = "FeesManager" -0x8DA71DE564096Ea4A43E794E1dEcA8F1692B69D7 = "FeesManagerImpl" +0x774f608eD8fc03B05a9da51588F8571ced4c2eb2 = "AddressResolver" +0x9c58dAABeBE7D6DfD8F70097c6f9c87FEC9b83DE = "AddressResolverImpl" +0xF1D3ebDF91Cf4b1bc7C9A1D78413CD1Ed2d3123d = "AsyncDeployer" +0x8daf174Be9Bb708c04b708A92b88Cc89bd223498 = "AsyncDeployerImpl" +0xE4243383566fcA32aA6815dE83e8EA86b2027b8b = "AuctionManager" +0x122beAFCfc2E99D825322a78EAFD8a11fa2d9E0b = "AuctionManagerImpl" +0x6a6697A2AD51DB9a41BaEE78e194335c1aD7369d = "Configurations" +0x8A9256F31b0bb85863c253F8CAE800A32Cb2d595 = "ConfigurationsImpl" +0xE986bCd19b8725ea3417C2A7728158ecABA6C8bE = "DeployForwarder" +0xfBe803842B50d8A2a91DA3dD88B67E92D5C0bd97 = "DeployForwarderImpl" +0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79 = "ERC1967Factory" +0xa6D93e7B2cde3C8d318f45890dE3dB0a2E54058B = "FeesManager" +0x38A7558D2C3b4097c2098444a46D625D51E7336F = "FeesManagerImpl" 0x13A3018920c7b56B20dd34E29C298121025E6de4 = "FeesPool" -0xe0047f9b97c4C73948fe23F1bA807FE7906040C0 = "PromiseResolver" -0x8D8770876e587300828Bc2B235C89F06CE473170 = "ReadPrecompile" -0x23B719aDd0CEeC1A5A05c3789204886E1A94c612 = "RequestHandler" -0x95aB9c53FDa2ad009B6698d814735D0030796805 = "RequestHandlerImpl" -0x1D530df25aE08F7A440CA155c9d53540C2c50A82 = "SchedulePrecompile" -0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB = "Watcher" -0x26d5DFaaB493292c7d2Cc8C1eD447bd944127935 = "WatcherImpl" -0x239C1fCdB2B45EB65dE80836Bcf13d1f12d7f320 = "WritePrecompile" -0x4F1FB4E9169f4A604e3eb9833987338D48B8Dd77 = "WritePrecompileImpl" +0x40834274ee715B1748e450A67cFf2B52b0388eC3 = "PromiseResolver" +0xE693bEc40e39223749AC351156E713b7256541B0 = "ReadPrecompile" +0xE785Fdbd049D0647e8B2Bd28C75a679dEBaD9D6f = "RequestHandler" +0x5332d341cd7B423C2f75AF7Ca295455e5F08fAcb = "RequestHandlerImpl" +0x99af65efe676C4899F6e500DF18d4fD84dbe0A1D = "SchedulePrecompile" +0x96ACe2d4a36a1Fd6e3eeE1cD3FeDA36eA62E3064 = "Watcher" +0xE5542FAB56B652A95aBD05a08E920687d1ef3849 = "WatcherImpl" +0x27794dd1166ED0c6A70c655C297BB79bF06bf44A = "WritePrecompile" +0xc2Ca571f4d4C2008Da4Bd750BaD3d50A5705ffF8 = "WritePrecompileImpl" +0x337720E1F09013B0bc04D55a7f0f5bac94a11840 = "APP_GATEWAY" diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index e55b7045..b493b520 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -29,7 +29,7 @@ export const getChains = () => { return [ ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA, - ChainSlug.BASE_SEPOLIA, + // ChainSlug.BASE_SEPOLIA, ]; case DeploymentMode.DEV: return [ @@ -88,7 +88,7 @@ export const chains: Array = getChains(); export const EVM_CHAIN_ID_MAP: Record = { [DeploymentMode.LOCAL]: 7625382, [DeploymentMode.DEV]: 14323, - [DeploymentMode.STAGE]: 43, + [DeploymentMode.STAGE]: 14323, [DeploymentMode.PROD]: 3605, }; diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index 0d0ce6be..3056c429 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -21,7 +21,7 @@ const tokens: TokenMap = { const feePools: { [key: string]: string } = { [DeploymentMode.LOCAL]: "0x9De353dD1131aB4e502590D3a1832652FA316268", [DeploymentMode.DEV]: "0x13A3018920c7b56B20dd34E29C298121025E6de4", - [DeploymentMode.STAGE]: "0xe2054B575664dfDBD7a7FbAf2B12420ae88DE0FF", + [DeploymentMode.STAGE]: "0x13A3018920c7b56B20dd34E29C298121025E6de4", }; export const getFeeTokens = (chainSlug: number): string[] => { diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 5149d872..b2c23fb0 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -59,7 +59,7 @@ export const configureChains = async (addresses: DeploymentAddresses) => { signer: signer, currentChainSlug: chain as ChainSlug, }; - + deployUtils.addresses.SwitchboardIdToAddressMap = {}; const socketContract = ( await getInstance(Contracts.Socket, chainAddresses[Contracts.Socket]) ).connect(signer); @@ -72,6 +72,9 @@ export const configureChains = async (addresses: DeploymentAddresses) => { ); deployUtils.addresses[Contracts.FastSwitchboardId] = fastSwitchboardId.toString(); + deployUtils.addresses.SwitchboardIdToAddressMap[ + fastSwitchboardId.toString() + ] = chainAddresses[Contracts.FastSwitchboard]; const cctpSwitchboardId = await registerSb( chain, @@ -81,6 +84,9 @@ export const configureChains = async (addresses: DeploymentAddresses) => { ); deployUtils.addresses[Contracts.CCTPSwitchboardId] = cctpSwitchboardId.toString(); + deployUtils.addresses.SwitchboardIdToAddressMap[ + cctpSwitchboardId.toString() + ] = chainAddresses[Contracts.CCTPSwitchboard]; const messageSwitchboardId = await registerSb( chain, @@ -90,6 +96,9 @@ export const configureChains = async (addresses: DeploymentAddresses) => { ); deployUtils.addresses[Contracts.MessageSwitchboardId] = messageSwitchboardId.toString(); + deployUtils.addresses.SwitchboardIdToAddressMap[ + messageSwitchboardId.toString() + ] = chainAddresses[Contracts.MessageSwitchboard]; if (chainAddresses[Contracts.FeesPlug]) { await whitelistToken(chain, chainAddresses[Contracts.FeesPlug], signer); diff --git a/hardhat-scripts/s3Config/buildConfig.ts b/hardhat-scripts/s3Config/buildConfig.ts index 73bac889..5ac578b5 100644 --- a/hardhat-scripts/s3Config/buildConfig.ts +++ b/hardhat-scripts/s3Config/buildConfig.ts @@ -23,6 +23,7 @@ export const getS3Config = () => { chains: {}, testnetChainSlugs: testnetChains, mainnetChainSlugs: mainnetChains, + evmxChainSlug: EVMX_CHAIN_ID as ChainSlug, }; supportedChainSlugs.forEach((chainSlug) => { config.chains[chainSlug] = getChainConfig(chainSlug); diff --git a/package.json b/package.json index 7aa6ab30..e284de83 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.1.32", + "version": "1.1.37", "description": "socket protocol", "scripts": { "build": "yarn abi && tsc --project lib.tsconfig.json", @@ -44,6 +44,7 @@ "hardhat-preprocessor": "0.1.4", "http-server": "^14.1.1", "path": "^0.12.7", + "pg": "^8.16.3", "pre-commit": "^1.2.2", "prettier": "^2.3.1", "prettier-plugin-solidity": "^1.4.1", diff --git a/src/types.ts b/src/types.ts index ba31d81e..a603b158 100644 --- a/src/types.ts +++ b/src/types.ts @@ -28,6 +28,7 @@ export type ChainAddressesObj = { SocketFeesManager?: string; FeesPlug?: string; startBlock: number; + SwitchboardIdToAddressMap: { [switchboardId: string]: string }; }; export type EVMxAddressesObj = { @@ -53,6 +54,7 @@ export type S3Config = { chains: { [chainSlug: number]: ChainConfig }; supportedChainSlugs: number[]; testnetChainSlugs: number[]; + evmxChainSlug: number; mainnetChainSlugs: number[]; }; diff --git a/yarn.lock b/yarn.lock index 74278d03..a9f749d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4157,11 +4157,67 @@ pbkdf2@^3.0.17: safe-buffer "^5.0.1" sha.js "^2.4.8" +pg-cloudflare@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/pg-cloudflare/-/pg-cloudflare-1.2.7.tgz#a1f3d226bab2c45ae75ea54d65ec05ac6cfafbef" + integrity sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg== + pg-connection-string@^2.6.1: version "2.7.0" resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.7.0.tgz#f1d3489e427c62ece022dba98d5262efcb168b37" integrity sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA== +pg-connection-string@^2.9.1: + version "2.9.1" + resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.9.1.tgz#bb1fd0011e2eb76ac17360dc8fa183b2d3465238" + integrity sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w== + +pg-int8@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" + integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== + +pg-pool@^3.10.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.10.1.tgz#481047c720be2d624792100cac1816f8850d31b2" + integrity sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg== + +pg-protocol@^1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.10.3.tgz#ac9e4778ad3f84d0c5670583bab976ea0a34f69f" + integrity sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ== + +pg-types@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3" + integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA== + dependencies: + pg-int8 "1.0.1" + postgres-array "~2.0.0" + postgres-bytea "~1.0.0" + postgres-date "~1.0.4" + postgres-interval "^1.1.0" + +pg@^8.16.3: + version "8.16.3" + resolved "https://registry.yarnpkg.com/pg/-/pg-8.16.3.tgz#160741d0b44fdf64680e45374b06d632e86c99fd" + integrity sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw== + dependencies: + pg-connection-string "^2.9.1" + pg-pool "^3.10.1" + pg-protocol "^1.10.3" + pg-types "2.2.0" + pgpass "1.0.5" + optionalDependencies: + pg-cloudflare "^1.2.7" + +pgpass@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/pgpass/-/pgpass-1.0.5.tgz#9b873e4a564bb10fa7a7dbd55312728d422a223d" + integrity sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug== + dependencies: + split2 "^4.1.0" + picocolors@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" @@ -4210,6 +4266,28 @@ portfinder@^1.0.28: debug "^3.2.7" mkdirp "^0.5.6" +postgres-array@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" + integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA== + +postgres-bytea@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35" + integrity sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w== + +postgres-date@~1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8" + integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q== + +postgres-interval@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695" + integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ== + dependencies: + xtend "^4.0.0" + pre-commit@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/pre-commit/-/pre-commit-1.2.2.tgz#dbcee0ee9de7235e57f79c56d7ce94641a69eec6" @@ -4614,7 +4692,7 @@ spawn-sync@^1.0.15: concat-stream "^1.4.7" os-shim "^0.1.2" -split2@^4.0.0: +split2@^4.0.0, split2@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== @@ -5002,6 +5080,11 @@ ws@^7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== +xtend@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" From 01f331b8ec1887762e18ceb76495af8aa421f8a6 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 23:06:29 +0530 Subject: [PATCH 061/139] fix: scripts --- Errors.md | 219 ++-- EventTopics.md | 435 ++++---- FunctionSignatures.md | 1073 ++++++++++--------- foundry.toml | 47 +- hardhat-scripts/config/config.ts | 2 +- hardhat-scripts/constants/feeConstants.ts | 2 +- hardhat-scripts/deploy/3.configureChains.ts | 35 +- hardhat-scripts/deploy/6.connect.ts | 10 +- hardhat-scripts/utils/overrides.ts | 2 +- 9 files changed, 928 insertions(+), 897 deletions(-) diff --git a/Errors.md b/Errors.md index ae06096c..9b2050c9 100644 --- a/Errors.md +++ b/Errors.md @@ -1,175 +1,176 @@ # Custom Error Codes + ## evmx/fees/FeesPool.sol -| Error | Signature | -| ------------------ | ------------ | +| Error | Signature | +|-------|-----------| | `TransferFailed()` | `0x90b8ec18` | ## evmx/helpers/AsyncPromise.sol -| Error | Signature | -| -------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `PromiseAlreadyResolved()` | `0x56b63537` | -| `OnlyInvoker()` | `0x74ed21f5` | -| `PromiseAlreadySetUp()` | `0x927c53d5` | -| `PromiseRevertFailed()` | `0x0175b9de` | -| `NotLatestPromise()` | `0x39ca95d3` | +| `OnlyInvoker()` | `0x74ed21f5` | +| `PromiseAlreadySetUp()` | `0x927c53d5` | +| `PromiseRevertFailed()` | `0x0175b9de` | +| `NotLatestPromise()` | `0x39ca95d3` | ## evmx/plugs/ContractFactoryPlug.sol -| Error | Signature | -| -------------------------------- | ------------ | -| `DeploymentFailed()` | `0x30116425` | +| Error | Signature | +|-------|-----------| +| `DeploymentFailed()` | `0x30116425` | | `ExecutionFailed(bytes32,bytes)` | `0xd255d8a3` | -| `information(bool,,bytes)` | `0x3a82a1f3` | +| `information(bool,,bytes)` | `0x3a82a1f3` | ## evmx/plugs/FeesPlug.sol -| Error | Signature | -| --------------------------------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientTokenBalance(address,uint256,uint256)` | `0xebd6ced9` | -| `InvalidDepositAmount()` | `0xfe9ba5cd` | -| `TokenNotWhitelisted(address)` | `0xea3bff2e` | +| `InvalidDepositAmount()` | `0xfe9ba5cd` | +| `TokenNotWhitelisted(address)` | `0xea3bff2e` | ## evmx/watcher/RequestHandler.sol -| Error | Signature | -| ----------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientMaxFees()` | `0x0e5bc492` | ## protocol/Socket.sol -| Error | Signature | -| ----------------------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `PayloadAlreadyExecuted(ExecutionStatus)` | `0xf4c54edd` | -| `VerificationFailed()` | `0x439cc0cd` | -| `LowGasLimit()` | `0xd38edae0` | -| `InsufficientMsgValue()` | `0x78f38f76` | +| `VerificationFailed()` | `0x439cc0cd` | +| `LowGasLimit()` | `0xd38edae0` | +| `InsufficientMsgValue()` | `0x78f38f76` | ## protocol/SocketConfig.sol -| Error | Signature | -| --------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `SwitchboardExists()` | `0x2dff8555` | -| `PlugNotConnected()` | `0x411d0255` | +| `PlugNotConnected()` | `0x411d0255` | ## protocol/SocketFeeManager.sol -| Error | Signature | -| -------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientFees()` | `0x8d53e553` | -| `FeeTooLow()` | `0x732f9413` | +| `FeeTooLow()` | `0x732f9413` | ## protocol/SocketUtils.sol -| Error | Signature | -| -------------------- | ------------ | -| `OnlyOffChain()` | `0x9cbfe066` | +| Error | Signature | +|-------|-----------| +| `OnlyOffChain()` | `0x9cbfe066` | | `SimulationFailed()` | `0x2fbab3ac` | ## protocol/base/MessagePlugBase.sol -| Error | Signature | -| ---------------- | ------------ | +| Error | Signature | +|-------|-----------| | `NotSupported()` | `0xa0387940` | ## protocol/switchboard/CCTPSwitchboard.sol -| Error | Signature | -| ------------------------------- | ------------ | -| `RemoteExecutionNotFound()` | `0xbd506972` | +| Error | Signature | +|-------|-----------| +| `RemoteExecutionNotFound()` | `0xbd506972` | | `PrevBatchDigestHashMismatch()` | `0xc9864e9d` | -| `NotAttested()` | `0x99efb890` | -| `NotExecuted()` | `0xec84b1da` | -| `InvalidSender()` | `0xddb5de5e` | -| `OnlyMessageTransmitter()` | `0x935ac89c` | +| `NotAttested()` | `0x99efb890` | +| `NotExecuted()` | `0xec84b1da` | +| `InvalidSender()` | `0xddb5de5e` | +| `OnlyMessageTransmitter()` | `0x935ac89c` | ## protocol/switchboard/FastSwitchboard.sol -| Error | Signature | -| ------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `AlreadyAttested()` | `0x35d90805` | | `WatcherNotFound()` | `0xa278e4ad` | ## protocol/switchboard/MessageSwitchboard.sol -| Error | Signature | -| ----------------------------- | ------------ | -| `AlreadyAttested()` | `0x35d90805` | -| `WatcherNotFound()` | `0xa278e4ad` | -| `SiblingNotFound()` | `0xb3b47851` | +| Error | Signature | +|-------|-----------| +| `AlreadyAttested()` | `0x35d90805` | +| `WatcherNotFound()` | `0xa278e4ad` | +| `SiblingNotFound()` | `0xb3b47851` | | `InvalidTargetVerification()` | `0xe9377a19` | -| `InvalidMsgValue()` | `0x1841b4e1` | +| `InvalidMsgValue()` | `0x1841b4e1` | ## utils/AccessControl.sol -| Error | Signature | -| ------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `NoPermit(bytes32)` | `0x962f6333` | ## utils/common/Converters.sol -| Error | Signature | -| -------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `NotAnEvmAddress(bytes32)` | `0x33b960d0` | ## utils/common/Errors.sol -| Error | Signature | -| --------------------------------------------- | ------------ | -| `ZeroAddress()` | `0xd92e233d` | -| `InvalidTransmitter()` | `0x58a70a0a` | -| `InvalidTokenAddress()` | `0x1eb00b06` | -| `InvalidSwitchboard()` | `0xf63c9e4d` | -| `SocketAlreadyInitialized()` | `0xc9500b00` | -| `NotSocket()` | `0xc59f8f7c` | -| `PlugNotFound()` | `0x5f1ac76a` | -| `ResolvingScheduleTooEarly()` | `0x207e8731` | -| `CallFailed()` | `0x3204506f` | -| `InvalidAppGateway()` | `0x82ded261` | -| `AppGatewayAlreadyCalled()` | `0xb224683f` | -| `InvalidCallerTriggered()` | `0x3292d247` | -| `InvalidPromise()` | `0x45f2d176` | -| `InvalidWatcherSignature()` | `0x5029f14f` | -| `NonceUsed()` | `0x1f6d5aef` | -| `AsyncModifierNotSet()` | `0xcae106f9` | -| `WatcherNotSet()` | `0x42d473a7` | -| `InvalidTarget()` | `0x82d5d76a` | -| `InvalidIndex()` | `0x63df8171` | -| `InvalidChainSlug()` | `0xbff6b106` | -| `InvalidPayloadSize()` | `0xfbdf7954` | -| `InvalidOnChainAddress()` | `0xb758c606` | -| `InvalidScheduleDelay()` | `0x9a993219` | -| `AuctionClosed()` | `0x36b6b46d` | -| `AuctionNotOpen()` | `0xf0460077` | -| `BidExceedsMaxFees()` | `0x4c923f3c` | -| `LowerBidAlreadyExists()` | `0xaaa1f709` | -| `RequestCountMismatch()` | `0x98bbcbff` | -| `InvalidAmount()` | `0x2c5211c6` | -| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | -| `InsufficientBalance()` | `0xf4d678b8` | -| `InvalidCaller()` | `0x48f5c3ed` | -| `InvalidGateway()` | `0xfc9dfe85` | -| `RequestAlreadyCancelled()` | `0xc70f47d8` | -| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | -| `InvalidBid()` | `0xc6388ef7` | -| `MaxReAuctionCountReached()` | `0xf2b4388c` | -| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | -| `OnlyWatcherAllowed()` | `0xdf7d227c` | -| `InvalidPrecompileData()` | `0x320062c0` | -| `InvalidCallType()` | `0x39d2eb55` | -| `NotRequestHandler()` | `0x8f8cba5b` | -| `NotInvoker()` | `0x8a6353d1` | -| `NotPromiseResolver()` | `0x86d876b2` | -| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | -| `InsufficientFees()` | `0x8d53e553` | -| `RequestAlreadySettled()` | `0x66fad465` | -| `NoWriteRequest()` | `0x9dcd3065` | -| `AlreadyAssigned()` | `0x9688dc51` | -| `OnlyAppGateway()` | `0xfec944ea` | +| Error | Signature | +|-------|-----------| +| `ZeroAddress()` | `0xd92e233d` | +| `InvalidTransmitter()` | `0x58a70a0a` | +| `InvalidTokenAddress()` | `0x1eb00b06` | +| `InvalidSwitchboard()` | `0xf63c9e4d` | +| `SocketAlreadyInitialized()` | `0xc9500b00` | +| `NotSocket()` | `0xc59f8f7c` | +| `PlugNotFound()` | `0x5f1ac76a` | +| `ResolvingScheduleTooEarly()` | `0x207e8731` | +| `CallFailed()` | `0x3204506f` | +| `InvalidAppGateway()` | `0x82ded261` | +| `AppGatewayAlreadyCalled()` | `0xb224683f` | +| `InvalidCallerTriggered()` | `0x3292d247` | +| `InvalidPromise()` | `0x45f2d176` | +| `InvalidWatcherSignature()` | `0x5029f14f` | +| `NonceUsed()` | `0x1f6d5aef` | +| `AsyncModifierNotSet()` | `0xcae106f9` | +| `WatcherNotSet()` | `0x42d473a7` | +| `InvalidTarget()` | `0x82d5d76a` | +| `InvalidIndex()` | `0x63df8171` | +| `InvalidChainSlug()` | `0xbff6b106` | +| `InvalidPayloadSize()` | `0xfbdf7954` | +| `InvalidOnChainAddress()` | `0xb758c606` | +| `InvalidScheduleDelay()` | `0x9a993219` | +| `AuctionClosed()` | `0x36b6b46d` | +| `AuctionNotOpen()` | `0xf0460077` | +| `BidExceedsMaxFees()` | `0x4c923f3c` | +| `LowerBidAlreadyExists()` | `0xaaa1f709` | +| `RequestCountMismatch()` | `0x98bbcbff` | +| `InvalidAmount()` | `0x2c5211c6` | +| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | +| `InsufficientBalance()` | `0xf4d678b8` | +| `InvalidCaller()` | `0x48f5c3ed` | +| `InvalidGateway()` | `0xfc9dfe85` | +| `RequestAlreadyCancelled()` | `0xc70f47d8` | +| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | +| `InvalidBid()` | `0xc6388ef7` | +| `MaxReAuctionCountReached()` | `0xf2b4388c` | +| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | +| `OnlyWatcherAllowed()` | `0xdf7d227c` | +| `InvalidPrecompileData()` | `0x320062c0` | +| `InvalidCallType()` | `0x39d2eb55` | +| `NotRequestHandler()` | `0x8f8cba5b` | +| `NotInvoker()` | `0x8a6353d1` | +| `NotPromiseResolver()` | `0x86d876b2` | +| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | +| `InsufficientFees()` | `0x8d53e553` | +| `RequestAlreadySettled()` | `0x66fad465` | +| `NoWriteRequest()` | `0x9dcd3065` | +| `AlreadyAssigned()` | `0x9688dc51` | +| `OnlyAppGateway()` | `0xfec944ea` | | `NewMaxFeesLowerThanCurrent(uint256,uint256)` | `0x1345dda1` | -| `InvalidContract()` | `0x6eefed20` | -| `InvalidData()` | `0x5cb045db` | -| `InvalidSignature()` | `0x8baa579f` | -| `DeadlinePassed()` | `0x70f65caa` | +| `InvalidContract()` | `0x6eefed20` | +| `InvalidData()` | `0x5cb045db` | +| `InvalidSignature()` | `0x8baa579f` | +| `DeadlinePassed()` | `0x70f65caa` | diff --git a/EventTopics.md b/EventTopics.md index 0a408806..2eee906a 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -2,39 +2,39 @@ ## AuctionManager -| Event | Arguments | Topic | -| ---------------------------- | ------------------------------------------- | -------------------------------------------------------------------- | -| `AuctionEndDelaySecondsSet` | `(auctionEndDelaySeconds: uint256)` | `0xf38f0d9dc8459cf5426728c250d115196a4c065ebc1a6c29da24764a8c0da722` | -| `AuctionEnded` | `(requestCount: uint40, winningBid: tuple)` | `0xede4ec1efc469fac10dcb4930f70be4cd21f3700ed61c91967c19a7cd7c0d86e` | -| `AuctionRestarted` | `(requestCount: uint40)` | `0x071867b21946ec4655665f0d4515d3757a5a52f144c762ecfdfb11e1da542b82` | -| `AuctionStarted` | `(requestCount: uint40)` | `0xcd040613cf8ef0cfcaa3af0d711783e827a275fc647c116b74595bf17cb9364f` | -| `BidPlaced` | `(requestCount: uint40, bid: tuple)` | `0x7f79485e4c9aeea5d4899bc6f7c63b22ac1f4c01d2d28c801e94732fee657b5d` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `MaxReAuctionCountSet` | `(maxReAuctionCount: uint256)` | `0x2f6fadde7ab8ab83d21ab10c3bc09dde179f8696d47c4176581facf0c6f96bbf` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AuctionEndDelaySecondsSet` | `(auctionEndDelaySeconds: uint256)` | `0xf38f0d9dc8459cf5426728c250d115196a4c065ebc1a6c29da24764a8c0da722` | +| `AuctionEnded` | `(requestCount: uint40, winningBid: tuple)` | `0xede4ec1efc469fac10dcb4930f70be4cd21f3700ed61c91967c19a7cd7c0d86e` | +| `AuctionRestarted` | `(requestCount: uint40)` | `0x071867b21946ec4655665f0d4515d3757a5a52f144c762ecfdfb11e1da542b82` | +| `AuctionStarted` | `(requestCount: uint40)` | `0xcd040613cf8ef0cfcaa3af0d711783e827a275fc647c116b74595bf17cb9364f` | +| `BidPlaced` | `(requestCount: uint40, bid: tuple)` | `0x7f79485e4c9aeea5d4899bc6f7c63b22ac1f4c01d2d28c801e94732fee657b5d` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `MaxReAuctionCountSet` | `(maxReAuctionCount: uint256)` | `0x2f6fadde7ab8ab83d21ab10c3bc09dde179f8696d47c4176581facf0c6f96bbf` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## Socket -| Event | Arguments | Topic | -| ---------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `AppGatewayCallRequested` | `(triggerId: bytes32, appGatewayId: bytes32, switchboardId: uint64, plug: bytes32, overrides: bytes, payload: bytes)` | `0x8ff0599581fd62c5733e52cea3abd7874731f4a9f86ebb929e5e4afe103f74d4` | -| `ExecutionFailed` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x385334bc68a32c4d164625189adc7633e6074eb1b837fb4d11d768245151e4ce` | -| `ExecutionSuccess` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x324d63a433b21a12b90e79cd2ba736b2a5238be6165e03b750fa4a7d5193d5d9` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `PlugConnected` | `(plug: address, appGatewayId: bytes32, switchboardId: uint64)` | `0xb2a45daaee4fc6ced936700efec176684095e7b77c4cb1419b578ecc6f2ebce6` | -| `PlugDisconnected` | `(plug: address)` | `0x474a53f61630e976f47075b6029ba8d55d0563151bdb9222c5dbdc88f7af6f51` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SocketFeeManagerUpdated` | `(oldSocketFeeManager: address, newSocketFeeManager: address)` | `0xdcb02e10d5220346a4638aa2826eaab1897306623bc40a427049e4ebd12255b4` | -| `SwitchboardAdded` | `(switchboard: address, switchboardId: uint64)` | `0x2f945cce0a82eacc4841d996b3d0429e01c7c603f3f900253d21b428c760dce1` | -| `SwitchboardDisabled` | `(switchboardId: uint64)` | `0x9ab25a32266417ee52a390121ebca0463374e76cecb25596a0f68e9d96a9e0ff` | -| `SwitchboardEnabled` | `(switchboardId: uint64)` | `0xa1cea6c3e73c288db1f2e2d7f04d9fd5f12463c30019b4ed354ba8bc7bc26f28` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AppGatewayCallRequested` | `(triggerId: bytes32, appGatewayId: bytes32, switchboardId: uint64, plug: bytes32, overrides: bytes, payload: bytes)` | `0x8ff0599581fd62c5733e52cea3abd7874731f4a9f86ebb929e5e4afe103f74d4` | +| `ExecutionFailed` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x385334bc68a32c4d164625189adc7633e6074eb1b837fb4d11d768245151e4ce` | +| `ExecutionSuccess` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x324d63a433b21a12b90e79cd2ba736b2a5238be6165e03b750fa4a7d5193d5d9` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `PlugConnected` | `(plug: address, appGatewayId: bytes32, switchboardId: uint64)` | `0xb2a45daaee4fc6ced936700efec176684095e7b77c4cb1419b578ecc6f2ebce6` | +| `PlugDisconnected` | `(plug: address)` | `0x474a53f61630e976f47075b6029ba8d55d0563151bdb9222c5dbdc88f7af6f51` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SocketFeeManagerUpdated` | `(oldSocketFeeManager: address, newSocketFeeManager: address)` | `0xdcb02e10d5220346a4638aa2826eaab1897306623bc40a427049e4ebd12255b4` | +| `SwitchboardAdded` | `(switchboard: address, switchboardId: uint64)` | `0x2f945cce0a82eacc4841d996b3d0429e01c7c603f3f900253d21b428c760dce1` | +| `SwitchboardDisabled` | `(switchboardId: uint64)` | `0x9ab25a32266417ee52a390121ebca0463374e76cecb25596a0f68e9d96a9e0ff` | +| `SwitchboardEnabled` | `(switchboardId: uint64)` | `0xa1cea6c3e73c288db1f2e2d7f04d9fd5f12463c30019b4ed354ba8bc7bc26f28` | ## IFastSwitchboard @@ -43,192 +43,192 @@ ## SocketBatcher -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## SocketFeeManager -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SocketFeesUpdated` | `(oldFees: uint256, newFees: uint256)` | `0xcbd4d756fb6198bbcc2e4013cce929f504ad46e9d97c543ef9a8dfea3e407053` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SocketFeesUpdated` | `(oldFees: uint256, newFees: uint256)` | `0xcbd4d756fb6198bbcc2e4013cce929f504ad46e9d97c543ef9a8dfea3e407053` | ## FeesManager -| Event | Arguments | Topic | -| ----------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `CreditsBlocked` | `(requestCount: uint40, consumeFrom: address, amount: uint256)` | `0xf037c15aef41440aa823cf1fdeaea332105d8b23d52557f6670189b5d76f1eed` | -| `CreditsTransferred` | `(from: address, to: address, amount: uint256)` | `0xed198cadddd93e734cbf04cb1c3226d9bafaeb504cedbd8ee36b830b0cb9e7a5` | -| `CreditsUnblocked` | `(requestCount: uint40, consumeFrom: address)` | `0x45db29ef2701319155cac058aa2f56ce1f73e0e238161d3db9f8c9a47655210d` | -| `CreditsUnblockedAndAssigned` | `(requestCount: uint40, consumeFrom: address, transmitter: address, amount: uint256)` | `0x38fd327622576a468e1b2818b00f50c8854703633ef8e583e1f31662888ffac2` | -| `CreditsUnwrapped` | `(consumeFrom: address, amount: uint256)` | `0xdcc9473b722b4c953617ab373840b365298a520bc7f20ce94fa7314f4a857774` | -| `CreditsWrapped` | `(consumeFrom: address, amount: uint256)` | `0x40246503613721eb4acf4020c6c56b6a16e5d08713316db0bea5210e8819c592` | -| `Deposited` | `(chainSlug: uint32, token: address, depositTo: address, creditAmount: uint256, nativeAmount: uint256)` | `0x72aedd284699bbd7a987e6942b824cfd6c627e354cb5a0760ac5768acd473f4a` | -| `FeesPlugSet` | `(chainSlug: uint32, feesPlug: bytes32)` | `0x677a00737c8099aa9e6c554104ca7941deb59125335cfb3d0d9f604f178db59c` | -| `FeesPoolSet` | `(feesPool: address)` | `0xd07af3fd70b48ab3c077a8d45c3a288498d905d0e3d1e65bc171f6c2e890d8ef` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WithdrawFailed` | `(payloadId: bytes32)` | `0xea147eb2109f71b4bda9e57528ba08b84821087a31cb43a7851dc6ff743d9be7` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `CreditsBlocked` | `(requestCount: uint40, consumeFrom: address, amount: uint256)` | `0xf037c15aef41440aa823cf1fdeaea332105d8b23d52557f6670189b5d76f1eed` | +| `CreditsTransferred` | `(from: address, to: address, amount: uint256)` | `0xed198cadddd93e734cbf04cb1c3226d9bafaeb504cedbd8ee36b830b0cb9e7a5` | +| `CreditsUnblocked` | `(requestCount: uint40, consumeFrom: address)` | `0x45db29ef2701319155cac058aa2f56ce1f73e0e238161d3db9f8c9a47655210d` | +| `CreditsUnblockedAndAssigned` | `(requestCount: uint40, consumeFrom: address, transmitter: address, amount: uint256)` | `0x38fd327622576a468e1b2818b00f50c8854703633ef8e583e1f31662888ffac2` | +| `CreditsUnwrapped` | `(consumeFrom: address, amount: uint256)` | `0xdcc9473b722b4c953617ab373840b365298a520bc7f20ce94fa7314f4a857774` | +| `CreditsWrapped` | `(consumeFrom: address, amount: uint256)` | `0x40246503613721eb4acf4020c6c56b6a16e5d08713316db0bea5210e8819c592` | +| `Deposited` | `(chainSlug: uint32, token: address, depositTo: address, creditAmount: uint256, nativeAmount: uint256)` | `0x72aedd284699bbd7a987e6942b824cfd6c627e354cb5a0760ac5768acd473f4a` | +| `FeesPlugSet` | `(chainSlug: uint32, feesPlug: bytes32)` | `0x677a00737c8099aa9e6c554104ca7941deb59125335cfb3d0d9f604f178db59c` | +| `FeesPoolSet` | `(feesPool: address)` | `0xd07af3fd70b48ab3c077a8d45c3a288498d905d0e3d1e65bc171f6c2e890d8ef` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WithdrawFailed` | `(payloadId: bytes32)` | `0xea147eb2109f71b4bda9e57528ba08b84821087a31cb43a7851dc6ff743d9be7` | ## FeesPool -| Event | Arguments | Topic | -| ---------------------------- | ----------------------------------------------- | -------------------------------------------------------------------- | -| `NativeDeposited` | `(from: address, amount: uint256)` | `0xb5d7700fb0cf415158b8db7cc7c39f0eab16a825c92e221404b4c8bb099b4bbb` | -| `NativeWithdrawn` | `(success: bool, to: address, amount: uint256)` | `0xa81f1c8490022ee829d2e1a231053f5dbecad46caee71f6ea38a9db663a3f12b` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `NativeDeposited` | `(from: address, amount: uint256)` | `0xb5d7700fb0cf415158b8db7cc7c39f0eab16a825c92e221404b4c8bb099b4bbb` | +| `NativeWithdrawn` | `(success: bool, to: address, amount: uint256)` | `0xa81f1c8490022ee829d2e1a231053f5dbecad46caee71f6ea38a9db663a3f12b` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## AddressResolver -| Event | Arguments | Topic | -| ------------------------------ | --------------------------------------------------- | -------------------------------------------------------------------- | -| `AsyncDeployerUpdated` | `(asyncDeployer_: address)` | `0x4df9cdd01544e8f6b0326650bc0b55611f47ce5ba2faa522d21fb675e9fc1f73` | -| `ContractAddressUpdated` | `(contractId_: bytes32, contractAddress_: address)` | `0xdf5ec2c15e11ce657bb21bc09c0b5ba95e315b4dba9934c6e311f47559babf28` | -| `DefaultAuctionManagerUpdated` | `(defaultAuctionManager_: address)` | `0x60f296739208a505ead7fb622df0f76b7791b824481b120a2300bdaf85e3e3d6` | -| `DeployForwarderUpdated` | `(deployForwarder_: address)` | `0x237b9bc9fef7508a02ca9ccca81f6965e500064a58024cae1218035da865fd2b` | -| `FeesManagerUpdated` | `(feesManager_: address)` | `0x94e67aa1341a65767dfde81e62fd265bfbade1f5744bfd3cd73f99a6eca0572a` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WatcherUpdated` | `(watcher_: address)` | `0xc13081d38d92b454cdb6ca20bbc65c12fa43a7a14a1529204ced5b6350052bb0` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AsyncDeployerUpdated` | `(asyncDeployer_: address)` | `0x4df9cdd01544e8f6b0326650bc0b55611f47ce5ba2faa522d21fb675e9fc1f73` | +| `ContractAddressUpdated` | `(contractId_: bytes32, contractAddress_: address)` | `0xdf5ec2c15e11ce657bb21bc09c0b5ba95e315b4dba9934c6e311f47559babf28` | +| `DefaultAuctionManagerUpdated` | `(defaultAuctionManager_: address)` | `0x60f296739208a505ead7fb622df0f76b7791b824481b120a2300bdaf85e3e3d6` | +| `DeployForwarderUpdated` | `(deployForwarder_: address)` | `0x237b9bc9fef7508a02ca9ccca81f6965e500064a58024cae1218035da865fd2b` | +| `FeesManagerUpdated` | `(feesManager_: address)` | `0x94e67aa1341a65767dfde81e62fd265bfbade1f5744bfd3cd73f99a6eca0572a` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WatcherUpdated` | `(watcher_: address)` | `0xc13081d38d92b454cdb6ca20bbc65c12fa43a7a14a1529204ced5b6350052bb0` | ## AsyncDeployer -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------------------- | -------------------------------------------------------------------- | -| `AsyncPromiseDeployed` | `(newAsyncPromise: address, salt: bytes32)` | `0xb6c5491cf83e09749b1a4dd6a9f07b0e925fcb0a915ac8c2b40e8ab28191c270` | -| `ForwarderDeployed` | `(newForwarder: address, salt: bytes32)` | `0x4dbbecb9cf9c8b93da9743a2b48ea52efe68d69230ab1c1b711891d9d223b29f` | -| `ImplementationUpdated` | `(contractName: string, newImplementation: address)` | `0xa1e41aa2c2f3f20d9b63ac06b634d2788768d6034f3d9192cdf7d07374bb16f4` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AsyncPromiseDeployed` | `(newAsyncPromise: address, salt: bytes32)` | `0xb6c5491cf83e09749b1a4dd6a9f07b0e925fcb0a915ac8c2b40e8ab28191c270` | +| `ForwarderDeployed` | `(newForwarder: address, salt: bytes32)` | `0x4dbbecb9cf9c8b93da9743a2b48ea52efe68d69230ab1c1b711891d9d223b29f` | +| `ImplementationUpdated` | `(contractName: string, newImplementation: address)` | `0xa1e41aa2c2f3f20d9b63ac06b634d2788768d6034f3d9192cdf7d07374bb16f4` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## AsyncPromise -| Event | Arguments | Topic | -| ------------- | ------------------- | -------------------------------------------------------------------- | +| Event | Arguments | Topic | +| ----- | --------- | ----- | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | ## DeployForwarder -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## Forwarder -| Event | Arguments | Topic | -| ------------- | ------------------- | -------------------------------------------------------------------- | +| Event | Arguments | Topic | +| ----- | --------- | ----- | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | ## ProxyFactory -| Event | Arguments | Topic | -| -------------- | ----------------------------------------------------------- | -------------------------------------------------------------------- | -| `AdminChanged` | `(proxy: address, admin: address)` | `0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f` | -| `Deployed` | `(proxy: address, implementation: address, admin: address)` | `0xc95935a66d15e0da5e412aca0ad27ae891d20b2fb91cf3994b6a3bf2b8178082` | -| `Upgraded` | `(proxy: address, implementation: address)` | `0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AdminChanged` | `(proxy: address, admin: address)` | `0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f` | +| `Deployed` | `(proxy: address, implementation: address, admin: address)` | `0xc95935a66d15e0da5e412aca0ad27ae891d20b2fb91cf3994b6a3bf2b8178082` | +| `Upgraded` | `(proxy: address, implementation: address)` | `0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7` | ## TestUSDC -| Event | Arguments | Topic | -| ---------- | ----------------------------------------------------- | -------------------------------------------------------------------- | +| Event | Arguments | Topic | +| ----- | --------- | ----- | | `Approval` | `(owner: address, spender: address, amount: uint256)` | `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` | -| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | +| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | ## ContractFactoryPlug -| Event | Arguments | Topic | -| ---------------------------- | --------------------------------------------------- | -------------------------------------------------------------------- | -| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | -| `Deployed` | `(addr: address, salt: bytes32, returnData: bytes)` | `0x1246c6f8fd9f4abc542c7c8c8f793cfcde6b67aed1976a38aa134fc24af2dfe3` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `Deployed` | `(addr: address, salt: bytes32, returnData: bytes)` | `0x1246c6f8fd9f4abc542c7c8c8f793cfcde6b67aed1976a38aa134fc24af2dfe3` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## FeesPlug -| Event | Arguments | Topic | -| ---------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | -| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256)` | `0xeb4e1b24b7fe377de69f80f7380bda5ba4b43176c6a4d300a3be9009c49f4228` | -| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | -| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256)` | `0xeb4e1b24b7fe377de69f80f7380bda5ba4b43176c6a4d300a3be9009c49f4228` | +| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | +| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | ## Configurations -| Event | Arguments | Topic | -| ---------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------- | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `IsValidPlugSet` | `(appGateway: address, chainSlug: uint32, plug: bytes32, isValid: bool)` | `0xd7a90efd60960a8435ef282822190655f6bd2ffa14bb350dc23d6f6956056d7e` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `PlugAdded` | `(appGatewayId: bytes32, chainSlug: uint32, plug: bytes32)` | `0x3734a2406c5c2f2556c82a0819c51e42a135dd102465cc9856594481ea2f1637` | -| `SocketSet` | `(chainSlug: uint32, socket: bytes32)` | `0x3200bf6ad2ab31b9220ed9d2f83089d7a1332f55aaa3825c57510743a315165b` | -| `SwitchboardSet` | `(chainSlug: uint32, sbType: bytes32, switchboardId: uint64)` | `0x5aeb296e3ed47512d11032a96d11f93d8538b9eb87aa1db45d412e7165d6850a` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `IsValidPlugSet` | `(appGateway: address, chainSlug: uint32, plug: bytes32, isValid: bool)` | `0xd7a90efd60960a8435ef282822190655f6bd2ffa14bb350dc23d6f6956056d7e` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `PlugAdded` | `(appGatewayId: bytes32, chainSlug: uint32, plug: bytes32)` | `0x3734a2406c5c2f2556c82a0819c51e42a135dd102465cc9856594481ea2f1637` | +| `SocketSet` | `(chainSlug: uint32, socket: bytes32)` | `0x3200bf6ad2ab31b9220ed9d2f83089d7a1332f55aaa3825c57510743a315165b` | +| `SwitchboardSet` | `(chainSlug: uint32, sbType: bytes32, switchboardId: uint64)` | `0x5aeb296e3ed47512d11032a96d11f93d8538b9eb87aa1db45d412e7165d6850a` | ## PromiseResolver -| Event | Arguments | Topic | -| -------------------- | ------------------------------------------------ | -------------------------------------------------------------------- | -| `MarkedRevert` | `(payloadId: bytes32, isRevertingOnchain: bool)` | `0xcf1fd844cb4d32cbebb5ca6ce4ac834fe98da3ddac44deb77fffd22ad933824c` | -| `PromiseNotResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0xbcf0d0c678940566e9e64f0c871439395bd5fb5c39bca3547b126fe6ee467937` | -| `PromiseResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0x1b1b5810494fb3e17f7c46547e6e67cd6ad3e6001ea6fb7d12ea0241ba13c4ba` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `MarkedRevert` | `(payloadId: bytes32, isRevertingOnchain: bool)` | `0xcf1fd844cb4d32cbebb5ca6ce4ac834fe98da3ddac44deb77fffd22ad933824c` | +| `PromiseNotResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0xbcf0d0c678940566e9e64f0c871439395bd5fb5c39bca3547b126fe6ee467937` | +| `PromiseResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0x1b1b5810494fb3e17f7c46547e6e67cd6ad3e6001ea6fb7d12ea0241ba13c4ba` | ## RequestHandler -| Event | Arguments | Topic | -| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `FeesIncreased` | `(requestCount: uint40, newMaxFees: uint256)` | `0xf258fca4e49b803ee2a4c2e33b6fcf18bc3982df21f111c00677025bf1ccbb6a` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RequestCancelled` | `(requestCount: uint40)` | `0xff191657769be72fc08def44c645014c60d18cb24b9ca05c9a33406a28253245` | -| `RequestCompletedWithErrors` | `(requestCount: uint40)` | `0xd8d9915dc14b5a29b66cb263e1ea1e99e60418fc21d97f0fbf09cae1281291e2` | -| `RequestSettled` | `(requestCount: uint40, winner: address)` | `0x1234f98acbe1548b214f4528461a5377f1e2349569c04caa59325e488e7d2aa4` | -| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0xb730ca5523e3f80e88b4bb71e1e78d447553069cd9a7143bb0032b957135b530` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `FeesIncreased` | `(requestCount: uint40, newMaxFees: uint256)` | `0xf258fca4e49b803ee2a4c2e33b6fcf18bc3982df21f111c00677025bf1ccbb6a` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RequestCancelled` | `(requestCount: uint40)` | `0xff191657769be72fc08def44c645014c60d18cb24b9ca05c9a33406a28253245` | +| `RequestCompletedWithErrors` | `(requestCount: uint40)` | `0xd8d9915dc14b5a29b66cb263e1ea1e99e60418fc21d97f0fbf09cae1281291e2` | +| `RequestSettled` | `(requestCount: uint40, winner: address)` | `0x1234f98acbe1548b214f4528461a5377f1e2349569c04caa59325e488e7d2aa4` | +| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0xb730ca5523e3f80e88b4bb71e1e78d447553069cd9a7143bb0032b957135b530` | ## Watcher -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | -| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | -| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | -| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | -| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | +| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | +| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | +| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | ## IMessageSwitchboard @@ -242,71 +242,72 @@ ## CCTPSwitchboard -| Event | Arguments | Topic | -| ---------------------------- | ----------------------------------------- | -------------------------------------------------------------------- | -| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## FastSwitchboard -| Event | Arguments | Topic | -| ---------------------------- | ----------------------------------------- | -------------------------------------------------------------------- | -| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## MessageSwitchboard -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `Attested` | `(payloadId: bytes32, digest: bytes32, watcher: address)` | `0x2f8e66b1207a4b70274a2a3da88ffb5737c8214576490da1b35acc38b2d62db6` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SiblingConfigSet` | `(chainSlug: uint32, fee: uint256, socket: bytes32, switchboard: bytes32)` | `0xc34c3d0f0300f406c0f0608f6f6d70b36f5e90ccd1f1e1065bbe899f64cc81f0` | -| `SiblingRegistered` | `(chainSlug: uint32, plugAddress: address, siblingPlug: bytes32)` | `0xbb232aa6c0cb95b30a887c06b678538c818d3eac0dfd4d83299a18867cae220b` | -| `SwitchboardFeesSet` | `(chainSlug: uint32, feeAmount: uint256)` | `0x5e544c79c5017ebf2ea6aa546cd1c37272d5b4335247f0ceaabef51903dc5260` | -| `TriggerProcessed` | `(dstChainSlug: uint32, switchboardFees: uint256, digest: bytes32, digestParams: tuple)` | `0x0d585f64e2ebf6cc2b04ccbbaf63459f3b52c84111559988d28d6872185caa32` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `Attested` | `(payloadId: bytes32, digest: bytes32, watcher: address)` | `0x2f8e66b1207a4b70274a2a3da88ffb5737c8214576490da1b35acc38b2d62db6` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SiblingConfigSet` | `(chainSlug: uint32, fee: uint256, socket: bytes32, switchboard: bytes32)` | `0xc34c3d0f0300f406c0f0608f6f6d70b36f5e90ccd1f1e1065bbe899f64cc81f0` | +| `SiblingRegistered` | `(chainSlug: uint32, plugAddress: address, siblingPlug: bytes32)` | `0xbb232aa6c0cb95b30a887c06b678538c818d3eac0dfd4d83299a18867cae220b` | +| `SwitchboardFeesSet` | `(chainSlug: uint32, feeAmount: uint256)` | `0x5e544c79c5017ebf2ea6aa546cd1c37272d5b4335247f0ceaabef51903dc5260` | +| `TriggerProcessed` | `(dstChainSlug: uint32, switchboardFees: uint256, digest: bytes32, digestParams: tuple)` | `0x0d585f64e2ebf6cc2b04ccbbaf63459f3b52c84111559988d28d6872185caa32` | ## ReadPrecompile -| Event | Arguments | Topic | -| --------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `ReadFeesSet` | `(readFees: uint256)` | `0xc674cb6dde3a59f84dbf226832e606ffc54ac8a169e1568fc834c7813010f926` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `ReadFeesSet` | `(readFees: uint256)` | `0xc674cb6dde3a59f84dbf226832e606ffc54ac8a169e1568fc834c7813010f926` | | `ReadRequested` | `(transaction: tuple, readAtBlockNumber: uint256, payloadId: bytes32)` | `0xbcad63ac625c0f3cb23b62b126567728fcf5950ca8e559150e764eced73e794a` | ## SchedulePrecompile -| Event | Arguments | Topic | -| ------------------------------ | ---------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | -| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | -| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | -| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256)` | `0xd099d3e3d0f0e2c9c40e0066affeea125aab71d763b7ab0a279ccec3dff70b64` | -| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | +| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | +| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | +| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256)` | `0xd099d3e3d0f0e2c9c40e0066affeea125aab71d763b7ab0a279ccec3dff70b64` | +| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | ## WritePrecompile -| Event | Arguments | Topic | -| ------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ChainMaxMsgValueLimitsUpdated` | `(chainSlug: uint32, maxMsgValueLimit: uint256)` | `0x439087d094fe7dacbba3f0c67032041952d8bd58a891e15af10ced28fed0eb91` | -| `ContractFactoryPlugSet` | `(chainSlug: uint32, contractFactoryPlug: bytes32)` | `0xfad552a6feb82bef23201b8dce04b2460bff41b00f26fef3d791572cfdab49c2` | -| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `FeesSet` | `(writeFees: uint256)` | `0x3346af6da1932164d501f2ec28f8c5d686db5828a36b77f2da4332d89184fe7b` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WriteProofRequested` | `(transmitter: address, digest: bytes32, prevBatchDigestHash: bytes32, deadline: uint256, payloadParams: tuple)` | `0xe3e3e322b3c2964670f4b62d06647c2f711440be782105fc1c0a60cc934bb40a` | -| `WriteProofUploaded` | `(payloadId: bytes32, proof: bytes)` | `0xd8fe3a99a88c9630360418877afdf14e3e79f0f25fee162aeb230633ea740156` | +| Event | Arguments | Topic | +| ----- | --------- | ----- | +| `ChainMaxMsgValueLimitsUpdated` | `(chainSlug: uint32, maxMsgValueLimit: uint256)` | `0x439087d094fe7dacbba3f0c67032041952d8bd58a891e15af10ced28fed0eb91` | +| `ContractFactoryPlugSet` | `(chainSlug: uint32, contractFactoryPlug: bytes32)` | `0xfad552a6feb82bef23201b8dce04b2460bff41b00f26fef3d791572cfdab49c2` | +| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `FeesSet` | `(writeFees: uint256)` | `0x3346af6da1932164d501f2ec28f8c5d686db5828a36b77f2da4332d89184fe7b` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WriteProofRequested` | `(transmitter: address, digest: bytes32, prevBatchDigestHash: bytes32, deadline: uint256, payloadParams: tuple)` | `0xe3e3e322b3c2964670f4b62d06647c2f711440be782105fc1c0a60cc934bb40a` | +| `WriteProofUploaded` | `(payloadId: bytes32, proof: bytes)` | `0xd8fe3a99a88c9630360418877afdf14e3e79f0f25fee162aeb230633ea740156` | + diff --git a/FunctionSignatures.md b/FunctionSignatures.md index e929f6b7..479abe1e 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -2,627 +2,642 @@ ## AuctionManager -| Function | Signature | -| ---------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `auctionEndDelaySeconds` | `0x9087dfdb` | -| `auctionManager` | `0xb0192f9a` | -| `auctionStatus` | `0xd7d5fbf6` | -| `bid` | `0xfcdf49c2` | -| `bidTimeout` | `0x94090d0b` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `consumeFrom` | `0x40dd78be` | -| `creationCodeWithArgs` | `0xc126dcc4` | -| `deployForwarder__` | `0xd4e3b034` | -| `endAuction` | `0x1212e653` | -| `evmxSlug` | `0x8bae77c2` | -| `expireBid` | `0x1dd5022c` | -| `feesManager__` | `0x70568b58` | -| `forwarderAddresses` | `0x5390fdcb` | -| `getOnChainAddress` | `0xb6abffd7` | -| `getOverrideParams` | `0x54f0a866` | -| `grantRole` | `0x2f2ff15d` | -| `handleRevert` | `0x44792f25` | -| `hasRole` | `0x91d14854` | -| `initialize` | `0x86891c9b` | -| `initializeOnChain` | `0x86f01739` | -| `isAsyncModifierSet` | `0xb69e0c4a` | -| `isValidPromise` | `0xb690b962` | -| `maxFees` | `0xe83e34b1` | -| `maxReAuctionCount` | `0xc367b376` | -| `onCompleteData` | `0xb52fa926` | -| `onRequestComplete` | `0x5ed1f959` | -| `overrideParams` | `0xec5490fe` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `auctionEndDelaySeconds` | `0x9087dfdb` | +| `auctionManager` | `0xb0192f9a` | +| `auctionStatus` | `0xd7d5fbf6` | +| `bid` | `0xfcdf49c2` | +| `bidTimeout` | `0x94090d0b` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `consumeFrom` | `0x40dd78be` | +| `creationCodeWithArgs` | `0xc126dcc4` | +| `deployForwarder__` | `0xd4e3b034` | +| `endAuction` | `0x1212e653` | +| `evmxSlug` | `0x8bae77c2` | +| `expireBid` | `0x1dd5022c` | +| `feesManager__` | `0x70568b58` | +| `forwarderAddresses` | `0x5390fdcb` | +| `getOnChainAddress` | `0xb6abffd7` | +| `getOverrideParams` | `0x54f0a866` | +| `grantRole` | `0x2f2ff15d` | +| `handleRevert` | `0x44792f25` | +| `hasRole` | `0x91d14854` | +| `initialize` | `0x86891c9b` | +| `initializeOnChain` | `0x86f01739` | +| `isAsyncModifierSet` | `0xb69e0c4a` | +| `isValidPromise` | `0xb690b962` | +| `maxFees` | `0xe83e34b1` | +| `maxReAuctionCount` | `0xc367b376` | +| `onCompleteData` | `0xb52fa926` | +| `onDeployComplete` | `0xfa3dbd1e` | +| `overrideParams` | `0xec5490fe` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `reAuctionCount` | `0x9b4b22d3` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `sbType` | `0x745de344` | -| `setAddress` | `0x85bf312c` | -| `setAuctionEndDelaySeconds` | `0x88606b1a` | -| `setMaxReAuctionCount` | `0x64c71403` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | -| `winningBids` | `0x9133f232` | +| `reAuctionCount` | `0x9b4b22d3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `sbType` | `0x745de344` | +| `setAddress` | `0x85bf312c` | +| `setAuctionEndDelaySeconds` | `0x88606b1a` | +| `setMaxReAuctionCount` | `0x64c71403` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | +| `winningBids` | `0x9133f232` | ## Socket -| Function | Signature | -| ---------------------------- | ------------ | -| `OFF_CHAIN_CALLER` | `0xcb2cb4f6` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `connect` | `0xf3aebe4d` | -| `disableSwitchboard` | `0x25e94caf` | -| `disconnect` | `0xd9374bff` | -| `enableSwitchboard` | `0xea072f06` | -| `execute` | `0x2e4d89fb` | -| `gasLimitBuffer` | `0xe4d728f0` | -| `getPlugConfig` | `0xf9778ee0` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isValidSwitchboard` | `0xb30fe8ff` | -| `maxCopyBytes` | `0x212249d4` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `OFF_CHAIN_CALLER` | `0xcb2cb4f6` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `connect` | `0xf3aebe4d` | +| `disableSwitchboard` | `0x25e94caf` | +| `disconnect` | `0xd9374bff` | +| `enableSwitchboard` | `0xea072f06` | +| `execute` | `0x2e4d89fb` | +| `gasLimitBuffer` | `0xe4d728f0` | +| `getPlugConfig` | `0xf9778ee0` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isValidSwitchboard` | `0xb30fe8ff` | +| `maxCopyBytes` | `0x212249d4` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadExecuted` | `0x3eaeac3d` | -| `payloadIdToDigest` | `0x7c8552b2` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setGasLimitBuffer` | `0x1f0cfa78` | -| `setMaxCopyBytes` | `0x4fc7d6e9` | -| `setSocketFeeManager` | `0x25bd97e5` | -| `simulate` | `0x91bf8275` | -| `socketFeeManager` | `0xde5b8838` | -| `switchboardAddresses` | `0x9cf0af93` | -| `switchboardIdCounter` | `0x5f850dfd` | -| `switchboardIds` | `0x91db23d3` | -| `transferOwnership` | `0xf2fde38b` | -| `triggerAppGateway` | `0x29e654e1` | -| `triggerCounter` | `0x8b0021de` | -| `version` | `0x54fd4d50` | +| `payloadExecuted` | `0x3eaeac3d` | +| `payloadIdToDigest` | `0x7c8552b2` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setGasLimitBuffer` | `0x1f0cfa78` | +| `setMaxCopyBytes` | `0x4fc7d6e9` | +| `setSocketFeeManager` | `0x25bd97e5` | +| `simulate` | `0x91bf8275` | +| `socketFeeManager` | `0xde5b8838` | +| `switchboardAddresses` | `0x9cf0af93` | +| `switchboardIdCounter` | `0x5f850dfd` | +| `switchboardIds` | `0x91db23d3` | +| `transferOwnership` | `0xf2fde38b` | +| `triggerAppGateway` | `0x29e654e1` | +| `triggerCounter` | `0x8b0021de` | +| `version` | `0x54fd4d50` | ## SocketFeeManager -| Function | Signature | -| ---------------------------- | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getMinSocketFees` | `0xd383b688` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getMinSocketFees` | `0xd383b688` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payAndCheckFees` | `0x0b2b48ed` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setSocketFees` | `0x47a406f6` | -| `socketFees` | `0xab1b33a8` | -| `transferOwnership` | `0xf2fde38b` | +| `payAndCheckFees` | `0x0b2b48ed` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setSocketFees` | `0x47a406f6` | +| `socketFees` | `0xab1b33a8` | +| `transferOwnership` | `0xf2fde38b` | ## FeesManager -| Function | Signature | -| -------------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `approveAppGateway` | `0xa3b53d8b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `approveAppGateway` | `0xa3b53d8b` | | `approveAppGatewayWithSignature` | `0x94b649ec` | -| `approveAppGateways` | `0x86d23ab2` | -| `asyncDeployer__` | `0x2a39e801` | -| `blockCredits` | `0x9e434307` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployForwarder__` | `0xd4e3b034` | -| `deposit` | `0x5671d329` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `feesPlugs` | `0x23f5ee8a` | -| `feesPool` | `0x6b259690` | -| `getAvailableCredits` | `0xb065a8e5` | -| `handleRevert` | `0x44792f25` | -| `initialize` | `0xbf2c8539` | -| `isApproved` | `0xa389783e` | -| `isCreditSpendable` | `0x4f8990fd` | -| `isNonceUsed` | `0xcab7e8eb` | -| `onRequestComplete` | `0x5ed1f959` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestBlockedCredits` | `0xb62d25ac` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `sbType` | `0x745de344` | -| `setFeesPlug` | `0xd6a9a8b7` | -| `setFeesPool` | `0xd6684588` | -| `tokenOnChainBalances` | `0x3b27866d` | -| `transferCredits` | `0xf1686c89` | -| `transferOwnership` | `0xf2fde38b` | -| `unblockAndAssignCredits` | `0x01958181` | -| `unblockCredits` | `0xa0b32314` | -| `unwrap` | `0x7647691d` | -| `userCredits` | `0x20babb92` | -| `watcher__` | `0x300bb063` | -| `withdrawCredits` | `0xcfc6dbd9` | -| `wrap` | `0x023276f0` | +| `approveAppGateways` | `0x86d23ab2` | +| `asyncDeployer__` | `0x2a39e801` | +| `auctionManager` | `0xb0192f9a` | +| `blockCredits` | `0x9e434307` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `consumeFrom` | `0x40dd78be` | +| `creationCodeWithArgs` | `0xc126dcc4` | +| `deployForwarder__` | `0xd4e3b034` | +| `deposit` | `0x5671d329` | +| `deprecatedSbType` | `0x5a783900` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `feesPlugs` | `0x23f5ee8a` | +| `feesPool` | `0x6b259690` | +| `forwarderAddresses` | `0x5390fdcb` | +| `getAvailableCredits` | `0xb065a8e5` | +| `getOnChainAddress` | `0xb6abffd7` | +| `getOverrideParams` | `0x54f0a866` | +| `handleRevert` | `0x44792f25` | +| `initialize` | `0xbf2c8539` | +| `initializeOnChain` | `0x86f01739` | +| `isApproved` | `0xa389783e` | +| `isAsyncModifierSet` | `0xb69e0c4a` | +| `isCreditSpendable` | `0x4f8990fd` | +| `isNonceUsed` | `0xcab7e8eb` | +| `isValidPromise` | `0xb690b962` | +| `maxFees` | `0xe83e34b1` | +| `onCompleteData` | `0xb52fa926` | +| `onDeployComplete` | `0xfa3dbd1e` | +| `overrideParams` | `0xec5490fe` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestBlockedCredits` | `0xb62d25ac` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `sbType` | `0x745de344` | +| `setAddress` | `0x85bf312c` | +| `setFeesPlug` | `0xd6a9a8b7` | +| `setFeesPool` | `0xd6684588` | +| `tokenOnChainBalances` | `0x3b27866d` | +| `transferCredits` | `0xf1686c89` | +| `transferOwnership` | `0xf2fde38b` | +| `unblockAndAssignCredits` | `0x01958181` | +| `unblockCredits` | `0xa0b32314` | +| `unwrap` | `0x7647691d` | +| `userCredits` | `0x20babb92` | +| `watcher__` | `0x300bb063` | +| `withdrawCredits` | `0xcfc6dbd9` | +| `wrap` | `0x023276f0` | ## FeesPool -| Function | Signature | -| ---------------------------- | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getBalance` | `0x12065fe0` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getBalance` | `0x12065fe0` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `revokeRole` | `0xd547741f` | -| `transferOwnership` | `0xf2fde38b` | -| `withdraw` | `0xf3fef3a3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `revokeRole` | `0xd547741f` | +| `transferOwnership` | `0xf2fde38b` | +| `withdraw` | `0xf3fef3a3` | ## AddressResolver -| Function | Signature | -| ---------------------------- | ------------ | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `contractAddresses` | `0xf689e892` | -| `defaultAuctionManager` | `0x8f27cdc6` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0xc4d66de8` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `contractAddresses` | `0xf689e892` | +| `defaultAuctionManager` | `0x8f27cdc6` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0xc4d66de8` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setAsyncDeployer` | `0xcb0ffff8` | -| `setContractAddress` | `0xe001f841` | -| `setDefaultAuctionManager` | `0xede8b4b5` | -| `setDeployForwarder` | `0xaeaee8a6` | -| `setFeesManager` | `0x1c89382a` | -| `setWatcher` | `0x24f48bc5` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setAsyncDeployer` | `0xcb0ffff8` | +| `setContractAddress` | `0xe001f841` | +| `setDefaultAuctionManager` | `0xede8b4b5` | +| `setDeployForwarder` | `0xaeaee8a6` | +| `setFeesManager` | `0x1c89382a` | +| `setWatcher` | `0x24f48bc5` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncDeployer -| Function | Signature | -| ------------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `asyncPromiseBeacon` | `0xc0fbc0ef` | -| `asyncPromiseCounter` | `0x97cdbf4c` | -| `asyncPromiseImplementation` | `0x59531b8d` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployAsyncPromiseContract` | `0x9851be0b` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `forwarderBeacon` | `0x945709ae` | -| `forwarderImplementation` | `0xe38d60a1` | -| `getAsyncPromiseAddress` | `0x104f39b4` | -| `getForwarderAddress` | `0x9c038b01` | -| `getOrDeployForwarderContract` | `0xe9bf1edf` | -| `initialize` | `0x485cc955` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `asyncPromiseBeacon` | `0xc0fbc0ef` | +| `asyncPromiseCounter` | `0x97cdbf4c` | +| `asyncPromiseImplementation` | `0x59531b8d` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployAsyncPromiseContract` | `0x9851be0b` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `forwarderBeacon` | `0x945709ae` | +| `forwarderImplementation` | `0xe38d60a1` | +| `getAsyncPromiseAddress` | `0x104f39b4` | +| `getForwarderAddress` | `0x9c038b01` | +| `getOrDeployForwarderContract` | `0xe9bf1edf` | +| `initialize` | `0x485cc955` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | | `setAsyncPromiseImplementation` | `0xeb506eab` | -| `setForwarderImplementation` | `0x83b1e974` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `setForwarderImplementation` | `0x83b1e974` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncPromise -| Function | Signature | -| ------------------- | ------------ | +| Function | Signature | +| -------- | --------- | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `callbackData` | `0xef44c272` | -| `callbackSelector` | `0x2764f92f` | +| `asyncDeployer__` | `0x2a39e801` | +| `callbackData` | `0xef44c272` | +| `callbackSelector` | `0x2764f92f` | | `deployForwarder__` | `0xd4e3b034` | -| `exceededMaxCopy` | `0xaf598c7c` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x0ece6089` | -| `localInvoker` | `0x45eb87f4` | +| `exceededMaxCopy` | `0xaf598c7c` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x0ece6089` | +| `localInvoker` | `0x45eb87f4` | | `markOnchainRevert` | `0xd0e7af1b` | -| `markResolved` | `0x822d5d1f` | -| `requestCount` | `0x5badbe4c` | -| `rescueFunds` | `0x6ccae054` | -| `returnData` | `0xebddbaf6` | -| `state` | `0xc19d93fb` | -| `then` | `0x0bf2ba15` | -| `watcher__` | `0x300bb063` | +| `markResolved` | `0x822d5d1f` | +| `requestCount` | `0x5badbe4c` | +| `rescueFunds` | `0x6ccae054` | +| `returnData` | `0xebddbaf6` | +| `state` | `0xc19d93fb` | +| `then` | `0x0bf2ba15` | +| `watcher__` | `0x300bb063` | ## DeployForwarder -| Function | Signature | -| ---------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deploy` | `0x940f11af` | -| `deployForwarder__` | `0xd4e3b034` | -| `deployerSwitchboardType` | `0xaa381f9a` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x6133f985` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deploy` | `0x940f11af` | +| `deployForwarder__` | `0xd4e3b034` | +| `deployerSwitchboardType` | `0xaa381f9a` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x6133f985` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `saltCounter` | `0xa04c6809` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `saltCounter` | `0xa04c6809` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## Forwarder -| Function | Signature | -| ------------------- | ------------ | +| Function | Signature | +| -------- | --------- | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `chainSlug` | `0xb349ba65` | +| `asyncDeployer__` | `0x2a39e801` | +| `chainSlug` | `0xb349ba65` | | `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getChainSlug` | `0x0b8c6568` | +| `feesManager__` | `0x70568b58` | +| `getChainSlug` | `0x0b8c6568` | | `getOnChainAddress` | `0x9da48789` | -| `initialize` | `0x148841cb` | -| `onChainAddress` | `0x8bd0b363` | -| `rescueFunds` | `0x6ccae054` | -| `watcher__` | `0x300bb063` | +| `initialize` | `0x148841cb` | +| `onChainAddress` | `0x8bd0b363` | +| `rescueFunds` | `0x6ccae054` | +| `watcher__` | `0x300bb063` | ## ProxyFactory -| Function | Signature | -| ----------------------------- | ------------ | -| `adminOf` | `0x2abbef15` | -| `changeAdmin` | `0x1acfd02a` | -| `deploy` | `0x545e7c61` | -| `deployAndCall` | `0x4314f120` | -| `deployDeterministic` | `0x3729f922` | -| `deployDeterministicAndCall` | `0xa97b90d5` | -| `initCodeHash` | `0xdb4c545e` | +| Function | Signature | +| -------- | --------- | +| `adminOf` | `0x2abbef15` | +| `changeAdmin` | `0x1acfd02a` | +| `deploy` | `0x545e7c61` | +| `deployAndCall` | `0x4314f120` | +| `deployDeterministic` | `0x3729f922` | +| `deployDeterministicAndCall` | `0xa97b90d5` | +| `initCodeHash` | `0xdb4c545e` | | `predictDeterministicAddress` | `0x5414dff0` | -| `upgrade` | `0x99a88ec4` | -| `upgradeAndCall` | `0x9623609d` | +| `upgrade` | `0x99a88ec4` | +| `upgradeAndCall` | `0x9623609d` | ## TestUSDC -| Function | Signature | -| ------------------ | ------------ | +| Function | Signature | +| -------- | --------- | | `DOMAIN_SEPARATOR` | `0x3644e515` | -| `allowance` | `0xdd62ed3e` | -| `approve` | `0x095ea7b3` | -| `balanceOf` | `0x70a08231` | -| `decimals` | `0x313ce567` | -| `mint` | `0x40c10f19` | -| `name` | `0x06fdde03` | -| `nonces` | `0x7ecebe00` | -| `owner` | `0x8da5cb5b` | -| `permit` | `0xd505accf` | -| `symbol` | `0x95d89b41` | -| `totalSupply` | `0x18160ddd` | -| `transfer` | `0xa9059cbb` | -| `transferFrom` | `0x23b872dd` | +| `allowance` | `0xdd62ed3e` | +| `approve` | `0x095ea7b3` | +| `balanceOf` | `0x70a08231` | +| `decimals` | `0x313ce567` | +| `mint` | `0x40c10f19` | +| `name` | `0x06fdde03` | +| `nonces` | `0x7ecebe00` | +| `owner` | `0x8da5cb5b` | +| `permit` | `0xd505accf` | +| `symbol` | `0x95d89b41` | +| `totalSupply` | `0x18160ddd` | +| `transfer` | `0xa9059cbb` | +| `transferFrom` | `0x23b872dd` | ## ContractFactoryPlug -| Function | Signature | -| ---------------------------- | ------------ | -| `appGatewayId` | `0x1c335f49` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `connectSocket` | `0x943103c3` | -| `deployContract` | `0xff8caf37` | -| `getAddress` | `0x94ca2cb5` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `initSocket` | `0x18b7ff72` | -| `isSocketInitialized` | `0x9a7d9a9b` | -| `overrides` | `0x4a85f041` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `appGatewayId` | `0x1c335f49` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `connectSocket` | `0x943103c3` | +| `deployContract` | `0xff8caf37` | +| `getAddress` | `0x94ca2cb5` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `initSocket` | `0x18b7ff72` | +| `isSocketInitialized` | `0x9a7d9a9b` | +| `overrides` | `0x4a85f041` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## Configurations -| Function | Signature | -| ---------------------------- | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getPlugConfigs` | `0x25945c1a` | -| `initialize` | `0x485cc955` | -| `isValidPlug` | `0x00f9b9f4` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getPlugConfigs` | `0x25945c1a` | +| `initialize` | `0x485cc955` | +| `isValidPlug` | `0x00f9b9f4` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setAppGatewayConfigs` | `0x831c8195` | -| `setIsValidPlug` | `0x4842c37a` | -| `setSocket` | `0x38d4de67` | -| `setSwitchboard` | `0x4fc059a0` | -| `sockets` | `0xb44a23ab` | -| `switchboards` | `0xaa539546` | -| `transferOwnership` | `0xf2fde38b` | -| `verifyConnections` | `0x36cb19fb` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setAppGatewayConfigs` | `0x831c8195` | +| `setIsValidPlug` | `0x4842c37a` | +| `setSocket` | `0x38d4de67` | +| `setSwitchboard` | `0x4fc059a0` | +| `sockets` | `0xb44a23ab` | +| `switchboards` | `0xaa539546` | +| `transferOwnership` | `0xf2fde38b` | +| `verifyConnections` | `0x36cb19fb` | +| `watcher__` | `0x300bb063` | ## PromiseResolver -| Function | Signature | -| ----------------- | ------------ | -| `markRevert` | `0x56501015` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| -------- | --------- | +| `markRevert` | `0x56501015` | +| `rescueFunds` | `0x6ccae054` | | `resolvePromises` | `0xbf8484b8` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## RequestHandler -| Function | Signature | -| ------------------------------ | ------------ | -| `addressResolver__` | `0x6a750469` | -| `assignTransmitter` | `0xae5e9c48` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x3b5fd6fb` | -| `cancelRequestForReverts` | `0x82970278` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getBatchPayloadIds` | `0xfd83cd1f` | -| `getPayload` | `0xb48fd0fe` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequest` | `0xcf39abf6` | -| `getRequestBatchIds` | `0xe138fadb` | -| `handleRevert` | `0xcc88d3f9` | -| `increaseFees` | `0x10205541` | -| `initialize` | `0x485cc955` | -| `nextBatchCount` | `0x333a3963` | -| `nextRequestCount` | `0xfef72893` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadCounter` | `0x550ce1d5` | -| `precompiles` | `0x9932450b` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setPrecompile` | `0x122e0042` | -| `setRequestPayloadCountLimit` | `0x8526582b` | -| `submitRequest` | `0xf91ba7cc` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `assignTransmitter` | `0xae5e9c48` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x3b5fd6fb` | +| `cancelRequestForReverts` | `0x82970278` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `getBatchPayloadIds` | `0xfd83cd1f` | +| `getPayload` | `0xb48fd0fe` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequest` | `0xcf39abf6` | +| `getRequestBatchIds` | `0xe138fadb` | +| `handleRevert` | `0xcc88d3f9` | +| `increaseFees` | `0x10205541` | +| `initialize` | `0x485cc955` | +| `nextBatchCount` | `0x333a3963` | +| `nextRequestCount` | `0xfef72893` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `payloadCounter` | `0x550ce1d5` | +| `precompiles` | `0x9932450b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setPrecompile` | `0x122e0042` | +| `setRequestPayloadCountLimit` | `0x8526582b` | +| `submitRequest` | `0xf91ba7cc` | +| `transferOwnership` | `0xf2fde38b` | | `updateRequestAndProcessBatch` | `0x46464471` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## Watcher -| Function | Signature | -| ---------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `appGatewayTemp` | `0x1394c029` | -| `asyncDeployer__` | `0x2a39e801` | -| `callAppGateways` | `0x0050bef1` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x50ad0779` | -| `clearQueue` | `0xf22cb874` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `configurations__` | `0x52a3bbeb` | -| `deployForwarder__` | `0xd4e3b034` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `getCurrentRequestCount` | `0x5715abbb` | -| `getPayloadParams` | `0xae5eeb77` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequestParams` | `0x71263d0d` | -| `increaseFees` | `0xe9b304da` | -| `initialize` | `0xaaf7fc1a` | -| `isAppGatewayCalled` | `0xa79da6c7` | -| `isNonceUsed` | `0x5d00bb12` | -| `isWatcher` | `0x84785ecd` | -| `latestAsyncPromise` | `0xb8a8ba52` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `appGatewayTemp` | `0x1394c029` | +| `asyncDeployer__` | `0x2a39e801` | +| `callAppGateways` | `0x0050bef1` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x50ad0779` | +| `clearQueue` | `0xf22cb874` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `configurations__` | `0x52a3bbeb` | +| `deployForwarder__` | `0xd4e3b034` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `getCurrentRequestCount` | `0x5715abbb` | +| `getPayloadParams` | `0xae5eeb77` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequestParams` | `0x71263d0d` | +| `increaseFees` | `0xe9b304da` | +| `initialize` | `0xaaf7fc1a` | +| `isAppGatewayCalled` | `0xa79da6c7` | +| `isNonceUsed` | `0x5d00bb12` | +| `isWatcher` | `0x84785ecd` | +| `latestAsyncPromise` | `0xb8a8ba52` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadQueue` | `0x74f00ffb` | -| `promiseResolver__` | `0xdee152be` | -| `queue` | `0x65967f1a` | -| `queueAndSubmit` | `0x9d4c9df7` | -| `renounceOwnership` | `0x715018a6` | -| `requestHandler__` | `0x55184561` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0xa58c6fc5` | -| `setCoreContracts` | `0xefa891c4` | -| `setIsValidPlug` | `0x06c0a40a` | -| `setTriggerFees` | `0xaeb30511` | -| `submitRequest` | `0x4890b5ef` | -| `transferOwnership` | `0xf2fde38b` | -| `triggerFees` | `0x73f76aec` | -| `triggerFromChainSlug` | `0xd12b4f12` | -| `triggerFromPlug` | `0x3b847d12` | -| `watcherMultiCall` | `0x8021e82b` | -| `watcher__` | `0x300bb063` | +| `payloadQueue` | `0x74f00ffb` | +| `promiseResolver__` | `0xdee152be` | +| `queue` | `0x65967f1a` | +| `queueAndSubmit` | `0x9d4c9df7` | +| `renounceOwnership` | `0x715018a6` | +| `requestHandler__` | `0x55184561` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0xa58c6fc5` | +| `setCoreContracts` | `0xefa891c4` | +| `setIsValidPlug` | `0x06c0a40a` | +| `setTriggerFees` | `0xaeb30511` | +| `submitRequest` | `0x4890b5ef` | +| `transferOwnership` | `0xf2fde38b` | +| `triggerFees` | `0x73f76aec` | +| `triggerFromChainSlug` | `0xd12b4f12` | +| `triggerFromPlug` | `0x3b847d12` | +| `watcherMultiCall` | `0x8021e82b` | +| `watcher__` | `0x300bb063` | ## CCTPSwitchboard -| Function | Signature | -| -------------------------------- | ------------ | -| `addRemoteEndpoint` | `0x7d396da5` | -| `allowPacket` | `0x21e9ec80` | -| `allowPayload` | `0x31c23f66` | -| `attest` | `0x63671b60` | +| Function | Signature | +| -------- | --------- | +| `addRemoteEndpoint` | `0x7d396da5` | +| `allowPacket` | `0x21e9ec80` | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x63671b60` | | `attestVerifyAndProveExecutions` | `0x6c913e2f` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `chainSlugToRemoteEndpoint` | `0xa4500424` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `domainToRemoteEndpoint` | `0xc24964fe` | -| `getTransmitter` | `0x73e7d880` | -| `grantRole` | `0x2f2ff15d` | -| `handleReceiveMessage` | `0x96abeb70` | -| `hasRole` | `0x91d14854` | -| `isAttested` | `0xc13c2396` | -| `isRemoteExecuted` | `0x0cd97747` | -| `isSyncedOut` | `0x5ae5dfd6` | -| `messageTransmitter` | `0x7b04c181` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `processTrigger` | `0x7f3352bc` | -| `proveRemoteExecutions` | `0x893289f8` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `remoteExecutedDigests` | `0xecbf77d9` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `switchboardId` | `0xd3be4120` | -| `syncOut` | `0x69a60ff0` | -| `transferOwnership` | `0xf2fde38b` | -| `verifyAttestations` | `0x6f30514c` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `chainSlugToRemoteEndpoint` | `0xa4500424` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `domainToRemoteEndpoint` | `0xc24964fe` | +| `getTransmitter` | `0x73e7d880` | +| `grantRole` | `0x2f2ff15d` | +| `handleReceiveMessage` | `0x96abeb70` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `isRemoteExecuted` | `0x0cd97747` | +| `isSyncedOut` | `0x5ae5dfd6` | +| `messageTransmitter` | `0x7b04c181` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `processTrigger` | `0x7f3352bc` | +| `proveRemoteExecutions` | `0x893289f8` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `remoteExecutedDigests` | `0xecbf77d9` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `switchboardId` | `0xd3be4120` | +| `syncOut` | `0x69a60ff0` | +| `transferOwnership` | `0xf2fde38b` | +| `verifyAttestations` | `0x6f30514c` | ## FastSwitchboard -| Function | Signature | -| ---------------------------- | ------------ | -| `allowPayload` | `0x31c23f66` | -| `attest` | `0x63671b60` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getTransmitter` | `0x73e7d880` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isAttested` | `0xc13c2396` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x63671b60` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getTransmitter` | `0x73e7d880` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `processTrigger` | `0x7f3352bc` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `switchboardId` | `0xd3be4120` | -| `transferOwnership` | `0xf2fde38b` | +| `processTrigger` | `0x7f3352bc` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `switchboardId` | `0xd3be4120` | +| `transferOwnership` | `0xf2fde38b` | ## MessageSwitchboard -| Function | Signature | -| ---------------------------- | ------------ | -| `allowPayload` | `0x31c23f66` | -| `attest` | `0x4cc621d2` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getSwitchboardFees` | `0x99de43bf` | -| `getTransmitter` | `0x73e7d880` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isAttested` | `0xc13c2396` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x4cc621d2` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getSwitchboardFees` | `0x99de43bf` | +| `getTransmitter` | `0x73e7d880` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadCounter` | `0x550ce1d5` | -| `processTrigger` | `0x7f3352bc` | -| `registerSibling` | `0x4f58b88c` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setSiblingConfig` | `0xacfbfc03` | -| `setSwitchboardFees` | `0x476bfc49` | -| `siblingPlugs` | `0x25fc3bcc` | -| `siblingSockets` | `0xce3483a5` | -| `siblingSwitchboards` | `0x51de49c9` | -| `socket__` | `0xc6a261d2` | -| `switchboardFees` | `0xb2a71ee7` | -| `switchboardId` | `0xd3be4120` | -| `transferOwnership` | `0xf2fde38b` | +| `payloadCounter` | `0x550ce1d5` | +| `processTrigger` | `0x7f3352bc` | +| `registerSibling` | `0x4f58b88c` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setSiblingConfig` | `0xacfbfc03` | +| `setSwitchboardFees` | `0x476bfc49` | +| `siblingPlugs` | `0x25fc3bcc` | +| `siblingSockets` | `0xce3483a5` | +| `siblingSwitchboards` | `0x51de49c9` | +| `socket__` | `0xc6a261d2` | +| `switchboardFees` | `0xb2a71ee7` | +| `switchboardId` | `0xd3be4120` | +| `transferOwnership` | `0xf2fde38b` | ## ReadPrecompile -| Function | Signature | -| ------------------------------ | ------------ | -| `expiryTime` | `0x99bc0aea` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x62974d96` | -| `readFees` | `0xe06357a2` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0x7f0b2207` | -| `setExpiryTime` | `0x30fc4cff` | -| `setFees` | `0x3d18678e` | +| Function | Signature | +| -------- | --------- | +| `expiryTime` | `0x99bc0aea` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `handlePayload` | `0x62974d96` | +| `readFees` | `0xe06357a2` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0x7f0b2207` | +| `setExpiryTime` | `0x30fc4cff` | +| `setFees` | `0x3d18678e` | | `validateAndGetPrecompileData` | `0x997f5bef` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## SchedulePrecompile -| Function | Signature | -| ------------------------------ | ------------ | -| `expiryTime` | `0x99bc0aea` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x62974d96` | -| `maxScheduleDelayInSeconds` | `0x3ef01cdb` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0x7f0b2207` | -| `scheduleCallbackFees` | `0x4c5b6007` | -| `scheduleFeesPerSecond` | `0x852a74c1` | -| `setExpiryTime` | `0x30fc4cff` | +| Function | Signature | +| -------- | --------- | +| `expiryTime` | `0x99bc0aea` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `handlePayload` | `0x62974d96` | +| `maxScheduleDelayInSeconds` | `0x3ef01cdb` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0x7f0b2207` | +| `scheduleCallbackFees` | `0x4c5b6007` | +| `scheduleFeesPerSecond` | `0x852a74c1` | +| `setExpiryTime` | `0x30fc4cff` | | `setMaxScheduleDelayInSeconds` | `0x12953318` | -| `setScheduleCallbackFees` | `0xec8fd71e` | -| `setScheduleFeesPerSecond` | `0x28e59e57` | +| `setScheduleCallbackFees` | `0xec8fd71e` | +| `setScheduleFeesPerSecond` | `0x28e59e57` | | `validateAndGetPrecompileData` | `0x997f5bef` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## WritePrecompile -| Function | Signature | -| ------------------------------ | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainMaxMsgValueLimit` | `0x01d1e126` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `contractFactoryPlugs` | `0x35426631` | -| `digestHashes` | `0xd1a862bf` | -| `expiryTime` | `0x99bc0aea` | -| `getDigest` | `0x3554edc7` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `getPrevBatchDigestHash` | `0x372863a1` | -| `handlePayload` | `0x62974d96` | -| `initialize` | `0xeb990c59` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0x7f0b2207` | -| `setContractFactoryPlugs` | `0x8b198f5c` | -| `setExpiryTime` | `0x30fc4cff` | -| `setFees` | `0x3d18678e` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainMaxMsgValueLimit` | `0x01d1e126` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `contractFactoryPlugs` | `0x35426631` | +| `digestHashes` | `0xd1a862bf` | +| `expiryTime` | `0x99bc0aea` | +| `getDigest` | `0x3554edc7` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `getPrevBatchDigestHash` | `0x372863a1` | +| `handlePayload` | `0x62974d96` | +| `initialize` | `0xeb990c59` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0x7f0b2207` | +| `setContractFactoryPlugs` | `0x8b198f5c` | +| `setExpiryTime` | `0x30fc4cff` | +| `setFees` | `0x3d18678e` | +| `transferOwnership` | `0xf2fde38b` | | `updateChainMaxMsgValueLimits` | `0x6a7aa6ac` | -| `uploadProof` | `0x81b48fcf` | +| `uploadProof` | `0x81b48fcf` | | `validateAndGetPrecompileData` | `0x997f5bef` | -| `watcherProofs` | `0x3fa3166b` | -| `watcher__` | `0x300bb063` | -| `writeFees` | `0x5c664aeb` | +| `watcherProofs` | `0x3fa3166b` | +| `watcher__` | `0x300bb063` | +| `writeFees` | `0x5c664aeb` | + diff --git a/foundry.toml b/foundry.toml index 0ddd48f5..5144b5ba 100644 --- a/foundry.toml +++ b/foundry.toml @@ -10,27 +10,26 @@ evm_version = 'paris' via_ir = false [labels] -0x774f608eD8fc03B05a9da51588F8571ced4c2eb2 = "AddressResolver" -0x9c58dAABeBE7D6DfD8F70097c6f9c87FEC9b83DE = "AddressResolverImpl" -0xF1D3ebDF91Cf4b1bc7C9A1D78413CD1Ed2d3123d = "AsyncDeployer" -0x8daf174Be9Bb708c04b708A92b88Cc89bd223498 = "AsyncDeployerImpl" -0xE4243383566fcA32aA6815dE83e8EA86b2027b8b = "AuctionManager" -0x122beAFCfc2E99D825322a78EAFD8a11fa2d9E0b = "AuctionManagerImpl" -0x6a6697A2AD51DB9a41BaEE78e194335c1aD7369d = "Configurations" -0x8A9256F31b0bb85863c253F8CAE800A32Cb2d595 = "ConfigurationsImpl" -0xE986bCd19b8725ea3417C2A7728158ecABA6C8bE = "DeployForwarder" -0xfBe803842B50d8A2a91DA3dD88B67E92D5C0bd97 = "DeployForwarderImpl" -0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79 = "ERC1967Factory" -0xa6D93e7B2cde3C8d318f45890dE3dB0a2E54058B = "FeesManager" -0x38A7558D2C3b4097c2098444a46D625D51E7336F = "FeesManagerImpl" -0x13A3018920c7b56B20dd34E29C298121025E6de4 = "FeesPool" -0x40834274ee715B1748e450A67cFf2B52b0388eC3 = "PromiseResolver" -0xE693bEc40e39223749AC351156E713b7256541B0 = "ReadPrecompile" -0xE785Fdbd049D0647e8B2Bd28C75a679dEBaD9D6f = "RequestHandler" -0x5332d341cd7B423C2f75AF7Ca295455e5F08fAcb = "RequestHandlerImpl" -0x99af65efe676C4899F6e500DF18d4fD84dbe0A1D = "SchedulePrecompile" -0x96ACe2d4a36a1Fd6e3eeE1cD3FeDA36eA62E3064 = "Watcher" -0xE5542FAB56B652A95aBD05a08E920687d1ef3849 = "WatcherImpl" -0x27794dd1166ED0c6A70c655C297BB79bF06bf44A = "WritePrecompile" -0xc2Ca571f4d4C2008Da4Bd750BaD3d50A5705ffF8 = "WritePrecompileImpl" -0x337720E1F09013B0bc04D55a7f0f5bac94a11840 = "APP_GATEWAY" +0xAA77c2dE14CfFF4244a127deED6b53ce79481e14 = "AddressResolver" +0xe857a826D330Fc0429c67FaBEB8B66C26ea1DD5f = "AddressResolverImpl" +0x24c3f774c231ADFeb5e22Ad826a666A0FF9742C8 = "AsyncDeployer" +0xB7Bf09935108753491E59114dc0B713cDa6F703F = "AsyncDeployerImpl" +0xd5853f69f5dE728AEF7d1cF029cB3bF1581A4ED4 = "AuctionManager" +0x89A0D4550D5aFa809B74856624D4595188641BCe = "AuctionManagerImpl" +0x0f2801ee741A3BdeA2245d97AB54B1C4d7734534 = "Configurations" +0xD41d93042Dd1aB8c712C212A6907d4dC0718D021 = "ConfigurationsImpl" +0x54676a772aEe69E3F87178F2b5E4414dcE9A9720 = "DeployForwarder" +0x9882ce57b618175Bd9d3a4eC50ebD682B39bc467 = "DeployForwarderImpl" +0x61788F19CA1b098cE8437f8eb13B1Ad68f4FcD77 = "ERC1967Factory" +0x9339e8D915Aaf467d2fC01a4e694c8FE85621e94 = "FeesManager" +0x27b763c5410E83c02F21D97B33555729B77B2Ce1 = "FeesManagerImpl" +0xC8d803B7c1719cdF21392405879D1B56398045C4 = "FeesPool" +0x9BE3513a5d32E74935a54e5516b4daa198da5574 = "PromiseResolver" +0x784730D5e5D2F64eA63BfafeDC759317438c9186 = "ReadPrecompile" +0x22FaddfD47B9E0B545f83a2E7Cd05c12889c7a57 = "RequestHandler" +0xAA6EfF8dbd53B8d95a02c59Fe5C8A8422B08F5AA = "RequestHandlerImpl" +0x074118aB15e54A84b42Ff3de5233721434cF9f55 = "SchedulePrecompile" +0xdd25a87AeB5bCEeBAc0EB27aFfaBB6eB5a2857ca = "Watcher" +0xb143810f13fDF66F7a9B973252AEC80ec47FF0cb = "WatcherImpl" +0x66ce424303EC8499C5cdC4F6437A0434D8bd9b81 = "WritePrecompile" +0x962E1db23f6C5879A5c9D58CcB8c67CD282F1000 = "WritePrecompileImpl" diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index b493b520..097f811f 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -35,7 +35,7 @@ export const getChains = () => { return [ ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA, - // ChainSlug.BASE_SEPOLIA, + ChainSlug.BASE_SEPOLIA, ]; case DeploymentMode.STAGE: return [ diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index 3056c429..8428e868 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -21,7 +21,7 @@ const tokens: TokenMap = { const feePools: { [key: string]: string } = { [DeploymentMode.LOCAL]: "0x9De353dD1131aB4e502590D3a1832652FA316268", [DeploymentMode.DEV]: "0x13A3018920c7b56B20dd34E29C298121025E6de4", - [DeploymentMode.STAGE]: "0x13A3018920c7b56B20dd34E29C298121025E6de4", + [DeploymentMode.STAGE]: "0xC8d803B7c1719cdF21392405879D1B56398045C4", }; export const getFeeTokens = (chainSlug: number): string[] => { diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index b2c23fb0..e0355172 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -120,7 +120,7 @@ export const configureChains = async (addresses: DeploymentAddresses) => { socketContract ); - await setSiblingConfig(chain, addresses, signer, socketContract); + await setSiblingConfig(chain, addresses, signer); await storeAddresses(deployUtils.addresses, chain, mode); } }; @@ -146,14 +146,11 @@ async function setOnchainContracts( fastSwitchboardId: string, cctpSwitchboardId: string ) { - console.log("Setting onchain contracts"); + console.log("Setting onchain contracts", chain); const signer: Wallet = getWatcherSigner(); const chainAddresses = addresses[chain] as ChainAddressesObj; const socket = toBytes32FormatHexString(chainAddresses[Contracts.Socket]); - const feesPlug = toBytes32FormatHexString( - chainAddresses[Contracts.FeesPlug]! - ); const contractFactory = toBytes32FormatHexString( chainAddresses[Contracts.ContractFactoryPlug] ); @@ -191,7 +188,11 @@ async function setOnchainContracts( signer ); - if (chainAddresses[Contracts.FeesPlug]) + if (chainAddresses[Contracts.FeesPlug]) { + const feesPlug = toBytes32FormatHexString( + chainAddresses[Contracts.FeesPlug]! + ); + await updateContractSettings( EVMX_CHAIN_ID, Contracts.FeesManager, @@ -202,7 +203,7 @@ async function setOnchainContracts( [chain, toBytes32FormatHexString(feesPlug)], signer ); - + } await updateContractSettings( EVMX_CHAIN_ID, Contracts.WritePrecompile, @@ -219,7 +220,6 @@ const setSiblingConfig = async ( chain: number, addresses: DeploymentAddresses, signer: Wallet, - socket: Contract ) => { try { console.log("Setting sibling config"); @@ -249,6 +249,17 @@ const setSiblingConfig = async ( continue; } + const siblingSwitchboard = await switchboard.siblingSwitchboards( + remoteChainSlug + ); + const siblingSocket = await switchboard.siblingSockets(remoteChainSlug); + const siblingFees = await switchboard.switchboardFees(remoteChainSlug); + + if (siblingSwitchboard == toBytes32FormatHexString(remoteSwitchboardAddress) && siblingSocket == toBytes32FormatHexString(remoteSocket) && siblingFees == MSG_SB_FEES) { + console.log(`Sibling config ${remoteChainSlug} already exists`); + continue; + } + const registerTx = await switchboard.setSiblingConfig( remoteChainSlug, MSG_SB_FEES, @@ -286,14 +297,18 @@ const addRemoteEndpointsToCCTPSwitchboard = async ( for (const remoteChainSlug of remoteChainSlugs) { const remoteSwitchboardAddress = - addresses[remoteChainSlug]?.[Contracts.CCTPSwitchboard]; + toBytes32FormatHexString( + addresses[remoteChainSlug]?.[Contracts.CCTPSwitchboard]! + ); const currentRemoteEndpoint = await switchboard.chainSlugToRemoteEndpoint( remoteChainSlug ); + if (currentRemoteEndpoint.remoteAddress == remoteSwitchboardAddress) { console.log(`Remote endpoint ${remoteChainSlug} already exists`); continue; } + if (!remoteSwitchboardAddress) { console.log( `Remote switchboard address not found for ${remoteChainSlug}` @@ -302,7 +317,7 @@ const addRemoteEndpointsToCCTPSwitchboard = async ( } const registerTx = await switchboard.addRemoteEndpoint( remoteChainSlug, - `0x${remoteSwitchboardAddress.slice(2).padStart(64, "0")}`, + remoteSwitchboardAddress, CCTP_DOMAINS[remoteChainSlug], { ...(await overrides(chain)), diff --git a/hardhat-scripts/deploy/6.connect.ts b/hardhat-scripts/deploy/6.connect.ts index a04fd0de..32975a63 100644 --- a/hardhat-scripts/deploy/6.connect.ts +++ b/hardhat-scripts/deploy/6.connect.ts @@ -112,16 +112,16 @@ export const updateConfigEVMx = async () => { const addr = addresses[chain]!; for (const plugContract of plugs) { - const appGatewayId = getAppGatewayId(plugContract, addresses); - const switchboardId = addr[Contracts.FastSwitchboardId]; - const plugBytes32Hex = toBytes32FormatHexString(addr[plugContract]); - checkIfAppGatewayIdExists(appGatewayId, "AppGatewayId"); - if (!addr[plugContract]) { console.log(`${plugContract} not found on ${chain}`); continue; } + const appGatewayId = getAppGatewayId(plugContract, addresses); + const switchboardId = addr[Contracts.FastSwitchboardId]; + const plugBytes32Hex = toBytes32FormatHexString(addr[plugContract]); + checkIfAppGatewayIdExists(appGatewayId, "AppGatewayId"); + if ( await isConfigSetOnEVMx( configurationsContract, diff --git a/hardhat-scripts/utils/overrides.ts b/hardhat-scripts/utils/overrides.ts index cc8383d2..4f05c3b0 100644 --- a/hardhat-scripts/utils/overrides.ts +++ b/hardhat-scripts/utils/overrides.ts @@ -28,7 +28,7 @@ export const chainOverrides: { // gasPrice: 212_000_000_000, }, [ChainSlug.BASE]: { - gasLimit: 2_000_000, + // gasLimit: 2_000_000, }, [ChainSlug.ARBITRUM]: { gasPrice: 100_629_157, From 3b799bf4fec882555e67ab01fbb7efc13712108d Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 28 Jul 2025 23:18:35 +0530 Subject: [PATCH 062/139] feat: stage deployments --- Errors.md | 219 ++-- EventTopics.md | 435 ++++---- FunctionSignatures.md | 1087 +++++++++---------- deployments/stage_addresses.json | 178 ++- deployments/stage_verification.json | 205 +--- hardhat-scripts/deploy/3.configureChains.ts | 16 +- 6 files changed, 1001 insertions(+), 1139 deletions(-) diff --git a/Errors.md b/Errors.md index 9b2050c9..ae06096c 100644 --- a/Errors.md +++ b/Errors.md @@ -1,176 +1,175 @@ # Custom Error Codes - ## evmx/fees/FeesPool.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ------------------ | ------------ | | `TransferFailed()` | `0x90b8ec18` | ## evmx/helpers/AsyncPromise.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| -------------------------- | ------------ | | `PromiseAlreadyResolved()` | `0x56b63537` | -| `OnlyInvoker()` | `0x74ed21f5` | -| `PromiseAlreadySetUp()` | `0x927c53d5` | -| `PromiseRevertFailed()` | `0x0175b9de` | -| `NotLatestPromise()` | `0x39ca95d3` | +| `OnlyInvoker()` | `0x74ed21f5` | +| `PromiseAlreadySetUp()` | `0x927c53d5` | +| `PromiseRevertFailed()` | `0x0175b9de` | +| `NotLatestPromise()` | `0x39ca95d3` | ## evmx/plugs/ContractFactoryPlug.sol -| Error | Signature | -|-------|-----------| -| `DeploymentFailed()` | `0x30116425` | +| Error | Signature | +| -------------------------------- | ------------ | +| `DeploymentFailed()` | `0x30116425` | | `ExecutionFailed(bytes32,bytes)` | `0xd255d8a3` | -| `information(bool,,bytes)` | `0x3a82a1f3` | +| `information(bool,,bytes)` | `0x3a82a1f3` | ## evmx/plugs/FeesPlug.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| --------------------------------------------------- | ------------ | | `InsufficientTokenBalance(address,uint256,uint256)` | `0xebd6ced9` | -| `InvalidDepositAmount()` | `0xfe9ba5cd` | -| `TokenNotWhitelisted(address)` | `0xea3bff2e` | +| `InvalidDepositAmount()` | `0xfe9ba5cd` | +| `TokenNotWhitelisted(address)` | `0xea3bff2e` | ## evmx/watcher/RequestHandler.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ----------------------- | ------------ | | `InsufficientMaxFees()` | `0x0e5bc492` | ## protocol/Socket.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ----------------------------------------- | ------------ | | `PayloadAlreadyExecuted(ExecutionStatus)` | `0xf4c54edd` | -| `VerificationFailed()` | `0x439cc0cd` | -| `LowGasLimit()` | `0xd38edae0` | -| `InsufficientMsgValue()` | `0x78f38f76` | +| `VerificationFailed()` | `0x439cc0cd` | +| `LowGasLimit()` | `0xd38edae0` | +| `InsufficientMsgValue()` | `0x78f38f76` | ## protocol/SocketConfig.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| --------------------- | ------------ | | `SwitchboardExists()` | `0x2dff8555` | -| `PlugNotConnected()` | `0x411d0255` | +| `PlugNotConnected()` | `0x411d0255` | ## protocol/SocketFeeManager.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| -------------------- | ------------ | | `InsufficientFees()` | `0x8d53e553` | -| `FeeTooLow()` | `0x732f9413` | +| `FeeTooLow()` | `0x732f9413` | ## protocol/SocketUtils.sol -| Error | Signature | -|-------|-----------| -| `OnlyOffChain()` | `0x9cbfe066` | +| Error | Signature | +| -------------------- | ------------ | +| `OnlyOffChain()` | `0x9cbfe066` | | `SimulationFailed()` | `0x2fbab3ac` | ## protocol/base/MessagePlugBase.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ---------------- | ------------ | | `NotSupported()` | `0xa0387940` | ## protocol/switchboard/CCTPSwitchboard.sol -| Error | Signature | -|-------|-----------| -| `RemoteExecutionNotFound()` | `0xbd506972` | +| Error | Signature | +| ------------------------------- | ------------ | +| `RemoteExecutionNotFound()` | `0xbd506972` | | `PrevBatchDigestHashMismatch()` | `0xc9864e9d` | -| `NotAttested()` | `0x99efb890` | -| `NotExecuted()` | `0xec84b1da` | -| `InvalidSender()` | `0xddb5de5e` | -| `OnlyMessageTransmitter()` | `0x935ac89c` | +| `NotAttested()` | `0x99efb890` | +| `NotExecuted()` | `0xec84b1da` | +| `InvalidSender()` | `0xddb5de5e` | +| `OnlyMessageTransmitter()` | `0x935ac89c` | ## protocol/switchboard/FastSwitchboard.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ------------------- | ------------ | | `AlreadyAttested()` | `0x35d90805` | | `WatcherNotFound()` | `0xa278e4ad` | ## protocol/switchboard/MessageSwitchboard.sol -| Error | Signature | -|-------|-----------| -| `AlreadyAttested()` | `0x35d90805` | -| `WatcherNotFound()` | `0xa278e4ad` | -| `SiblingNotFound()` | `0xb3b47851` | +| Error | Signature | +| ----------------------------- | ------------ | +| `AlreadyAttested()` | `0x35d90805` | +| `WatcherNotFound()` | `0xa278e4ad` | +| `SiblingNotFound()` | `0xb3b47851` | | `InvalidTargetVerification()` | `0xe9377a19` | -| `InvalidMsgValue()` | `0x1841b4e1` | +| `InvalidMsgValue()` | `0x1841b4e1` | ## utils/AccessControl.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| ------------------- | ------------ | | `NoPermit(bytes32)` | `0x962f6333` | ## utils/common/Converters.sol -| Error | Signature | -|-------|-----------| +| Error | Signature | +| -------------------------- | ------------ | | `NotAnEvmAddress(bytes32)` | `0x33b960d0` | ## utils/common/Errors.sol -| Error | Signature | -|-------|-----------| -| `ZeroAddress()` | `0xd92e233d` | -| `InvalidTransmitter()` | `0x58a70a0a` | -| `InvalidTokenAddress()` | `0x1eb00b06` | -| `InvalidSwitchboard()` | `0xf63c9e4d` | -| `SocketAlreadyInitialized()` | `0xc9500b00` | -| `NotSocket()` | `0xc59f8f7c` | -| `PlugNotFound()` | `0x5f1ac76a` | -| `ResolvingScheduleTooEarly()` | `0x207e8731` | -| `CallFailed()` | `0x3204506f` | -| `InvalidAppGateway()` | `0x82ded261` | -| `AppGatewayAlreadyCalled()` | `0xb224683f` | -| `InvalidCallerTriggered()` | `0x3292d247` | -| `InvalidPromise()` | `0x45f2d176` | -| `InvalidWatcherSignature()` | `0x5029f14f` | -| `NonceUsed()` | `0x1f6d5aef` | -| `AsyncModifierNotSet()` | `0xcae106f9` | -| `WatcherNotSet()` | `0x42d473a7` | -| `InvalidTarget()` | `0x82d5d76a` | -| `InvalidIndex()` | `0x63df8171` | -| `InvalidChainSlug()` | `0xbff6b106` | -| `InvalidPayloadSize()` | `0xfbdf7954` | -| `InvalidOnChainAddress()` | `0xb758c606` | -| `InvalidScheduleDelay()` | `0x9a993219` | -| `AuctionClosed()` | `0x36b6b46d` | -| `AuctionNotOpen()` | `0xf0460077` | -| `BidExceedsMaxFees()` | `0x4c923f3c` | -| `LowerBidAlreadyExists()` | `0xaaa1f709` | -| `RequestCountMismatch()` | `0x98bbcbff` | -| `InvalidAmount()` | `0x2c5211c6` | -| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | -| `InsufficientBalance()` | `0xf4d678b8` | -| `InvalidCaller()` | `0x48f5c3ed` | -| `InvalidGateway()` | `0xfc9dfe85` | -| `RequestAlreadyCancelled()` | `0xc70f47d8` | -| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | -| `InvalidBid()` | `0xc6388ef7` | -| `MaxReAuctionCountReached()` | `0xf2b4388c` | -| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | -| `OnlyWatcherAllowed()` | `0xdf7d227c` | -| `InvalidPrecompileData()` | `0x320062c0` | -| `InvalidCallType()` | `0x39d2eb55` | -| `NotRequestHandler()` | `0x8f8cba5b` | -| `NotInvoker()` | `0x8a6353d1` | -| `NotPromiseResolver()` | `0x86d876b2` | -| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | -| `InsufficientFees()` | `0x8d53e553` | -| `RequestAlreadySettled()` | `0x66fad465` | -| `NoWriteRequest()` | `0x9dcd3065` | -| `AlreadyAssigned()` | `0x9688dc51` | -| `OnlyAppGateway()` | `0xfec944ea` | +| Error | Signature | +| --------------------------------------------- | ------------ | +| `ZeroAddress()` | `0xd92e233d` | +| `InvalidTransmitter()` | `0x58a70a0a` | +| `InvalidTokenAddress()` | `0x1eb00b06` | +| `InvalidSwitchboard()` | `0xf63c9e4d` | +| `SocketAlreadyInitialized()` | `0xc9500b00` | +| `NotSocket()` | `0xc59f8f7c` | +| `PlugNotFound()` | `0x5f1ac76a` | +| `ResolvingScheduleTooEarly()` | `0x207e8731` | +| `CallFailed()` | `0x3204506f` | +| `InvalidAppGateway()` | `0x82ded261` | +| `AppGatewayAlreadyCalled()` | `0xb224683f` | +| `InvalidCallerTriggered()` | `0x3292d247` | +| `InvalidPromise()` | `0x45f2d176` | +| `InvalidWatcherSignature()` | `0x5029f14f` | +| `NonceUsed()` | `0x1f6d5aef` | +| `AsyncModifierNotSet()` | `0xcae106f9` | +| `WatcherNotSet()` | `0x42d473a7` | +| `InvalidTarget()` | `0x82d5d76a` | +| `InvalidIndex()` | `0x63df8171` | +| `InvalidChainSlug()` | `0xbff6b106` | +| `InvalidPayloadSize()` | `0xfbdf7954` | +| `InvalidOnChainAddress()` | `0xb758c606` | +| `InvalidScheduleDelay()` | `0x9a993219` | +| `AuctionClosed()` | `0x36b6b46d` | +| `AuctionNotOpen()` | `0xf0460077` | +| `BidExceedsMaxFees()` | `0x4c923f3c` | +| `LowerBidAlreadyExists()` | `0xaaa1f709` | +| `RequestCountMismatch()` | `0x98bbcbff` | +| `InvalidAmount()` | `0x2c5211c6` | +| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | +| `InsufficientBalance()` | `0xf4d678b8` | +| `InvalidCaller()` | `0x48f5c3ed` | +| `InvalidGateway()` | `0xfc9dfe85` | +| `RequestAlreadyCancelled()` | `0xc70f47d8` | +| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | +| `InvalidBid()` | `0xc6388ef7` | +| `MaxReAuctionCountReached()` | `0xf2b4388c` | +| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | +| `OnlyWatcherAllowed()` | `0xdf7d227c` | +| `InvalidPrecompileData()` | `0x320062c0` | +| `InvalidCallType()` | `0x39d2eb55` | +| `NotRequestHandler()` | `0x8f8cba5b` | +| `NotInvoker()` | `0x8a6353d1` | +| `NotPromiseResolver()` | `0x86d876b2` | +| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | +| `InsufficientFees()` | `0x8d53e553` | +| `RequestAlreadySettled()` | `0x66fad465` | +| `NoWriteRequest()` | `0x9dcd3065` | +| `AlreadyAssigned()` | `0x9688dc51` | +| `OnlyAppGateway()` | `0xfec944ea` | | `NewMaxFeesLowerThanCurrent(uint256,uint256)` | `0x1345dda1` | -| `InvalidContract()` | `0x6eefed20` | -| `InvalidData()` | `0x5cb045db` | -| `InvalidSignature()` | `0x8baa579f` | -| `DeadlinePassed()` | `0x70f65caa` | +| `InvalidContract()` | `0x6eefed20` | +| `InvalidData()` | `0x5cb045db` | +| `InvalidSignature()` | `0x8baa579f` | +| `DeadlinePassed()` | `0x70f65caa` | diff --git a/EventTopics.md b/EventTopics.md index 2eee906a..0a408806 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -2,39 +2,39 @@ ## AuctionManager -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AuctionEndDelaySecondsSet` | `(auctionEndDelaySeconds: uint256)` | `0xf38f0d9dc8459cf5426728c250d115196a4c065ebc1a6c29da24764a8c0da722` | -| `AuctionEnded` | `(requestCount: uint40, winningBid: tuple)` | `0xede4ec1efc469fac10dcb4930f70be4cd21f3700ed61c91967c19a7cd7c0d86e` | -| `AuctionRestarted` | `(requestCount: uint40)` | `0x071867b21946ec4655665f0d4515d3757a5a52f144c762ecfdfb11e1da542b82` | -| `AuctionStarted` | `(requestCount: uint40)` | `0xcd040613cf8ef0cfcaa3af0d711783e827a275fc647c116b74595bf17cb9364f` | -| `BidPlaced` | `(requestCount: uint40, bid: tuple)` | `0x7f79485e4c9aeea5d4899bc6f7c63b22ac1f4c01d2d28c801e94732fee657b5d` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `MaxReAuctionCountSet` | `(maxReAuctionCount: uint256)` | `0x2f6fadde7ab8ab83d21ab10c3bc09dde179f8696d47c4176581facf0c6f96bbf` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ---------------------------- | ------------------------------------------- | -------------------------------------------------------------------- | +| `AuctionEndDelaySecondsSet` | `(auctionEndDelaySeconds: uint256)` | `0xf38f0d9dc8459cf5426728c250d115196a4c065ebc1a6c29da24764a8c0da722` | +| `AuctionEnded` | `(requestCount: uint40, winningBid: tuple)` | `0xede4ec1efc469fac10dcb4930f70be4cd21f3700ed61c91967c19a7cd7c0d86e` | +| `AuctionRestarted` | `(requestCount: uint40)` | `0x071867b21946ec4655665f0d4515d3757a5a52f144c762ecfdfb11e1da542b82` | +| `AuctionStarted` | `(requestCount: uint40)` | `0xcd040613cf8ef0cfcaa3af0d711783e827a275fc647c116b74595bf17cb9364f` | +| `BidPlaced` | `(requestCount: uint40, bid: tuple)` | `0x7f79485e4c9aeea5d4899bc6f7c63b22ac1f4c01d2d28c801e94732fee657b5d` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `MaxReAuctionCountSet` | `(maxReAuctionCount: uint256)` | `0x2f6fadde7ab8ab83d21ab10c3bc09dde179f8696d47c4176581facf0c6f96bbf` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## Socket -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AppGatewayCallRequested` | `(triggerId: bytes32, appGatewayId: bytes32, switchboardId: uint64, plug: bytes32, overrides: bytes, payload: bytes)` | `0x8ff0599581fd62c5733e52cea3abd7874731f4a9f86ebb929e5e4afe103f74d4` | -| `ExecutionFailed` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x385334bc68a32c4d164625189adc7633e6074eb1b837fb4d11d768245151e4ce` | -| `ExecutionSuccess` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x324d63a433b21a12b90e79cd2ba736b2a5238be6165e03b750fa4a7d5193d5d9` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `PlugConnected` | `(plug: address, appGatewayId: bytes32, switchboardId: uint64)` | `0xb2a45daaee4fc6ced936700efec176684095e7b77c4cb1419b578ecc6f2ebce6` | -| `PlugDisconnected` | `(plug: address)` | `0x474a53f61630e976f47075b6029ba8d55d0563151bdb9222c5dbdc88f7af6f51` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SocketFeeManagerUpdated` | `(oldSocketFeeManager: address, newSocketFeeManager: address)` | `0xdcb02e10d5220346a4638aa2826eaab1897306623bc40a427049e4ebd12255b4` | -| `SwitchboardAdded` | `(switchboard: address, switchboardId: uint64)` | `0x2f945cce0a82eacc4841d996b3d0429e01c7c603f3f900253d21b428c760dce1` | -| `SwitchboardDisabled` | `(switchboardId: uint64)` | `0x9ab25a32266417ee52a390121ebca0463374e76cecb25596a0f68e9d96a9e0ff` | -| `SwitchboardEnabled` | `(switchboardId: uint64)` | `0xa1cea6c3e73c288db1f2e2d7f04d9fd5f12463c30019b4ed354ba8bc7bc26f28` | +| Event | Arguments | Topic | +| ---------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `AppGatewayCallRequested` | `(triggerId: bytes32, appGatewayId: bytes32, switchboardId: uint64, plug: bytes32, overrides: bytes, payload: bytes)` | `0x8ff0599581fd62c5733e52cea3abd7874731f4a9f86ebb929e5e4afe103f74d4` | +| `ExecutionFailed` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x385334bc68a32c4d164625189adc7633e6074eb1b837fb4d11d768245151e4ce` | +| `ExecutionSuccess` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x324d63a433b21a12b90e79cd2ba736b2a5238be6165e03b750fa4a7d5193d5d9` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `PlugConnected` | `(plug: address, appGatewayId: bytes32, switchboardId: uint64)` | `0xb2a45daaee4fc6ced936700efec176684095e7b77c4cb1419b578ecc6f2ebce6` | +| `PlugDisconnected` | `(plug: address)` | `0x474a53f61630e976f47075b6029ba8d55d0563151bdb9222c5dbdc88f7af6f51` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SocketFeeManagerUpdated` | `(oldSocketFeeManager: address, newSocketFeeManager: address)` | `0xdcb02e10d5220346a4638aa2826eaab1897306623bc40a427049e4ebd12255b4` | +| `SwitchboardAdded` | `(switchboard: address, switchboardId: uint64)` | `0x2f945cce0a82eacc4841d996b3d0429e01c7c603f3f900253d21b428c760dce1` | +| `SwitchboardDisabled` | `(switchboardId: uint64)` | `0x9ab25a32266417ee52a390121ebca0463374e76cecb25596a0f68e9d96a9e0ff` | +| `SwitchboardEnabled` | `(switchboardId: uint64)` | `0xa1cea6c3e73c288db1f2e2d7f04d9fd5f12463c30019b4ed354ba8bc7bc26f28` | ## IFastSwitchboard @@ -43,192 +43,192 @@ ## SocketBatcher -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## SocketFeeManager -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SocketFeesUpdated` | `(oldFees: uint256, newFees: uint256)` | `0xcbd4d756fb6198bbcc2e4013cce929f504ad46e9d97c543ef9a8dfea3e407053` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SocketFeesUpdated` | `(oldFees: uint256, newFees: uint256)` | `0xcbd4d756fb6198bbcc2e4013cce929f504ad46e9d97c543ef9a8dfea3e407053` | ## FeesManager -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `CreditsBlocked` | `(requestCount: uint40, consumeFrom: address, amount: uint256)` | `0xf037c15aef41440aa823cf1fdeaea332105d8b23d52557f6670189b5d76f1eed` | -| `CreditsTransferred` | `(from: address, to: address, amount: uint256)` | `0xed198cadddd93e734cbf04cb1c3226d9bafaeb504cedbd8ee36b830b0cb9e7a5` | -| `CreditsUnblocked` | `(requestCount: uint40, consumeFrom: address)` | `0x45db29ef2701319155cac058aa2f56ce1f73e0e238161d3db9f8c9a47655210d` | -| `CreditsUnblockedAndAssigned` | `(requestCount: uint40, consumeFrom: address, transmitter: address, amount: uint256)` | `0x38fd327622576a468e1b2818b00f50c8854703633ef8e583e1f31662888ffac2` | -| `CreditsUnwrapped` | `(consumeFrom: address, amount: uint256)` | `0xdcc9473b722b4c953617ab373840b365298a520bc7f20ce94fa7314f4a857774` | -| `CreditsWrapped` | `(consumeFrom: address, amount: uint256)` | `0x40246503613721eb4acf4020c6c56b6a16e5d08713316db0bea5210e8819c592` | -| `Deposited` | `(chainSlug: uint32, token: address, depositTo: address, creditAmount: uint256, nativeAmount: uint256)` | `0x72aedd284699bbd7a987e6942b824cfd6c627e354cb5a0760ac5768acd473f4a` | -| `FeesPlugSet` | `(chainSlug: uint32, feesPlug: bytes32)` | `0x677a00737c8099aa9e6c554104ca7941deb59125335cfb3d0d9f604f178db59c` | -| `FeesPoolSet` | `(feesPool: address)` | `0xd07af3fd70b48ab3c077a8d45c3a288498d905d0e3d1e65bc171f6c2e890d8ef` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WithdrawFailed` | `(payloadId: bytes32)` | `0xea147eb2109f71b4bda9e57528ba08b84821087a31cb43a7851dc6ff743d9be7` | +| Event | Arguments | Topic | +| ----------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `CreditsBlocked` | `(requestCount: uint40, consumeFrom: address, amount: uint256)` | `0xf037c15aef41440aa823cf1fdeaea332105d8b23d52557f6670189b5d76f1eed` | +| `CreditsTransferred` | `(from: address, to: address, amount: uint256)` | `0xed198cadddd93e734cbf04cb1c3226d9bafaeb504cedbd8ee36b830b0cb9e7a5` | +| `CreditsUnblocked` | `(requestCount: uint40, consumeFrom: address)` | `0x45db29ef2701319155cac058aa2f56ce1f73e0e238161d3db9f8c9a47655210d` | +| `CreditsUnblockedAndAssigned` | `(requestCount: uint40, consumeFrom: address, transmitter: address, amount: uint256)` | `0x38fd327622576a468e1b2818b00f50c8854703633ef8e583e1f31662888ffac2` | +| `CreditsUnwrapped` | `(consumeFrom: address, amount: uint256)` | `0xdcc9473b722b4c953617ab373840b365298a520bc7f20ce94fa7314f4a857774` | +| `CreditsWrapped` | `(consumeFrom: address, amount: uint256)` | `0x40246503613721eb4acf4020c6c56b6a16e5d08713316db0bea5210e8819c592` | +| `Deposited` | `(chainSlug: uint32, token: address, depositTo: address, creditAmount: uint256, nativeAmount: uint256)` | `0x72aedd284699bbd7a987e6942b824cfd6c627e354cb5a0760ac5768acd473f4a` | +| `FeesPlugSet` | `(chainSlug: uint32, feesPlug: bytes32)` | `0x677a00737c8099aa9e6c554104ca7941deb59125335cfb3d0d9f604f178db59c` | +| `FeesPoolSet` | `(feesPool: address)` | `0xd07af3fd70b48ab3c077a8d45c3a288498d905d0e3d1e65bc171f6c2e890d8ef` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WithdrawFailed` | `(payloadId: bytes32)` | `0xea147eb2109f71b4bda9e57528ba08b84821087a31cb43a7851dc6ff743d9be7` | ## FeesPool -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `NativeDeposited` | `(from: address, amount: uint256)` | `0xb5d7700fb0cf415158b8db7cc7c39f0eab16a825c92e221404b4c8bb099b4bbb` | -| `NativeWithdrawn` | `(success: bool, to: address, amount: uint256)` | `0xa81f1c8490022ee829d2e1a231053f5dbecad46caee71f6ea38a9db663a3f12b` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ---------------------------- | ----------------------------------------------- | -------------------------------------------------------------------- | +| `NativeDeposited` | `(from: address, amount: uint256)` | `0xb5d7700fb0cf415158b8db7cc7c39f0eab16a825c92e221404b4c8bb099b4bbb` | +| `NativeWithdrawn` | `(success: bool, to: address, amount: uint256)` | `0xa81f1c8490022ee829d2e1a231053f5dbecad46caee71f6ea38a9db663a3f12b` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## AddressResolver -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AsyncDeployerUpdated` | `(asyncDeployer_: address)` | `0x4df9cdd01544e8f6b0326650bc0b55611f47ce5ba2faa522d21fb675e9fc1f73` | -| `ContractAddressUpdated` | `(contractId_: bytes32, contractAddress_: address)` | `0xdf5ec2c15e11ce657bb21bc09c0b5ba95e315b4dba9934c6e311f47559babf28` | -| `DefaultAuctionManagerUpdated` | `(defaultAuctionManager_: address)` | `0x60f296739208a505ead7fb622df0f76b7791b824481b120a2300bdaf85e3e3d6` | -| `DeployForwarderUpdated` | `(deployForwarder_: address)` | `0x237b9bc9fef7508a02ca9ccca81f6965e500064a58024cae1218035da865fd2b` | -| `FeesManagerUpdated` | `(feesManager_: address)` | `0x94e67aa1341a65767dfde81e62fd265bfbade1f5744bfd3cd73f99a6eca0572a` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WatcherUpdated` | `(watcher_: address)` | `0xc13081d38d92b454cdb6ca20bbc65c12fa43a7a14a1529204ced5b6350052bb0` | +| Event | Arguments | Topic | +| ------------------------------ | --------------------------------------------------- | -------------------------------------------------------------------- | +| `AsyncDeployerUpdated` | `(asyncDeployer_: address)` | `0x4df9cdd01544e8f6b0326650bc0b55611f47ce5ba2faa522d21fb675e9fc1f73` | +| `ContractAddressUpdated` | `(contractId_: bytes32, contractAddress_: address)` | `0xdf5ec2c15e11ce657bb21bc09c0b5ba95e315b4dba9934c6e311f47559babf28` | +| `DefaultAuctionManagerUpdated` | `(defaultAuctionManager_: address)` | `0x60f296739208a505ead7fb622df0f76b7791b824481b120a2300bdaf85e3e3d6` | +| `DeployForwarderUpdated` | `(deployForwarder_: address)` | `0x237b9bc9fef7508a02ca9ccca81f6965e500064a58024cae1218035da865fd2b` | +| `FeesManagerUpdated` | `(feesManager_: address)` | `0x94e67aa1341a65767dfde81e62fd265bfbade1f5744bfd3cd73f99a6eca0572a` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WatcherUpdated` | `(watcher_: address)` | `0xc13081d38d92b454cdb6ca20bbc65c12fa43a7a14a1529204ced5b6350052bb0` | ## AsyncDeployer -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AsyncPromiseDeployed` | `(newAsyncPromise: address, salt: bytes32)` | `0xb6c5491cf83e09749b1a4dd6a9f07b0e925fcb0a915ac8c2b40e8ab28191c270` | -| `ForwarderDeployed` | `(newForwarder: address, salt: bytes32)` | `0x4dbbecb9cf9c8b93da9743a2b48ea52efe68d69230ab1c1b711891d9d223b29f` | -| `ImplementationUpdated` | `(contractName: string, newImplementation: address)` | `0xa1e41aa2c2f3f20d9b63ac06b634d2788768d6034f3d9192cdf7d07374bb16f4` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------------------- | -------------------------------------------------------------------- | +| `AsyncPromiseDeployed` | `(newAsyncPromise: address, salt: bytes32)` | `0xb6c5491cf83e09749b1a4dd6a9f07b0e925fcb0a915ac8c2b40e8ab28191c270` | +| `ForwarderDeployed` | `(newForwarder: address, salt: bytes32)` | `0x4dbbecb9cf9c8b93da9743a2b48ea52efe68d69230ab1c1b711891d9d223b29f` | +| `ImplementationUpdated` | `(contractName: string, newImplementation: address)` | `0xa1e41aa2c2f3f20d9b63ac06b634d2788768d6034f3d9192cdf7d07374bb16f4` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## AsyncPromise -| Event | Arguments | Topic | -| ----- | --------- | ----- | +| Event | Arguments | Topic | +| ------------- | ------------------- | -------------------------------------------------------------------- | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | ## DeployForwarder -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | ## Forwarder -| Event | Arguments | Topic | -| ----- | --------- | ----- | +| Event | Arguments | Topic | +| ------------- | ------------------- | -------------------------------------------------------------------- | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | ## ProxyFactory -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AdminChanged` | `(proxy: address, admin: address)` | `0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f` | -| `Deployed` | `(proxy: address, implementation: address, admin: address)` | `0xc95935a66d15e0da5e412aca0ad27ae891d20b2fb91cf3994b6a3bf2b8178082` | -| `Upgraded` | `(proxy: address, implementation: address)` | `0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7` | +| Event | Arguments | Topic | +| -------------- | ----------------------------------------------------------- | -------------------------------------------------------------------- | +| `AdminChanged` | `(proxy: address, admin: address)` | `0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f` | +| `Deployed` | `(proxy: address, implementation: address, admin: address)` | `0xc95935a66d15e0da5e412aca0ad27ae891d20b2fb91cf3994b6a3bf2b8178082` | +| `Upgraded` | `(proxy: address, implementation: address)` | `0x5d611f318680d00598bb735d61bacf0c514c6b50e1e5ad30040a4df2b12791c7` | ## TestUSDC -| Event | Arguments | Topic | -| ----- | --------- | ----- | +| Event | Arguments | Topic | +| ---------- | ----------------------------------------------------- | -------------------------------------------------------------------- | | `Approval` | `(owner: address, spender: address, amount: uint256)` | `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` | -| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | +| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | ## ContractFactoryPlug -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | -| `Deployed` | `(addr: address, salt: bytes32, returnData: bytes)` | `0x1246c6f8fd9f4abc542c7c8c8f793cfcde6b67aed1976a38aa134fc24af2dfe3` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ---------------------------- | --------------------------------------------------- | -------------------------------------------------------------------- | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `Deployed` | `(addr: address, salt: bytes32, returnData: bytes)` | `0x1246c6f8fd9f4abc542c7c8c8f793cfcde6b67aed1976a38aa134fc24af2dfe3` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## FeesPlug -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | -| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256)` | `0xeb4e1b24b7fe377de69f80f7380bda5ba4b43176c6a4d300a3be9009c49f4228` | -| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | -| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | +| Event | Arguments | Topic | +| ---------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256)` | `0xeb4e1b24b7fe377de69f80f7380bda5ba4b43176c6a4d300a3be9009c49f4228` | +| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | +| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | ## Configurations -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `IsValidPlugSet` | `(appGateway: address, chainSlug: uint32, plug: bytes32, isValid: bool)` | `0xd7a90efd60960a8435ef282822190655f6bd2ffa14bb350dc23d6f6956056d7e` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `PlugAdded` | `(appGatewayId: bytes32, chainSlug: uint32, plug: bytes32)` | `0x3734a2406c5c2f2556c82a0819c51e42a135dd102465cc9856594481ea2f1637` | -| `SocketSet` | `(chainSlug: uint32, socket: bytes32)` | `0x3200bf6ad2ab31b9220ed9d2f83089d7a1332f55aaa3825c57510743a315165b` | -| `SwitchboardSet` | `(chainSlug: uint32, sbType: bytes32, switchboardId: uint64)` | `0x5aeb296e3ed47512d11032a96d11f93d8538b9eb87aa1db45d412e7165d6850a` | +| Event | Arguments | Topic | +| ---------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------- | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `IsValidPlugSet` | `(appGateway: address, chainSlug: uint32, plug: bytes32, isValid: bool)` | `0xd7a90efd60960a8435ef282822190655f6bd2ffa14bb350dc23d6f6956056d7e` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `PlugAdded` | `(appGatewayId: bytes32, chainSlug: uint32, plug: bytes32)` | `0x3734a2406c5c2f2556c82a0819c51e42a135dd102465cc9856594481ea2f1637` | +| `SocketSet` | `(chainSlug: uint32, socket: bytes32)` | `0x3200bf6ad2ab31b9220ed9d2f83089d7a1332f55aaa3825c57510743a315165b` | +| `SwitchboardSet` | `(chainSlug: uint32, sbType: bytes32, switchboardId: uint64)` | `0x5aeb296e3ed47512d11032a96d11f93d8538b9eb87aa1db45d412e7165d6850a` | ## PromiseResolver -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `MarkedRevert` | `(payloadId: bytes32, isRevertingOnchain: bool)` | `0xcf1fd844cb4d32cbebb5ca6ce4ac834fe98da3ddac44deb77fffd22ad933824c` | -| `PromiseNotResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0xbcf0d0c678940566e9e64f0c871439395bd5fb5c39bca3547b126fe6ee467937` | -| `PromiseResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0x1b1b5810494fb3e17f7c46547e6e67cd6ad3e6001ea6fb7d12ea0241ba13c4ba` | +| Event | Arguments | Topic | +| -------------------- | ------------------------------------------------ | -------------------------------------------------------------------- | +| `MarkedRevert` | `(payloadId: bytes32, isRevertingOnchain: bool)` | `0xcf1fd844cb4d32cbebb5ca6ce4ac834fe98da3ddac44deb77fffd22ad933824c` | +| `PromiseNotResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0xbcf0d0c678940566e9e64f0c871439395bd5fb5c39bca3547b126fe6ee467937` | +| `PromiseResolved` | `(payloadId: bytes32, asyncPromise: address)` | `0x1b1b5810494fb3e17f7c46547e6e67cd6ad3e6001ea6fb7d12ea0241ba13c4ba` | ## RequestHandler -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `FeesIncreased` | `(requestCount: uint40, newMaxFees: uint256)` | `0xf258fca4e49b803ee2a4c2e33b6fcf18bc3982df21f111c00677025bf1ccbb6a` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RequestCancelled` | `(requestCount: uint40)` | `0xff191657769be72fc08def44c645014c60d18cb24b9ca05c9a33406a28253245` | -| `RequestCompletedWithErrors` | `(requestCount: uint40)` | `0xd8d9915dc14b5a29b66cb263e1ea1e99e60418fc21d97f0fbf09cae1281291e2` | -| `RequestSettled` | `(requestCount: uint40, winner: address)` | `0x1234f98acbe1548b214f4528461a5377f1e2349569c04caa59325e488e7d2aa4` | -| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0xb730ca5523e3f80e88b4bb71e1e78d447553069cd9a7143bb0032b957135b530` | +| Event | Arguments | Topic | +| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `FeesIncreased` | `(requestCount: uint40, newMaxFees: uint256)` | `0xf258fca4e49b803ee2a4c2e33b6fcf18bc3982df21f111c00677025bf1ccbb6a` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RequestCancelled` | `(requestCount: uint40)` | `0xff191657769be72fc08def44c645014c60d18cb24b9ca05c9a33406a28253245` | +| `RequestCompletedWithErrors` | `(requestCount: uint40)` | `0xd8d9915dc14b5a29b66cb263e1ea1e99e60418fc21d97f0fbf09cae1281291e2` | +| `RequestSettled` | `(requestCount: uint40, winner: address)` | `0x1234f98acbe1548b214f4528461a5377f1e2349569c04caa59325e488e7d2aa4` | +| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0xb730ca5523e3f80e88b4bb71e1e78d447553069cd9a7143bb0032b957135b530` | ## Watcher -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | -| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | -| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | -| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | +| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | +| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | +| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | +| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | ## IMessageSwitchboard @@ -242,72 +242,71 @@ ## CCTPSwitchboard -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ---------------------------- | ----------------------------------------- | -------------------------------------------------------------------- | +| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## FastSwitchboard -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| Event | Arguments | Topic | +| ---------------------------- | ----------------------------------------- | -------------------------------------------------------------------- | +| `Attested` | `(payloadId_: bytes32, watcher: address)` | `0x3d83c7bc55c269e0bc853ddc0d7b9fca30216ecc43779acb4e36b7e0ad1c71e4` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | ## MessageSwitchboard -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `Attested` | `(payloadId: bytes32, digest: bytes32, watcher: address)` | `0x2f8e66b1207a4b70274a2a3da88ffb5737c8214576490da1b35acc38b2d62db6` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `SiblingConfigSet` | `(chainSlug: uint32, fee: uint256, socket: bytes32, switchboard: bytes32)` | `0xc34c3d0f0300f406c0f0608f6f6d70b36f5e90ccd1f1e1065bbe899f64cc81f0` | -| `SiblingRegistered` | `(chainSlug: uint32, plugAddress: address, siblingPlug: bytes32)` | `0xbb232aa6c0cb95b30a887c06b678538c818d3eac0dfd4d83299a18867cae220b` | -| `SwitchboardFeesSet` | `(chainSlug: uint32, feeAmount: uint256)` | `0x5e544c79c5017ebf2ea6aa546cd1c37272d5b4335247f0ceaabef51903dc5260` | -| `TriggerProcessed` | `(dstChainSlug: uint32, switchboardFees: uint256, digest: bytes32, digestParams: tuple)` | `0x0d585f64e2ebf6cc2b04ccbbaf63459f3b52c84111559988d28d6872185caa32` | +| Event | Arguments | Topic | +| ---------------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Attested` | `(payloadId: bytes32, digest: bytes32, watcher: address)` | `0x2f8e66b1207a4b70274a2a3da88ffb5737c8214576490da1b35acc38b2d62db6` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `SiblingConfigSet` | `(chainSlug: uint32, fee: uint256, socket: bytes32, switchboard: bytes32)` | `0xc34c3d0f0300f406c0f0608f6f6d70b36f5e90ccd1f1e1065bbe899f64cc81f0` | +| `SiblingRegistered` | `(chainSlug: uint32, plugAddress: address, siblingPlug: bytes32)` | `0xbb232aa6c0cb95b30a887c06b678538c818d3eac0dfd4d83299a18867cae220b` | +| `SwitchboardFeesSet` | `(chainSlug: uint32, feeAmount: uint256)` | `0x5e544c79c5017ebf2ea6aa546cd1c37272d5b4335247f0ceaabef51903dc5260` | +| `TriggerProcessed` | `(dstChainSlug: uint32, switchboardFees: uint256, digest: bytes32, digestParams: tuple)` | `0x0d585f64e2ebf6cc2b04ccbbaf63459f3b52c84111559988d28d6872185caa32` | ## ReadPrecompile -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `ReadFeesSet` | `(readFees: uint256)` | `0xc674cb6dde3a59f84dbf226832e606ffc54ac8a169e1568fc834c7813010f926` | +| Event | Arguments | Topic | +| --------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `ReadFeesSet` | `(readFees: uint256)` | `0xc674cb6dde3a59f84dbf226832e606ffc54ac8a169e1568fc834c7813010f926` | | `ReadRequested` | `(transaction: tuple, readAtBlockNumber: uint256, payloadId: bytes32)` | `0xbcad63ac625c0f3cb23b62b126567728fcf5950ca8e559150e764eced73e794a` | ## SchedulePrecompile -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | -| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | -| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | -| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256)` | `0xd099d3e3d0f0e2c9c40e0066affeea125aab71d763b7ab0a279ccec3dff70b64` | -| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | +| Event | Arguments | Topic | +| ------------------------------ | ---------------------------------------------------------------- | -------------------------------------------------------------------- | +| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | +| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | +| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | +| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256)` | `0xd099d3e3d0f0e2c9c40e0066affeea125aab71d763b7ab0a279ccec3dff70b64` | +| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | ## WritePrecompile -| Event | Arguments | Topic | -| ----- | --------- | ----- | -| `ChainMaxMsgValueLimitsUpdated` | `(chainSlug: uint32, maxMsgValueLimit: uint256)` | `0x439087d094fe7dacbba3f0c67032041952d8bd58a891e15af10ced28fed0eb91` | -| `ContractFactoryPlugSet` | `(chainSlug: uint32, contractFactoryPlug: bytes32)` | `0xfad552a6feb82bef23201b8dce04b2460bff41b00f26fef3d791572cfdab49c2` | -| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `FeesSet` | `(writeFees: uint256)` | `0x3346af6da1932164d501f2ec28f8c5d686db5828a36b77f2da4332d89184fe7b` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `WriteProofRequested` | `(transmitter: address, digest: bytes32, prevBatchDigestHash: bytes32, deadline: uint256, payloadParams: tuple)` | `0xe3e3e322b3c2964670f4b62d06647c2f711440be782105fc1c0a60cc934bb40a` | -| `WriteProofUploaded` | `(payloadId: bytes32, proof: bytes)` | `0xd8fe3a99a88c9630360418877afdf14e3e79f0f25fee162aeb230633ea740156` | - +| Event | Arguments | Topic | +| ------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `ChainMaxMsgValueLimitsUpdated` | `(chainSlug: uint32, maxMsgValueLimit: uint256)` | `0x439087d094fe7dacbba3f0c67032041952d8bd58a891e15af10ced28fed0eb91` | +| `ContractFactoryPlugSet` | `(chainSlug: uint32, contractFactoryPlug: bytes32)` | `0xfad552a6feb82bef23201b8dce04b2460bff41b00f26fef3d791572cfdab49c2` | +| `ExpiryTimeSet` | `(expiryTime: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `FeesSet` | `(writeFees: uint256)` | `0x3346af6da1932164d501f2ec28f8c5d686db5828a36b77f2da4332d89184fe7b` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `WriteProofRequested` | `(transmitter: address, digest: bytes32, prevBatchDigestHash: bytes32, deadline: uint256, payloadParams: tuple)` | `0xe3e3e322b3c2964670f4b62d06647c2f711440be782105fc1c0a60cc934bb40a` | +| `WriteProofUploaded` | `(payloadId: bytes32, proof: bytes)` | `0xd8fe3a99a88c9630360418877afdf14e3e79f0f25fee162aeb230633ea740156` | diff --git a/FunctionSignatures.md b/FunctionSignatures.md index 479abe1e..fc6866b7 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -2,642 +2,641 @@ ## AuctionManager -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `auctionEndDelaySeconds` | `0x9087dfdb` | -| `auctionManager` | `0xb0192f9a` | -| `auctionStatus` | `0xd7d5fbf6` | -| `bid` | `0xfcdf49c2` | -| `bidTimeout` | `0x94090d0b` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `consumeFrom` | `0x40dd78be` | -| `creationCodeWithArgs` | `0xc126dcc4` | -| `deployForwarder__` | `0xd4e3b034` | -| `endAuction` | `0x1212e653` | -| `evmxSlug` | `0x8bae77c2` | -| `expireBid` | `0x1dd5022c` | -| `feesManager__` | `0x70568b58` | -| `forwarderAddresses` | `0x5390fdcb` | -| `getOnChainAddress` | `0xb6abffd7` | -| `getOverrideParams` | `0x54f0a866` | -| `grantRole` | `0x2f2ff15d` | -| `handleRevert` | `0x44792f25` | -| `hasRole` | `0x91d14854` | -| `initialize` | `0x86891c9b` | -| `initializeOnChain` | `0x86f01739` | -| `isAsyncModifierSet` | `0xb69e0c4a` | -| `isValidPromise` | `0xb690b962` | -| `maxFees` | `0xe83e34b1` | -| `maxReAuctionCount` | `0xc367b376` | -| `onCompleteData` | `0xb52fa926` | -| `onDeployComplete` | `0xfa3dbd1e` | -| `overrideParams` | `0xec5490fe` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `auctionEndDelaySeconds` | `0x9087dfdb` | +| `auctionManager` | `0xb0192f9a` | +| `auctionStatus` | `0xd7d5fbf6` | +| `bid` | `0xfcdf49c2` | +| `bidTimeout` | `0x94090d0b` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `consumeFrom` | `0x40dd78be` | +| `creationCodeWithArgs` | `0xc126dcc4` | +| `deployForwarder__` | `0xd4e3b034` | +| `endAuction` | `0x1212e653` | +| `evmxSlug` | `0x8bae77c2` | +| `expireBid` | `0x1dd5022c` | +| `feesManager__` | `0x70568b58` | +| `forwarderAddresses` | `0x5390fdcb` | +| `getOnChainAddress` | `0xb6abffd7` | +| `getOverrideParams` | `0x54f0a866` | +| `grantRole` | `0x2f2ff15d` | +| `handleRevert` | `0x44792f25` | +| `hasRole` | `0x91d14854` | +| `initialize` | `0x86891c9b` | +| `initializeOnChain` | `0x86f01739` | +| `isAsyncModifierSet` | `0xb69e0c4a` | +| `isValidPromise` | `0xb690b962` | +| `maxFees` | `0xe83e34b1` | +| `maxReAuctionCount` | `0xc367b376` | +| `onCompleteData` | `0xb52fa926` | +| `onDeployComplete` | `0xfa3dbd1e` | +| `overrideParams` | `0xec5490fe` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `reAuctionCount` | `0x9b4b22d3` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `sbType` | `0x745de344` | -| `setAddress` | `0x85bf312c` | -| `setAuctionEndDelaySeconds` | `0x88606b1a` | -| `setMaxReAuctionCount` | `0x64c71403` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | -| `winningBids` | `0x9133f232` | +| `reAuctionCount` | `0x9b4b22d3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `sbType` | `0x745de344` | +| `setAddress` | `0x85bf312c` | +| `setAuctionEndDelaySeconds` | `0x88606b1a` | +| `setMaxReAuctionCount` | `0x64c71403` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | +| `winningBids` | `0x9133f232` | ## Socket -| Function | Signature | -| -------- | --------- | -| `OFF_CHAIN_CALLER` | `0xcb2cb4f6` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `connect` | `0xf3aebe4d` | -| `disableSwitchboard` | `0x25e94caf` | -| `disconnect` | `0xd9374bff` | -| `enableSwitchboard` | `0xea072f06` | -| `execute` | `0x2e4d89fb` | -| `gasLimitBuffer` | `0xe4d728f0` | -| `getPlugConfig` | `0xf9778ee0` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isValidSwitchboard` | `0xb30fe8ff` | -| `maxCopyBytes` | `0x212249d4` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `OFF_CHAIN_CALLER` | `0xcb2cb4f6` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `connect` | `0xf3aebe4d` | +| `disableSwitchboard` | `0x25e94caf` | +| `disconnect` | `0xd9374bff` | +| `enableSwitchboard` | `0xea072f06` | +| `execute` | `0x2e4d89fb` | +| `gasLimitBuffer` | `0xe4d728f0` | +| `getPlugConfig` | `0xf9778ee0` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isValidSwitchboard` | `0xb30fe8ff` | +| `maxCopyBytes` | `0x212249d4` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadExecuted` | `0x3eaeac3d` | -| `payloadIdToDigest` | `0x7c8552b2` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setGasLimitBuffer` | `0x1f0cfa78` | -| `setMaxCopyBytes` | `0x4fc7d6e9` | -| `setSocketFeeManager` | `0x25bd97e5` | -| `simulate` | `0x91bf8275` | -| `socketFeeManager` | `0xde5b8838` | -| `switchboardAddresses` | `0x9cf0af93` | -| `switchboardIdCounter` | `0x5f850dfd` | -| `switchboardIds` | `0x91db23d3` | -| `transferOwnership` | `0xf2fde38b` | -| `triggerAppGateway` | `0x29e654e1` | -| `triggerCounter` | `0x8b0021de` | -| `version` | `0x54fd4d50` | +| `payloadExecuted` | `0x3eaeac3d` | +| `payloadIdToDigest` | `0x7c8552b2` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setGasLimitBuffer` | `0x1f0cfa78` | +| `setMaxCopyBytes` | `0x4fc7d6e9` | +| `setSocketFeeManager` | `0x25bd97e5` | +| `simulate` | `0x91bf8275` | +| `socketFeeManager` | `0xde5b8838` | +| `switchboardAddresses` | `0x9cf0af93` | +| `switchboardIdCounter` | `0x5f850dfd` | +| `switchboardIds` | `0x91db23d3` | +| `transferOwnership` | `0xf2fde38b` | +| `triggerAppGateway` | `0x29e654e1` | +| `triggerCounter` | `0x8b0021de` | +| `version` | `0x54fd4d50` | ## SocketFeeManager -| Function | Signature | -| -------- | --------- | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getMinSocketFees` | `0xd383b688` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getMinSocketFees` | `0xd383b688` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payAndCheckFees` | `0x0b2b48ed` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setSocketFees` | `0x47a406f6` | -| `socketFees` | `0xab1b33a8` | -| `transferOwnership` | `0xf2fde38b` | +| `payAndCheckFees` | `0x0b2b48ed` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setSocketFees` | `0x47a406f6` | +| `socketFees` | `0xab1b33a8` | +| `transferOwnership` | `0xf2fde38b` | ## FeesManager -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `approveAppGateway` | `0xa3b53d8b` | +| Function | Signature | +| -------------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `approveAppGateway` | `0xa3b53d8b` | | `approveAppGatewayWithSignature` | `0x94b649ec` | -| `approveAppGateways` | `0x86d23ab2` | -| `asyncDeployer__` | `0x2a39e801` | -| `auctionManager` | `0xb0192f9a` | -| `blockCredits` | `0x9e434307` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `consumeFrom` | `0x40dd78be` | -| `creationCodeWithArgs` | `0xc126dcc4` | -| `deployForwarder__` | `0xd4e3b034` | -| `deposit` | `0x5671d329` | -| `deprecatedSbType` | `0x5a783900` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `feesPlugs` | `0x23f5ee8a` | -| `feesPool` | `0x6b259690` | -| `forwarderAddresses` | `0x5390fdcb` | -| `getAvailableCredits` | `0xb065a8e5` | -| `getOnChainAddress` | `0xb6abffd7` | -| `getOverrideParams` | `0x54f0a866` | -| `handleRevert` | `0x44792f25` | -| `initialize` | `0xbf2c8539` | -| `initializeOnChain` | `0x86f01739` | -| `isApproved` | `0xa389783e` | -| `isAsyncModifierSet` | `0xb69e0c4a` | -| `isCreditSpendable` | `0x4f8990fd` | -| `isNonceUsed` | `0xcab7e8eb` | -| `isValidPromise` | `0xb690b962` | -| `maxFees` | `0xe83e34b1` | -| `onCompleteData` | `0xb52fa926` | -| `onDeployComplete` | `0xfa3dbd1e` | -| `overrideParams` | `0xec5490fe` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestBlockedCredits` | `0xb62d25ac` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `sbType` | `0x745de344` | -| `setAddress` | `0x85bf312c` | -| `setFeesPlug` | `0xd6a9a8b7` | -| `setFeesPool` | `0xd6684588` | -| `tokenOnChainBalances` | `0x3b27866d` | -| `transferCredits` | `0xf1686c89` | -| `transferOwnership` | `0xf2fde38b` | -| `unblockAndAssignCredits` | `0x01958181` | -| `unblockCredits` | `0xa0b32314` | -| `unwrap` | `0x7647691d` | -| `userCredits` | `0x20babb92` | -| `watcher__` | `0x300bb063` | -| `withdrawCredits` | `0xcfc6dbd9` | -| `wrap` | `0x023276f0` | +| `approveAppGateways` | `0x86d23ab2` | +| `asyncDeployer__` | `0x2a39e801` | +| `auctionManager` | `0xb0192f9a` | +| `blockCredits` | `0x9e434307` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `consumeFrom` | `0x40dd78be` | +| `creationCodeWithArgs` | `0xc126dcc4` | +| `deployForwarder__` | `0xd4e3b034` | +| `deposit` | `0x5671d329` | +| `deprecatedSbType` | `0x5a783900` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `feesPlugs` | `0x23f5ee8a` | +| `feesPool` | `0x6b259690` | +| `forwarderAddresses` | `0x5390fdcb` | +| `getAvailableCredits` | `0xb065a8e5` | +| `getOnChainAddress` | `0xb6abffd7` | +| `getOverrideParams` | `0x54f0a866` | +| `handleRevert` | `0x44792f25` | +| `initialize` | `0xbf2c8539` | +| `initializeOnChain` | `0x86f01739` | +| `isApproved` | `0xa389783e` | +| `isAsyncModifierSet` | `0xb69e0c4a` | +| `isCreditSpendable` | `0x4f8990fd` | +| `isNonceUsed` | `0xcab7e8eb` | +| `isValidPromise` | `0xb690b962` | +| `maxFees` | `0xe83e34b1` | +| `onCompleteData` | `0xb52fa926` | +| `onDeployComplete` | `0xfa3dbd1e` | +| `overrideParams` | `0xec5490fe` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestBlockedCredits` | `0xb62d25ac` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `sbType` | `0x745de344` | +| `setAddress` | `0x85bf312c` | +| `setFeesPlug` | `0xd6a9a8b7` | +| `setFeesPool` | `0xd6684588` | +| `tokenOnChainBalances` | `0x3b27866d` | +| `transferCredits` | `0xf1686c89` | +| `transferOwnership` | `0xf2fde38b` | +| `unblockAndAssignCredits` | `0x01958181` | +| `unblockCredits` | `0xa0b32314` | +| `unwrap` | `0x7647691d` | +| `userCredits` | `0x20babb92` | +| `watcher__` | `0x300bb063` | +| `withdrawCredits` | `0xcfc6dbd9` | +| `wrap` | `0x023276f0` | ## FeesPool -| Function | Signature | -| -------- | --------- | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getBalance` | `0x12065fe0` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getBalance` | `0x12065fe0` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `revokeRole` | `0xd547741f` | -| `transferOwnership` | `0xf2fde38b` | -| `withdraw` | `0xf3fef3a3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `revokeRole` | `0xd547741f` | +| `transferOwnership` | `0xf2fde38b` | +| `withdraw` | `0xf3fef3a3` | ## AddressResolver -| Function | Signature | -| -------- | --------- | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `contractAddresses` | `0xf689e892` | -| `defaultAuctionManager` | `0x8f27cdc6` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0xc4d66de8` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `contractAddresses` | `0xf689e892` | +| `defaultAuctionManager` | `0x8f27cdc6` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0xc4d66de8` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setAsyncDeployer` | `0xcb0ffff8` | -| `setContractAddress` | `0xe001f841` | -| `setDefaultAuctionManager` | `0xede8b4b5` | -| `setDeployForwarder` | `0xaeaee8a6` | -| `setFeesManager` | `0x1c89382a` | -| `setWatcher` | `0x24f48bc5` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setAsyncDeployer` | `0xcb0ffff8` | +| `setContractAddress` | `0xe001f841` | +| `setDefaultAuctionManager` | `0xede8b4b5` | +| `setDeployForwarder` | `0xaeaee8a6` | +| `setFeesManager` | `0x1c89382a` | +| `setWatcher` | `0x24f48bc5` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncDeployer -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `asyncPromiseBeacon` | `0xc0fbc0ef` | -| `asyncPromiseCounter` | `0x97cdbf4c` | -| `asyncPromiseImplementation` | `0x59531b8d` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployAsyncPromiseContract` | `0x9851be0b` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `forwarderBeacon` | `0x945709ae` | -| `forwarderImplementation` | `0xe38d60a1` | -| `getAsyncPromiseAddress` | `0x104f39b4` | -| `getForwarderAddress` | `0x9c038b01` | -| `getOrDeployForwarderContract` | `0xe9bf1edf` | -| `initialize` | `0x485cc955` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| ------------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `asyncPromiseBeacon` | `0xc0fbc0ef` | +| `asyncPromiseCounter` | `0x97cdbf4c` | +| `asyncPromiseImplementation` | `0x59531b8d` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployAsyncPromiseContract` | `0x9851be0b` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `forwarderBeacon` | `0x945709ae` | +| `forwarderImplementation` | `0xe38d60a1` | +| `getAsyncPromiseAddress` | `0x104f39b4` | +| `getForwarderAddress` | `0x9c038b01` | +| `getOrDeployForwarderContract` | `0xe9bf1edf` | +| `initialize` | `0x485cc955` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | | `setAsyncPromiseImplementation` | `0xeb506eab` | -| `setForwarderImplementation` | `0x83b1e974` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `setForwarderImplementation` | `0x83b1e974` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncPromise -| Function | Signature | -| -------- | --------- | +| Function | Signature | +| ------------------- | ------------ | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `callbackData` | `0xef44c272` | -| `callbackSelector` | `0x2764f92f` | +| `asyncDeployer__` | `0x2a39e801` | +| `callbackData` | `0xef44c272` | +| `callbackSelector` | `0x2764f92f` | | `deployForwarder__` | `0xd4e3b034` | -| `exceededMaxCopy` | `0xaf598c7c` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x0ece6089` | -| `localInvoker` | `0x45eb87f4` | +| `exceededMaxCopy` | `0xaf598c7c` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x0ece6089` | +| `localInvoker` | `0x45eb87f4` | | `markOnchainRevert` | `0xd0e7af1b` | -| `markResolved` | `0x822d5d1f` | -| `requestCount` | `0x5badbe4c` | -| `rescueFunds` | `0x6ccae054` | -| `returnData` | `0xebddbaf6` | -| `state` | `0xc19d93fb` | -| `then` | `0x0bf2ba15` | -| `watcher__` | `0x300bb063` | +| `markResolved` | `0x822d5d1f` | +| `requestCount` | `0x5badbe4c` | +| `rescueFunds` | `0x6ccae054` | +| `returnData` | `0xebddbaf6` | +| `state` | `0xc19d93fb` | +| `then` | `0x0bf2ba15` | +| `watcher__` | `0x300bb063` | ## DeployForwarder -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deploy` | `0x940f11af` | -| `deployForwarder__` | `0xd4e3b034` | -| `deployerSwitchboardType` | `0xaa381f9a` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x6133f985` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deploy` | `0x940f11af` | +| `deployForwarder__` | `0xd4e3b034` | +| `deployerSwitchboardType` | `0xaa381f9a` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x6133f985` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `saltCounter` | `0xa04c6809` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `saltCounter` | `0xa04c6809` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## Forwarder -| Function | Signature | -| -------- | --------- | +| Function | Signature | +| ------------------- | ------------ | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `chainSlug` | `0xb349ba65` | +| `asyncDeployer__` | `0x2a39e801` | +| `chainSlug` | `0xb349ba65` | | `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getChainSlug` | `0x0b8c6568` | +| `feesManager__` | `0x70568b58` | +| `getChainSlug` | `0x0b8c6568` | | `getOnChainAddress` | `0x9da48789` | -| `initialize` | `0x148841cb` | -| `onChainAddress` | `0x8bd0b363` | -| `rescueFunds` | `0x6ccae054` | -| `watcher__` | `0x300bb063` | +| `initialize` | `0x148841cb` | +| `onChainAddress` | `0x8bd0b363` | +| `rescueFunds` | `0x6ccae054` | +| `watcher__` | `0x300bb063` | ## ProxyFactory -| Function | Signature | -| -------- | --------- | -| `adminOf` | `0x2abbef15` | -| `changeAdmin` | `0x1acfd02a` | -| `deploy` | `0x545e7c61` | -| `deployAndCall` | `0x4314f120` | -| `deployDeterministic` | `0x3729f922` | -| `deployDeterministicAndCall` | `0xa97b90d5` | -| `initCodeHash` | `0xdb4c545e` | +| Function | Signature | +| ----------------------------- | ------------ | +| `adminOf` | `0x2abbef15` | +| `changeAdmin` | `0x1acfd02a` | +| `deploy` | `0x545e7c61` | +| `deployAndCall` | `0x4314f120` | +| `deployDeterministic` | `0x3729f922` | +| `deployDeterministicAndCall` | `0xa97b90d5` | +| `initCodeHash` | `0xdb4c545e` | | `predictDeterministicAddress` | `0x5414dff0` | -| `upgrade` | `0x99a88ec4` | -| `upgradeAndCall` | `0x9623609d` | +| `upgrade` | `0x99a88ec4` | +| `upgradeAndCall` | `0x9623609d` | ## TestUSDC -| Function | Signature | -| -------- | --------- | +| Function | Signature | +| ------------------ | ------------ | | `DOMAIN_SEPARATOR` | `0x3644e515` | -| `allowance` | `0xdd62ed3e` | -| `approve` | `0x095ea7b3` | -| `balanceOf` | `0x70a08231` | -| `decimals` | `0x313ce567` | -| `mint` | `0x40c10f19` | -| `name` | `0x06fdde03` | -| `nonces` | `0x7ecebe00` | -| `owner` | `0x8da5cb5b` | -| `permit` | `0xd505accf` | -| `symbol` | `0x95d89b41` | -| `totalSupply` | `0x18160ddd` | -| `transfer` | `0xa9059cbb` | -| `transferFrom` | `0x23b872dd` | +| `allowance` | `0xdd62ed3e` | +| `approve` | `0x095ea7b3` | +| `balanceOf` | `0x70a08231` | +| `decimals` | `0x313ce567` | +| `mint` | `0x40c10f19` | +| `name` | `0x06fdde03` | +| `nonces` | `0x7ecebe00` | +| `owner` | `0x8da5cb5b` | +| `permit` | `0xd505accf` | +| `symbol` | `0x95d89b41` | +| `totalSupply` | `0x18160ddd` | +| `transfer` | `0xa9059cbb` | +| `transferFrom` | `0x23b872dd` | ## ContractFactoryPlug -| Function | Signature | -| -------- | --------- | -| `appGatewayId` | `0x1c335f49` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `connectSocket` | `0x943103c3` | -| `deployContract` | `0xff8caf37` | -| `getAddress` | `0x94ca2cb5` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `initSocket` | `0x18b7ff72` | -| `isSocketInitialized` | `0x9a7d9a9b` | -| `overrides` | `0x4a85f041` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `appGatewayId` | `0x1c335f49` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `connectSocket` | `0x943103c3` | +| `deployContract` | `0xff8caf37` | +| `getAddress` | `0x94ca2cb5` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `initSocket` | `0x18b7ff72` | +| `isSocketInitialized` | `0x9a7d9a9b` | +| `overrides` | `0x4a85f041` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## Configurations -| Function | Signature | -| -------- | --------- | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getPlugConfigs` | `0x25945c1a` | -| `initialize` | `0x485cc955` | -| `isValidPlug` | `0x00f9b9f4` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getPlugConfigs` | `0x25945c1a` | +| `initialize` | `0x485cc955` | +| `isValidPlug` | `0x00f9b9f4` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setAppGatewayConfigs` | `0x831c8195` | -| `setIsValidPlug` | `0x4842c37a` | -| `setSocket` | `0x38d4de67` | -| `setSwitchboard` | `0x4fc059a0` | -| `sockets` | `0xb44a23ab` | -| `switchboards` | `0xaa539546` | -| `transferOwnership` | `0xf2fde38b` | -| `verifyConnections` | `0x36cb19fb` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setAppGatewayConfigs` | `0x831c8195` | +| `setIsValidPlug` | `0x4842c37a` | +| `setSocket` | `0x38d4de67` | +| `setSwitchboard` | `0x4fc059a0` | +| `sockets` | `0xb44a23ab` | +| `switchboards` | `0xaa539546` | +| `transferOwnership` | `0xf2fde38b` | +| `verifyConnections` | `0x36cb19fb` | +| `watcher__` | `0x300bb063` | ## PromiseResolver -| Function | Signature | -| -------- | --------- | -| `markRevert` | `0x56501015` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| ----------------- | ------------ | +| `markRevert` | `0x56501015` | +| `rescueFunds` | `0x6ccae054` | | `resolvePromises` | `0xbf8484b8` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## RequestHandler -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `assignTransmitter` | `0xae5e9c48` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x3b5fd6fb` | -| `cancelRequestForReverts` | `0x82970278` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getBatchPayloadIds` | `0xfd83cd1f` | -| `getPayload` | `0xb48fd0fe` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequest` | `0xcf39abf6` | -| `getRequestBatchIds` | `0xe138fadb` | -| `handleRevert` | `0xcc88d3f9` | -| `increaseFees` | `0x10205541` | -| `initialize` | `0x485cc955` | -| `nextBatchCount` | `0x333a3963` | -| `nextRequestCount` | `0xfef72893` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadCounter` | `0x550ce1d5` | -| `precompiles` | `0x9932450b` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setPrecompile` | `0x122e0042` | -| `setRequestPayloadCountLimit` | `0x8526582b` | -| `submitRequest` | `0xf91ba7cc` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| ------------------------------ | ------------ | +| `addressResolver__` | `0x6a750469` | +| `assignTransmitter` | `0xae5e9c48` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x3b5fd6fb` | +| `cancelRequestForReverts` | `0x82970278` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `getBatchPayloadIds` | `0xfd83cd1f` | +| `getPayload` | `0xb48fd0fe` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequest` | `0xcf39abf6` | +| `getRequestBatchIds` | `0xe138fadb` | +| `handleRevert` | `0xcc88d3f9` | +| `increaseFees` | `0x10205541` | +| `initialize` | `0x485cc955` | +| `nextBatchCount` | `0x333a3963` | +| `nextRequestCount` | `0xfef72893` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `payloadCounter` | `0x550ce1d5` | +| `precompiles` | `0x9932450b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setPrecompile` | `0x122e0042` | +| `setRequestPayloadCountLimit` | `0x8526582b` | +| `submitRequest` | `0xf91ba7cc` | +| `transferOwnership` | `0xf2fde38b` | | `updateRequestAndProcessBatch` | `0x46464471` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## Watcher -| Function | Signature | -| -------- | --------- | -| `addressResolver__` | `0x6a750469` | -| `appGatewayTemp` | `0x1394c029` | -| `asyncDeployer__` | `0x2a39e801` | -| `callAppGateways` | `0x0050bef1` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x50ad0779` | -| `clearQueue` | `0xf22cb874` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `configurations__` | `0x52a3bbeb` | -| `deployForwarder__` | `0xd4e3b034` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `getCurrentRequestCount` | `0x5715abbb` | -| `getPayloadParams` | `0xae5eeb77` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequestParams` | `0x71263d0d` | -| `increaseFees` | `0xe9b304da` | -| `initialize` | `0xaaf7fc1a` | -| `isAppGatewayCalled` | `0xa79da6c7` | -| `isNonceUsed` | `0x5d00bb12` | -| `isWatcher` | `0x84785ecd` | -| `latestAsyncPromise` | `0xb8a8ba52` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `appGatewayTemp` | `0x1394c029` | +| `asyncDeployer__` | `0x2a39e801` | +| `callAppGateways` | `0x0050bef1` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x50ad0779` | +| `clearQueue` | `0xf22cb874` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `configurations__` | `0x52a3bbeb` | +| `deployForwarder__` | `0xd4e3b034` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `getCurrentRequestCount` | `0x5715abbb` | +| `getPayloadParams` | `0xae5eeb77` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequestParams` | `0x71263d0d` | +| `increaseFees` | `0xe9b304da` | +| `initialize` | `0xaaf7fc1a` | +| `isAppGatewayCalled` | `0xa79da6c7` | +| `isNonceUsed` | `0x5d00bb12` | +| `isWatcher` | `0x84785ecd` | +| `latestAsyncPromise` | `0xb8a8ba52` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadQueue` | `0x74f00ffb` | -| `promiseResolver__` | `0xdee152be` | -| `queue` | `0x65967f1a` | -| `queueAndSubmit` | `0x9d4c9df7` | -| `renounceOwnership` | `0x715018a6` | -| `requestHandler__` | `0x55184561` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0xa58c6fc5` | -| `setCoreContracts` | `0xefa891c4` | -| `setIsValidPlug` | `0x06c0a40a` | -| `setTriggerFees` | `0xaeb30511` | -| `submitRequest` | `0x4890b5ef` | -| `transferOwnership` | `0xf2fde38b` | -| `triggerFees` | `0x73f76aec` | -| `triggerFromChainSlug` | `0xd12b4f12` | -| `triggerFromPlug` | `0x3b847d12` | -| `watcherMultiCall` | `0x8021e82b` | -| `watcher__` | `0x300bb063` | +| `payloadQueue` | `0x74f00ffb` | +| `promiseResolver__` | `0xdee152be` | +| `queue` | `0x65967f1a` | +| `queueAndSubmit` | `0x9d4c9df7` | +| `renounceOwnership` | `0x715018a6` | +| `requestHandler__` | `0x55184561` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0xa58c6fc5` | +| `setCoreContracts` | `0xefa891c4` | +| `setIsValidPlug` | `0x06c0a40a` | +| `setTriggerFees` | `0xaeb30511` | +| `submitRequest` | `0x4890b5ef` | +| `transferOwnership` | `0xf2fde38b` | +| `triggerFees` | `0x73f76aec` | +| `triggerFromChainSlug` | `0xd12b4f12` | +| `triggerFromPlug` | `0x3b847d12` | +| `watcherMultiCall` | `0x8021e82b` | +| `watcher__` | `0x300bb063` | ## CCTPSwitchboard -| Function | Signature | -| -------- | --------- | -| `addRemoteEndpoint` | `0x7d396da5` | -| `allowPacket` | `0x21e9ec80` | -| `allowPayload` | `0x31c23f66` | -| `attest` | `0x63671b60` | +| Function | Signature | +| -------------------------------- | ------------ | +| `addRemoteEndpoint` | `0x7d396da5` | +| `allowPacket` | `0x21e9ec80` | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x63671b60` | | `attestVerifyAndProveExecutions` | `0x6c913e2f` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `chainSlugToRemoteEndpoint` | `0xa4500424` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `domainToRemoteEndpoint` | `0xc24964fe` | -| `getTransmitter` | `0x73e7d880` | -| `grantRole` | `0x2f2ff15d` | -| `handleReceiveMessage` | `0x96abeb70` | -| `hasRole` | `0x91d14854` | -| `isAttested` | `0xc13c2396` | -| `isRemoteExecuted` | `0x0cd97747` | -| `isSyncedOut` | `0x5ae5dfd6` | -| `messageTransmitter` | `0x7b04c181` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `processTrigger` | `0x7f3352bc` | -| `proveRemoteExecutions` | `0x893289f8` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `remoteExecutedDigests` | `0xecbf77d9` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `switchboardId` | `0xd3be4120` | -| `syncOut` | `0x69a60ff0` | -| `transferOwnership` | `0xf2fde38b` | -| `verifyAttestations` | `0x6f30514c` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `chainSlugToRemoteEndpoint` | `0xa4500424` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `domainToRemoteEndpoint` | `0xc24964fe` | +| `getTransmitter` | `0x73e7d880` | +| `grantRole` | `0x2f2ff15d` | +| `handleReceiveMessage` | `0x96abeb70` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `isRemoteExecuted` | `0x0cd97747` | +| `isSyncedOut` | `0x5ae5dfd6` | +| `messageTransmitter` | `0x7b04c181` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `processTrigger` | `0x7f3352bc` | +| `proveRemoteExecutions` | `0x893289f8` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `remoteExecutedDigests` | `0xecbf77d9` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `switchboardId` | `0xd3be4120` | +| `syncOut` | `0x69a60ff0` | +| `transferOwnership` | `0xf2fde38b` | +| `verifyAttestations` | `0x6f30514c` | ## FastSwitchboard -| Function | Signature | -| -------- | --------- | -| `allowPayload` | `0x31c23f66` | -| `attest` | `0x63671b60` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getTransmitter` | `0x73e7d880` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isAttested` | `0xc13c2396` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x63671b60` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getTransmitter` | `0x73e7d880` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `processTrigger` | `0x7f3352bc` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `switchboardId` | `0xd3be4120` | -| `transferOwnership` | `0xf2fde38b` | +| `processTrigger` | `0x7f3352bc` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `switchboardId` | `0xd3be4120` | +| `transferOwnership` | `0xf2fde38b` | ## MessageSwitchboard -| Function | Signature | -| -------- | --------- | -| `allowPayload` | `0x31c23f66` | -| `attest` | `0x4cc621d2` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getSwitchboardFees` | `0x99de43bf` | -| `getTransmitter` | `0x73e7d880` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isAttested` | `0xc13c2396` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| ---------------------------- | ------------ | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x4cc621d2` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getSwitchboardFees` | `0x99de43bf` | +| `getTransmitter` | `0x73e7d880` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadCounter` | `0x550ce1d5` | -| `processTrigger` | `0x7f3352bc` | -| `registerSibling` | `0x4f58b88c` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setSiblingConfig` | `0xacfbfc03` | -| `setSwitchboardFees` | `0x476bfc49` | -| `siblingPlugs` | `0x25fc3bcc` | -| `siblingSockets` | `0xce3483a5` | -| `siblingSwitchboards` | `0x51de49c9` | -| `socket__` | `0xc6a261d2` | -| `switchboardFees` | `0xb2a71ee7` | -| `switchboardId` | `0xd3be4120` | -| `transferOwnership` | `0xf2fde38b` | +| `payloadCounter` | `0x550ce1d5` | +| `processTrigger` | `0x7f3352bc` | +| `registerSibling` | `0x4f58b88c` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setSiblingConfig` | `0xacfbfc03` | +| `setSwitchboardFees` | `0x476bfc49` | +| `siblingPlugs` | `0x25fc3bcc` | +| `siblingSockets` | `0xce3483a5` | +| `siblingSwitchboards` | `0x51de49c9` | +| `socket__` | `0xc6a261d2` | +| `switchboardFees` | `0xb2a71ee7` | +| `switchboardId` | `0xd3be4120` | +| `transferOwnership` | `0xf2fde38b` | ## ReadPrecompile -| Function | Signature | -| -------- | --------- | -| `expiryTime` | `0x99bc0aea` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x62974d96` | -| `readFees` | `0xe06357a2` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0x7f0b2207` | -| `setExpiryTime` | `0x30fc4cff` | -| `setFees` | `0x3d18678e` | +| Function | Signature | +| ------------------------------ | ------------ | +| `expiryTime` | `0x99bc0aea` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `handlePayload` | `0x62974d96` | +| `readFees` | `0xe06357a2` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0x7f0b2207` | +| `setExpiryTime` | `0x30fc4cff` | +| `setFees` | `0x3d18678e` | | `validateAndGetPrecompileData` | `0x997f5bef` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## SchedulePrecompile -| Function | Signature | -| -------- | --------- | -| `expiryTime` | `0x99bc0aea` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x62974d96` | -| `maxScheduleDelayInSeconds` | `0x3ef01cdb` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0x7f0b2207` | -| `scheduleCallbackFees` | `0x4c5b6007` | -| `scheduleFeesPerSecond` | `0x852a74c1` | -| `setExpiryTime` | `0x30fc4cff` | +| Function | Signature | +| ------------------------------ | ------------ | +| `expiryTime` | `0x99bc0aea` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `handlePayload` | `0x62974d96` | +| `maxScheduleDelayInSeconds` | `0x3ef01cdb` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0x7f0b2207` | +| `scheduleCallbackFees` | `0x4c5b6007` | +| `scheduleFeesPerSecond` | `0x852a74c1` | +| `setExpiryTime` | `0x30fc4cff` | | `setMaxScheduleDelayInSeconds` | `0x12953318` | -| `setScheduleCallbackFees` | `0xec8fd71e` | -| `setScheduleFeesPerSecond` | `0x28e59e57` | +| `setScheduleCallbackFees` | `0xec8fd71e` | +| `setScheduleFeesPerSecond` | `0x28e59e57` | | `validateAndGetPrecompileData` | `0x997f5bef` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## WritePrecompile -| Function | Signature | -| -------- | --------- | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainMaxMsgValueLimit` | `0x01d1e126` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `contractFactoryPlugs` | `0x35426631` | -| `digestHashes` | `0xd1a862bf` | -| `expiryTime` | `0x99bc0aea` | -| `getDigest` | `0x3554edc7` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `getPrevBatchDigestHash` | `0x372863a1` | -| `handlePayload` | `0x62974d96` | -| `initialize` | `0xeb990c59` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0x7f0b2207` | -| `setContractFactoryPlugs` | `0x8b198f5c` | -| `setExpiryTime` | `0x30fc4cff` | -| `setFees` | `0x3d18678e` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| ------------------------------ | ------------ | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainMaxMsgValueLimit` | `0x01d1e126` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `contractFactoryPlugs` | `0x35426631` | +| `digestHashes` | `0xd1a862bf` | +| `expiryTime` | `0x99bc0aea` | +| `getDigest` | `0x3554edc7` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `getPrevBatchDigestHash` | `0x372863a1` | +| `handlePayload` | `0x62974d96` | +| `initialize` | `0xeb990c59` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0x7f0b2207` | +| `setContractFactoryPlugs` | `0x8b198f5c` | +| `setExpiryTime` | `0x30fc4cff` | +| `setFees` | `0x3d18678e` | +| `transferOwnership` | `0xf2fde38b` | | `updateChainMaxMsgValueLimits` | `0x6a7aa6ac` | -| `uploadProof` | `0x81b48fcf` | +| `uploadProof` | `0x81b48fcf` | | `validateAndGetPrecompileData` | `0x997f5bef` | -| `watcherProofs` | `0x3fa3166b` | -| `watcher__` | `0x300bb063` | -| `writeFees` | `0x5c664aeb` | - +| `watcherProofs` | `0x3fa3166b` | +| `watcher__` | `0x300bb063` | +| `writeFees` | `0x5c664aeb` | diff --git a/deployments/stage_addresses.json b/deployments/stage_addresses.json index 8ba36507..ffd2c9e3 100644 --- a/deployments/stage_addresses.json +++ b/deployments/stage_addresses.json @@ -1,73 +1,133 @@ { "10": { - "ContractFactoryPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", - "FastSwitchboard": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", - "FeesPlug": "0x501bdF8C7163ddD32172575C2836c5A7F556cbE7", - "Socket": "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", - "SocketBatcher": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", - "startBlock": 136685079 - }, - "43": { - "AddressResolver": "0x935b06902cA5C8bb4C76e18738561c294D377A93", - "AddressResolverImpl": "0xD1586EaaA0d473E6655c11A927cE4FbED648F3BF", - "AsyncDeployer": "0xECa623A443F21B705714D4A0f810d0A5D135FF6F", - "AsyncDeployerImpl": "0x1B0ea1b79B526dD3d5889Bb33Dbd24f790C23102", - "AuctionManager": "0xD044f27A9c5EE4f92EF0e38685276adFDF13E90E", - "AuctionManagerImpl": "0xC72BE9e639DA23570fa1eF2fF2cb7901a081916F", - "Configurations": "0x72f4C225B4B4f0F9608a50aEe17dA9e11dcb94b2", - "ConfigurationsImpl": "0x351De7e4275dA7f49F75363e4E7ea86Dfe050501", - "DeployForwarder": "0x5E9d1072B60D6c752B1593F5937393413372E5eF", - "DeployForwarderImpl": "0x1b7752F0039E80Aa38f7CF8b5d18798dD2ac1597", - "ERC1967Factory": "0x526796AC60e45CBB9b17c654C9447Baf160C084d", - "FeesManager": "0xA07208F9e7aE243F922317ab6604DC9F86822406", - "FeesManagerImpl": "0xC7A525A5D78610A9B7154315F3eC39Aa62594d1f", - "FeesPool": "0xe2054B575664dfDBD7a7FbAf2B12420ae88DE0FF", - "PromiseResolver": "0x38e24A2F157817b830F36A35b862F24B1494d1aD", - "ReadPrecompile": "0x39b5D3FBBa1BC28438e25955aaB412C7576eCd61", - "RequestHandler": "0x2E928C000bdC1f90716B05cE2D7182C9FA081d31", - "RequestHandlerImpl": "0xD38ae1a6C410c7681ac464bd60009198406035Ed", - "SchedulePrecompile": "0xb14a7763f09eCbd47bC5230D6170547a22834a82", - "startBlock": 8240883, - "Watcher": "0x4C846eCa55ad8cF19B9D5d906225da7b565174C1", - "WatcherImpl": "0x2920F4FB50343EF2b33096650cE234E8aF9E8556", - "WritePrecompile": "0x393007B660a00970b25E34FEd6506CE96120f8e2", - "WritePrecompileImpl": "0x0026c4736E57fE2817b53f6df1E0808c3a61984d" + "CCTPSwitchboard": "0x8d1aAf3c24D221aE30E069136C8B1e305d7668Dc", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", + "FastSwitchboard": "0xDa17184a5DE13B731C7F06ED147a6048eD6f9EEA", + "FastSwitchboardId": "1", + "FeesPlug": "0x375b8c18b57DbAA5146cdCb4a8154Ff2eCc238D6", + "MessageSwitchboard": "0xD9803F3A7F2b7Ce185daAaC94EFE00B30F0f9fab", + "MessageSwitchboardId": "3", + "Socket": "0x79EB309890F4A797816478dB7D9d57A1e63CeeC2", + "SocketBatcher": "0xe31C4265Cb0E22663164172B055Ac25281adfb66", + "startBlock": 139061413, + "SwitchboardIdToAddressMap": { + "1": "0xDa17184a5DE13B731C7F06ED147a6048eD6f9EEA", + "2": "0x8d1aAf3c24D221aE30E069136C8B1e305d7668Dc", + "3": "0xD9803F3A7F2b7Ce185daAaC94EFE00B30F0f9fab" + } }, "8453": { - "ContractFactoryPlug": "0x3aac37DC85C522c09A3DDdA44D181E6aCCD2f9F0", - "FastSwitchboard": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", - "FeesPlug": "0x79EB309890F4A797816478dB7D9d57A1e63CeeC2", - "Socket": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", - "SocketBatcher": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", - "startBlock": 31089766 + "CCTPSwitchboard": "0x72e8aba972EEe812d6a5C6Ab13197e884C7D8FA9", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0xcFb68baF734daA2b5df3eE18F1fb45c99230A2A5", + "FastSwitchboard": "0xb5763dC91FD626786E17b43E8808062a87b037aF", + "FastSwitchboardId": "1", + "FeesPlug": "0x6C1d46856dc8e1Fe16B1A8d0caEc720F9A58A193", + "MessageSwitchboard": "0x0D85b9835bD1E82baeFcdb12C4D171294c64Afd2", + "MessageSwitchboardId": "3", + "Socket": "0x375b8c18b57DbAA5146cdCb4a8154Ff2eCc238D6", + "SocketBatcher": "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", + "startBlock": 33466371, + "SwitchboardIdToAddressMap": { + "1": "0xb5763dC91FD626786E17b43E8808062a87b037aF", + "2": "0x72e8aba972EEe812d6a5C6Ab13197e884C7D8FA9", + "3": "0x0D85b9835bD1E82baeFcdb12C4D171294c64Afd2" + } + }, + "14323": { + "AddressResolver": "0xAA77c2dE14CfFF4244a127deED6b53ce79481e14", + "AddressResolverImpl": "0xe857a826D330Fc0429c67FaBEB8B66C26ea1DD5f", + "AsyncDeployer": "0x24c3f774c231ADFeb5e22Ad826a666A0FF9742C8", + "AsyncDeployerImpl": "0xB7Bf09935108753491E59114dc0B713cDa6F703F", + "AuctionManager": "0xd5853f69f5dE728AEF7d1cF029cB3bF1581A4ED4", + "AuctionManagerImpl": "0x89A0D4550D5aFa809B74856624D4595188641BCe", + "Configurations": "0x0f2801ee741A3BdeA2245d97AB54B1C4d7734534", + "ConfigurationsImpl": "0xD41d93042Dd1aB8c712C212A6907d4dC0718D021", + "DeployForwarder": "0x54676a772aEe69E3F87178F2b5E4414dcE9A9720", + "DeployForwarderImpl": "0x9882ce57b618175Bd9d3a4eC50ebD682B39bc467", + "ERC1967Factory": "0x61788F19CA1b098cE8437f8eb13B1Ad68f4FcD77", + "FeesManager": "0x9339e8D915Aaf467d2fC01a4e694c8FE85621e94", + "FeesManagerImpl": "0x27b763c5410E83c02F21D97B33555729B77B2Ce1", + "FeesPool": "0xC8d803B7c1719cdF21392405879D1B56398045C4", + "PromiseResolver": "0x9BE3513a5d32E74935a54e5516b4daa198da5574", + "ReadPrecompile": "0x784730D5e5D2F64eA63BfafeDC759317438c9186", + "RequestHandler": "0x22FaddfD47B9E0B545f83a2E7Cd05c12889c7a57", + "RequestHandlerImpl": "0xAA6EfF8dbd53B8d95a02c59Fe5C8A8422B08F5AA", + "SchedulePrecompile": "0x074118aB15e54A84b42Ff3de5233721434cF9f55", + "startBlock": 11040, + "Watcher": "0xdd25a87AeB5bCEeBAc0EB27aFfaBB6eB5a2857ca", + "WatcherImpl": "0xb143810f13fDF66F7a9B973252AEC80ec47FF0cb", + "WritePrecompile": "0x66ce424303EC8499C5cdC4F6437A0434D8bd9b81", + "WritePrecompileImpl": "0x962E1db23f6C5879A5c9D58CcB8c67CD282F1000" }, "42161": { - "ContractFactoryPlug": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", - "FastSwitchboard": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", - "FeesPlug": "0x501bdF8C7163ddD32172575C2836c5A7F556cbE7", - "Socket": "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", - "SocketBatcher": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", - "startBlock": 343531414 + "CCTPSwitchboard": "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0x0D85b9835bD1E82baeFcdb12C4D171294c64Afd2", + "FastSwitchboard": "0x375b8c18b57DbAA5146cdCb4a8154Ff2eCc238D6", + "FastSwitchboardId": "1", + "FeesPlug": "0x72e8aba972EEe812d6a5C6Ab13197e884C7D8FA9", + "MessageSwitchboard": "0xb5763dC91FD626786E17b43E8808062a87b037aF", + "MessageSwitchboardId": "3", + "Socket": "0x8d1aAf3c24D221aE30E069136C8B1e305d7668Dc", + "SocketBatcher": "0xD9803F3A7F2b7Ce185daAaC94EFE00B30F0f9fab", + "startBlock": 362517265, + "SwitchboardIdToAddressMap": { + "1": "0x375b8c18b57DbAA5146cdCb4a8154Ff2eCc238D6", + "2": "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", + "3": "0xb5763dC91FD626786E17b43E8808062a87b037aF" + } }, "84532": { - "ContractFactoryPlug": "0x87cC19AedD434ebD3B74FfdC073CAeC7dC1E92EA", - "FastSwitchboard": "0x5aA84ffE5eCCB5263d1AE6aEd5682EAb39Bc7036", - "Socket": "0xa09217Cfc47F399C382E982778f6128685e13aD4", - "SocketBatcher": "0x80568677f2B092bd974657FE47Fc8531bfE5DBDC", - "startBlock": 26600215 + "CCTPSwitchboard": "0x23463461b040c3B2DE91ce84e697656de6021636", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0xf740d6b59762fF2547Ed7aD629e041F80E1A3f75", + "FastSwitchboard": "0x81046b8A1752253b214E0EAace04E3927ECbC3cC", + "FastSwitchboardId": "1", + "MessageSwitchboard": "0x72583393DBF61d3dd37b5474AECd73F16A94e7E0", + "MessageSwitchboardId": "3", + "Socket": "0xbD458B2442d1c9a0BA96b12EeAE98dac7843A220", + "SocketBatcher": "0x8aE491E31A5Caba13Cb9468943B2241E3046F0bb", + "startBlock": 28976719, + "SwitchboardIdToAddressMap": { + "1": "0x81046b8A1752253b214E0EAace04E3927ECbC3cC", + "2": "0x23463461b040c3B2DE91ce84e697656de6021636", + "3": "0x72583393DBF61d3dd37b5474AECd73F16A94e7E0" + } }, "421614": { - "ContractFactoryPlug": "0xe2904171afCeC319236cc051c81202677F7Aac1B", - "FastSwitchboard": "0x82833e5ac997F8f9c426949595d49702E3b08414", - "Socket": "0x468cA4bB968FD86eD752A7bD453c6869E27204f0", - "SocketBatcher": "0x977B8aB88A7159130457adA4b7078208Ab4fB111", - "startBlock": 159757112 + "CCTPSwitchboard": "0xc0D6939719120cBB7e5aBa02bc05dB9A2ECa3ffB", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0xB9590200eB8ED11C6A36D06A633Bff92648F9F10", + "FastSwitchboard": "0x6a3cA5381D2074695b9B17e582eaf90a107D1Dd4", + "FastSwitchboardId": "1", + "MessageSwitchboard": "0xf5450eF55F2396c2cf7A6ee0c6ff63F93701485b", + "MessageSwitchboardId": "3", + "Socket": "0x247d46e6f1E63F323d62f8930775225Aa6f89961", + "SocketBatcher": "0x5F40d9fdc41b56c9E41caB097d68C9F8E49ad2B7", + "startBlock": 178265135, + "SwitchboardIdToAddressMap": { + "1": "0x6a3cA5381D2074695b9B17e582eaf90a107D1Dd4", + "2": "0xc0D6939719120cBB7e5aBa02bc05dB9A2ECa3ffB", + "3": "0xf5450eF55F2396c2cf7A6ee0c6ff63F93701485b" + } }, "11155420": { - "ContractFactoryPlug": "0x705A4DD80D7203BF78AcAf3BA1851D1A80fA3d89", - "FastSwitchboard": "0x74388051BcCfA2D28690a98242A259aD94f2B1f3", - "Socket": "0x790E894C59d6275503e2Ff4ba95A42E38c071195", - "SocketBatcher": "0xa13B9b5e797e13316B23EfC01E506c8c0c2BFeF2", - "startBlock": 28583052 + "CCTPSwitchboard": "0xd044404DA542873c8998BB4E0792BeBFDBf8D870", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0xb5Fb70d981A997240347378f9a6122E76888D325", + "FastSwitchboard": "0x7272e719e2fd5E4fBaA927cfC56431299FcEFe2D", + "FastSwitchboardId": "1", + "MessageSwitchboard": "0x5bFdC07B0302B51BD1c7ac4419D1d03DD120F034", + "MessageSwitchboardId": "3", + "Socket": "0x8e0F811Bc6ec08ffe152f460Ce9e3Ac211c83c69", + "SocketBatcher": "0x1358990F5D91152086854FB3b5137E88ac41004c", + "startBlock": 30959559, + "SwitchboardIdToAddressMap": { + "1": "0x7272e719e2fd5E4fBaA927cfC56431299FcEFe2D", + "2": "0xd044404DA542873c8998BB4E0792BeBFDBf8D870", + "3": "0x5bFdC07B0302B51BD1c7ac4419D1d03DD120F034" + } } } diff --git a/deployments/stage_verification.json b/deployments/stage_verification.json index 28d06e20..7851e646 100644 --- a/deployments/stage_verification.json +++ b/deployments/stage_verification.json @@ -1,213 +1,14 @@ { "10": [], - "43": [ - [ - "0xC7A525A5D78610A9B7154315F3eC39Aa62594d1f", - "FeesManager", - "contracts/evmx/fees/FeesManager.sol", - [] - ], - [ - "0x0026c4736E57fE2817b53f6df1E0808c3a61984d", - "WritePrecompile", - "contracts/evmx/watcher/precompiles/WritePrecompile.sol", - [] - ], - [ - "0x38e24A2F157817b830F36A35b862F24B1494d1aD", - "PromiseResolver", - "contracts/evmx/watcher/PromiseResolver.sol", - ["0x4C846eCa55ad8cF19B9D5d906225da7b565174C1"] - ], - [ - "0xD38ae1a6C410c7681ac464bd60009198406035Ed", - "RequestHandler", - "contracts/evmx/watcher/RequestHandler.sol", - [] - ], - [ - "0x351De7e4275dA7f49F75363e4E7ea86Dfe050501", - "Configurations", - "contracts/evmx/watcher/Configurations.sol", - [] - ], - [ - "0x1b7752F0039E80Aa38f7CF8b5d18798dD2ac1597", - "DeployForwarder", - "contracts/evmx/helpers/DeployForwarder.sol", - [] - ], - [ - "0xC72BE9e639DA23570fa1eF2fF2cb7901a081916F", - "AuctionManager", - "contracts/evmx/AuctionManager.sol", - [] - ], - [ - "0x2920F4FB50343EF2b33096650cE234E8aF9E8556", - "Watcher", - "contracts/evmx/watcher/Watcher.sol", - [] - ], - [ - "0x1B0ea1b79B526dD3d5889Bb33Dbd24f790C23102", - "AsyncDeployer", - "contracts/evmx/helpers/AsyncDeployer.sol", - [] - ], - [ - "0xbD22EDD6559B28614f44D1c768EC26491CDE1cDD", - "FeesManager", - "contracts/evmx/fees/FeesManager.sol", - [] - ], - [ - "0xD1586EaaA0d473E6655c11A927cE4FbED648F3BF", - "AddressResolver", - "contracts/evmx/helpers/AddressResolver.sol", - [] - ], - [ - "0xe2054B575664dfDBD7a7FbAf2B12420ae88DE0FF", - "FeesPool", - "contracts/evmx/fees/FeesPool.sol", - ["0xb62505feacC486e809392c65614Ce4d7b051923b"] - ], - [ - "0x526796AC60e45CBB9b17c654C9447Baf160C084d", - "ERC1967Factory", - "lib/solady/src/utils/ERC1967Factory.sol", - [] - ], - [ - "0xFaa00117ED72CAE3399669a1E3FEedaF93020853", - "SchedulePrecompile", - "contracts/evmx/watcher/precompiles/SchedulePrecompile.sol", - [ - "0x03Aa399188E2741f89cc4265493DC5b544C52134", - 86400, - { - "type": "BigNumber", - "hex": "0x02540be400" - }, - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - 300 - ] - ], - [ - "0xD38d0Dfd8e7d61B45Cce6Ec58E1Ec4c514c00e7F", - "ReadPrecompile", - "contracts/evmx/watcher/precompiles/ReadPrecompile.sol", - [ - "0x03Aa399188E2741f89cc4265493DC5b544C52134", - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - 300 - ] - ], - [ - "0x702EfE1DfABc3963114E2356aFaF36c8b67CA961", - "WritePrecompile", - "contracts/evmx/watcher/precompiles/WritePrecompile.sol", - [] - ], - [ - "0xd0bd7837E66eEd7Be04C88354e75F5bA3cd19959", - "PromiseResolver", - "contracts/evmx/watcher/PromiseResolver.sol", - ["0x03Aa399188E2741f89cc4265493DC5b544C52134"] - ], - [ - "0x446C6B4086d1888cB15cF62735Bf57A4647E31A4", - "RequestHandler", - "contracts/evmx/watcher/RequestHandler.sol", - [] - ], - [ - "0x2dc671B87d1A9dc7C1cf06C74C2db06673b31FFf", - "Configurations", - "contracts/evmx/watcher/Configurations.sol", - [] - ], - [ - "0x4ab75b62c0E2A09E428Ce73043C36d54c78C8CFd", - "DeployForwarder", - "contracts/evmx/helpers/DeployForwarder.sol", - [] - ], - [ - "0xed8255097DFB0BB2135870bb342335dCC0C30e21", - "Watcher", - "contracts/evmx/watcher/Watcher.sol", - [] - ], + "8453": [], + "14323": [ [ - "0xF946503b3bF14b39468AEce46E7Ce1A08404D109", + "0xB7Bf09935108753491E59114dc0B713cDa6F703F", "AsyncDeployer", "contracts/evmx/helpers/AsyncDeployer.sol", [] - ], - [ - "0x69DD00B8a250e0A1bFF1b59db2EA99792faAbC66", - "FeesPool", - "contracts/evmx/fees/FeesPool.sol", - ["0xb62505feacC486e809392c65614Ce4d7b051923b"] - ], - [ - "0xfddb38811a0774E66ABD5F3Ae960bFB7E7415029", - "AuctionManager", - "contracts/protocol/payload-delivery/AuctionManager.sol", - [] - ], - [ - "0xa07e38cAB46eAA358C3653C63219f1009e8F7789", - "DeliveryHelper", - "contracts/protocol/payload-delivery/app-gateway/DeliveryHelper.sol", - [] - ], - [ - "0x9F10A0c71178dbD4d049f2C04fD0e34966134b9e", - "FeesManager", - "contracts/protocol/payload-delivery/FeesManager.sol", - [] - ], - [ - "0xB423eE3bffc3604F96B59cF419C48AE05b8E9d0b", - "WatcherPrecompile", - "contracts/protocol/watcherPrecompile/core/WatcherPrecompile.sol", - [] - ], - [ - "0xd69E17Ce715f49Cd2B16C64cf75201A56Ce0E90d", - "WatcherPrecompileConfig", - "contracts/protocol/watcherPrecompile/WatcherPrecompileConfig.sol", - [] - ], - [ - "0x0e26C8CFCABC04c642696A625664553e2C183bbe", - "WatcherPrecompileLimits", - "contracts/protocol/watcherPrecompile/WatcherPrecompileLimits.sol", - [] - ], - [ - "0x794b92C2Ade7D33Fb34d138B13014C63aB27CBC0", - "AddressResolver", - "contracts/protocol/AddressResolver.sol", - [] - ], - [ - "0x98ea7A5601f203DE56d86BDCA69fC3019377D6B1", - "ERC1967Factory", - "lib/solady/src/utils/ERC1967Factory.sol", - [] ] ], - "8453": [], "42161": [], "84532": [], "421614": [], diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index e0355172..0b106fa5 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -219,7 +219,7 @@ async function setOnchainContracts( const setSiblingConfig = async ( chain: number, addresses: DeploymentAddresses, - signer: Wallet, + signer: Wallet ) => { try { console.log("Setting sibling config"); @@ -255,7 +255,12 @@ const setSiblingConfig = async ( const siblingSocket = await switchboard.siblingSockets(remoteChainSlug); const siblingFees = await switchboard.switchboardFees(remoteChainSlug); - if (siblingSwitchboard == toBytes32FormatHexString(remoteSwitchboardAddress) && siblingSocket == toBytes32FormatHexString(remoteSocket) && siblingFees == MSG_SB_FEES) { + if ( + siblingSwitchboard == + toBytes32FormatHexString(remoteSwitchboardAddress) && + siblingSocket == toBytes32FormatHexString(remoteSocket) && + siblingFees == MSG_SB_FEES + ) { console.log(`Sibling config ${remoteChainSlug} already exists`); continue; } @@ -296,10 +301,9 @@ const addRemoteEndpointsToCCTPSwitchboard = async ( console.log(chain, " remoteChainSlugs: ", remoteChainSlugs); for (const remoteChainSlug of remoteChainSlugs) { - const remoteSwitchboardAddress = - toBytes32FormatHexString( - addresses[remoteChainSlug]?.[Contracts.CCTPSwitchboard]! - ); + const remoteSwitchboardAddress = toBytes32FormatHexString( + addresses[remoteChainSlug]?.[Contracts.CCTPSwitchboard]! + ); const currentRemoteEndpoint = await switchboard.chainSlugToRemoteEndpoint( remoteChainSlug ); From f618d2b9f90686a4b6056b22ec3cf0dbb8233acc Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 29 Jul 2025 16:50:14 +0530 Subject: [PATCH 063/139] doc: commments --- contracts/protocol/Socket.sol | 3 +-- contracts/protocol/SocketConfig.sol | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index ad3f97dd..d4c6e944 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -85,7 +85,6 @@ contract Socket is SocketUtils { // verify the digest _verify(payloadId, plugConfig, executeParams_, transmissionParams_.transmitterProof); - return _execute(payloadId, executeParams_, transmissionParams_); } @@ -101,6 +100,7 @@ contract Socket is SocketUtils { if (isValidSwitchboard[plugConfig_.switchboardId] != SwitchboardStatus.REGISTERED) revert InvalidSwitchboard(); + // NOTE: the first un-trusted call in the system address transmitter = ISwitchboard(switchboardAddresses[plugConfig_.switchboardId]) .getTransmitter(msg.sender, payloadId_, transmitterProof_); @@ -114,7 +114,6 @@ contract Socket is SocketUtils { ); payloadIdToDigest[payloadId_] = digest; - // NOTE: is the the first un-trusted call in the system, another one is Plug.call if ( !ISwitchboard(switchboardAddresses[plugConfig_.switchboardId]).allowPayload( digest, diff --git a/contracts/protocol/SocketConfig.sol b/contracts/protocol/SocketConfig.sol index 2a701b4a..a9c0e2ed 100644 --- a/contracts/protocol/SocketConfig.sol +++ b/contracts/protocol/SocketConfig.sol @@ -79,21 +79,25 @@ abstract contract SocketConfig is ISocket, AccessControl { emit SwitchboardDisabled(switchboardId_); } - // @notice function to enable a switchboard + // @notice function to enable a switchboard if disabled // @dev only callable by governance role function enableSwitchboard(uint64 switchboardId_) external onlyRole(GOVERNANCE_ROLE) { isValidSwitchboard[switchboardId_] = SwitchboardStatus.REGISTERED; emit SwitchboardEnabled(switchboardId_); } + // @notice function to set the socket fee manager + // @dev only callable by governance role + // @param socketFeeManager_ address of the socket fee manager function setSocketFeeManager(address socketFeeManager_) external onlyRole(GOVERNANCE_ROLE) { - emit SocketFeeManagerUpdated(address(socketFeeManager), socketFeeManager_); socketFeeManager = ISocketFeeManager(socketFeeManager_); + emit SocketFeeManagerUpdated(address(socketFeeManager), socketFeeManager_); } - /** - * @notice connects Plug to Socket and sets the config for given `siblingChainSlug_` - */ + // @notice function to connect a plug to socket + // @dev only callable by plug + // @param appGatewayId_ app gateway id + // @param switchboardId_ switchboard id function connect(bytes32 appGatewayId_, uint64 switchboardId_) external override { if (isValidSwitchboard[switchboardId_] != SwitchboardStatus.REGISTERED) revert InvalidSwitchboard(); @@ -105,9 +109,8 @@ abstract contract SocketConfig is ISocket, AccessControl { emit PlugConnected(msg.sender, appGatewayId_, switchboardId_); } - /** - * @notice disconnects Plug from Socket - */ + // @notice function to disconnect a plug from socket + // @dev only callable by plug function disconnect() external override { PlugConfigEvm storage _plugConfig = _plugConfigs[msg.sender]; if (_plugConfig.appGatewayId == bytes32(0)) revert PlugNotConnected(); From 1cd0c98c40b4822324c4df05378bc15ca254d4d6 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 31 Jul 2025 14:05:19 +0530 Subject: [PATCH 064/139] feat: test mocks --- test/mock/MockERC721.sol | 48 +++++++++++ test/mock/MockFastSwitchboard.sol | 30 +++++-- test/mock/MockFeesManager.sol | 44 +++++++++++ test/mock/MockPlug.sol | 127 ++++++++++++++++++++++++++++++ 4 files changed, 241 insertions(+), 8 deletions(-) create mode 100644 test/mock/MockERC721.sol create mode 100644 test/mock/MockFeesManager.sol create mode 100644 test/mock/MockPlug.sol diff --git a/test/mock/MockERC721.sol b/test/mock/MockERC721.sol new file mode 100644 index 00000000..08461c4e --- /dev/null +++ b/test/mock/MockERC721.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.21; + +import {ERC721} from "solady/tokens/ERC721.sol"; + +contract MockERC721 is ERC721 { + string private _name = "MockERC721"; + string private _symbol = "MOCK721"; + + // Simple tokenId tracker for minting + uint256 private _nextTokenId = 1; + + function name() public view override returns (string memory) { + return _name; + } + + function symbol() public view override returns (string memory) { + return _symbol; + } + + /// @notice Mint a new token to `to` with a specific `tokenId` + function mint(address to, uint256 tokenId) public { + _mint(to, tokenId); + } + + /// @notice Mint a new token to `to` with auto-incremented tokenId + function mint(address to) public returns (uint256 tokenId) { + tokenId = _nextTokenId++; + _mint(to, tokenId); + } + + /// @notice Burn a token + function burn(uint256 tokenId) public { + // Only owner or approved can burn + if ( + msg.sender != ownerOf(tokenId) && + !isApprovedForAll(ownerOf(tokenId), msg.sender) && + getApproved(tokenId) != msg.sender + ) { + revert NotOwnerNorApproved(); + } + _burn(tokenId); + } + + function tokenURI(uint256 id) public view virtual override returns (string memory) { + return ""; + } +} diff --git a/test/mock/MockFastSwitchboard.sol b/test/mock/MockFastSwitchboard.sol index 24b31cd3..6ed61324 100644 --- a/test/mock/MockFastSwitchboard.sol +++ b/test/mock/MockFastSwitchboard.sol @@ -11,6 +11,8 @@ contract MockFastSwitchboard is ISwitchboard { // chain slug of deployed chain uint32 public immutable chainSlug; uint64 public switchboardId; + bool public attestCalled; + bool public isPayloadAllowed; /** * @dev Constructor of SwitchboardBase @@ -21,17 +23,26 @@ contract MockFastSwitchboard is ISwitchboard { chainSlug = chainSlug_; socket__ = ISocket(socket_); owner = owner_; + + isPayloadAllowed = true; } - function attest(bytes32, bytes calldata) external {} + function attest(bytes32, bytes calldata) external { + attestCalled = true; + } - function allowPayload(bytes32, bytes32) external pure returns (bool) { + function allowPayload(bytes32, bytes32) external view returns (bool) { // digest has enough attestations - return true; + return isPayloadAllowed; } - function registerSwitchboard() external { + function setIsPayloadAllowed(bool isPayloadAllowed_) external { + isPayloadAllowed = isPayloadAllowed_; + } + + function registerSwitchboard() external returns (uint64) { switchboardId = socket__.registerSwitchboard(); + return switchboardId; } function processTrigger( @@ -39,13 +50,16 @@ contract MockFastSwitchboard is ISwitchboard { bytes32 triggerId_, bytes calldata payload_, bytes calldata overrides_ - ) external payable override {} + ) external payable override { + // Simple implementation that just accepts the trigger + // In a real switchboard, this would process the trigger + } function getTransmitter( address sender_, - bytes32 payloadId_, - bytes calldata transmitterSignature_ - ) external view returns (address) { + bytes32, + bytes calldata + ) external pure returns (address) { return sender_; } } diff --git a/test/mock/MockFeesManager.sol b/test/mock/MockFeesManager.sol new file mode 100644 index 00000000..a63bffea --- /dev/null +++ b/test/mock/MockFeesManager.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import "../../contracts/protocol/interfaces/ISocketFeeManager.sol"; +import "../../contracts/utils/common/Structs.sol"; + +/** + * @title MockFeeManager + * @dev Mock fee manager for testing + */ +contract MockFeeManager is ISocketFeeManager { + bool public payAndCheckFeesCalled = false; + ExecuteParams public lastExecuteParams; + TransmissionParams public lastTransmissionParams; + + function payAndCheckFees( + ExecuteParams memory executeParams_, + TransmissionParams memory transmissionParams_ + ) external payable override { + payAndCheckFeesCalled = true; + lastExecuteParams = executeParams_; + lastTransmissionParams = transmissionParams_; + } + + function getMinSocketFees() external pure override returns (uint256) { + return 0.001 ether; + } + + function setSocketFees(uint256) external override { + // Mock implementation - do nothing + } + + function socketFees() external pure override returns (uint256) { + return 0.001 ether; + } + + function getLastTransmissionParams() external view returns (TransmissionParams memory) { + return lastTransmissionParams; + } + + function reset() external { + payAndCheckFeesCalled = false; + } +} diff --git a/test/mock/MockPlug.sol b/test/mock/MockPlug.sol new file mode 100644 index 00000000..13b9dc9f --- /dev/null +++ b/test/mock/MockPlug.sol @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import "../../contracts/protocol/interfaces/IPlug.sol"; +import "../../contracts/protocol/interfaces/ISocket.sol"; + +/** + * @title MockPlug + * @dev Mock plug for testing + */ +contract MockPlug is IPlug { + ISocket public socket__; + bytes32 public appGatewayId; + uint64 public switchboardId; + bytes public overridesData = hex"1234"; + bool public initSocketCalled = false; + + error CallFailed(); + + function initSocket( + bytes32 appGatewayId_, + address socket_, + uint64 switchboardId_ + ) external override { + appGatewayId = appGatewayId_; + socket__ = ISocket(socket_); + initSocketCalled = true; + + socket__.connect(appGatewayId_, switchboardId_); + } + + function disconnect() external { + socket__.disconnect(); + } + + function overrides() external view override returns (bytes memory) { + return overridesData; + } + + function setOverrides(bytes calldata newOverrides) external { + overridesData = newOverrides; + } + + function setSocket(address newSocket) external { + socket__ = ISocket(newSocket); + } + + // Test helper function to trigger socket calls + function triggerSocket(bytes calldata data) external payable returns (bytes memory) { + (bool success, bytes memory result) = address(socket__).call{value: msg.value}(data); + require(success, "Socket call failed"); + return result; + } + + // Test helper functions for simulation testing + function processPayload(bytes calldata payload) external payable returns (bool) { + return payload.length > 0; + } + + function failingFunction() external pure { + revert("Intentional failure"); + } + + function returnLargeData() external pure returns (bytes memory) { + // Return 3KB of data to test maxCopyBytes truncation (maxCopyBytes is 2KB) + return new bytes(3072); + } + + // Function to call mockTarget + function callMockTarget(address target, bytes calldata data) external payable returns (bool) { + (bool success, ) = target.call{value: msg.value}(data); + if (!success) revert CallFailed(); + return success; + } +} + +/** + * @title MockTarget + * @dev Mock target contract for execution testing + */ +contract MockTarget { + uint256 public counter = 0; + bytes public lastCallData; + uint256 public lastValue; + bool public shouldRevert = false; + + event Called(address caller, uint256 value, bytes data); + + function increment() external payable { + if (shouldRevert) { + revert(); + } + counter++; + lastCallData = msg.data; + lastValue = msg.value; + emit Called(msg.sender, msg.value, msg.data); + } + + function setShouldRevert(bool _shouldRevert) external { + shouldRevert = _shouldRevert; + } + + function reset() external { + counter = 0; + lastCallData = ""; + lastValue = 0; + shouldRevert = false; + } + + // Fallback to handle any call + fallback() external payable { + if (shouldRevert) { + revert("Mock revert"); + } + lastCallData = msg.data; + lastValue = msg.value; + emit Called(msg.sender, msg.value, msg.data); + } + + receive() external payable { + if (shouldRevert) { + revert("Mock revert"); + } + lastValue = msg.value; + emit Called(msg.sender, msg.value, ""); + } +} From c13b51d442f0619cc9f4786bc29161e20b672a2d Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 31 Jul 2025 14:05:35 +0530 Subject: [PATCH 065/139] test: unit socket tests --- contracts/protocol/Socket.sol | 1 - contracts/protocol/SocketUtils.sol | 15 - test/Socket.t.sol | 952 +++++++++++++++++++++++++++++ 3 files changed, 952 insertions(+), 16 deletions(-) create mode 100644 test/Socket.t.sol diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index d4c6e944..f08e44cc 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -229,7 +229,6 @@ contract Socket is SocketUtils { /// @notice Receive function that forwards all calls to Socket's callAppGateway receive() external payable { - // todo: need a fn to increase trigger fees revert("Socket does not accept ETH"); } } diff --git a/contracts/protocol/SocketUtils.sol b/contracts/protocol/SocketUtils.sol index 3e23ede4..ac652670 100644 --- a/contracts/protocol/SocketUtils.sol +++ b/contracts/protocol/SocketUtils.sol @@ -91,21 +91,6 @@ abstract contract SocketUtils is SocketConfig { ); } - /** - * @notice recovers the signer from the signature - * @param digest_ The digest of the payload - * @param signature_ The signature of the payload - * @return signer The address of the signer - */ - function _recoverSigner( - bytes32 digest_, - bytes calldata signature_ - ) internal view returns (address signer) { - bytes32 digest = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", digest_)); - // recovered signer is checked for the valid roles later - signer = ECDSA.recover(digest, signature_); - } - /** * @notice Encodes the trigger ID with the chain slug, socket address and nonce * @return The trigger ID diff --git a/test/Socket.t.sol b/test/Socket.t.sol new file mode 100644 index 00000000..190cdcb3 --- /dev/null +++ b/test/Socket.t.sol @@ -0,0 +1,952 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import {Test} from "forge-std/Test.sol"; +import {console} from "forge-std/console.sol"; + +import {MockFastSwitchboard} from "./mock/MockFastSwitchboard.sol"; +import {MockPlug, MockTarget} from "./mock/MockPlug.sol"; +import {MockFeeManager} from "./mock/MockFeesManager.sol"; +import {SuperToken} from "./apps/app-gateways/super-token/SuperToken.sol"; +import {MockERC721} from "./mock/MockERC721.sol"; + +import "../contracts/protocol/Socket.sol"; +import "../contracts/protocol/SocketUtils.sol"; +import "../contracts/utils/common/Errors.sol"; +import "../contracts/utils/common/Constants.sol"; +import "../contracts/utils/common/Structs.sol"; + +/** + * @title SocketTestWrapper + * @dev Wrapper contract to expose internal functions for testing + */ +contract SocketTestWrapper is Socket { + constructor( + uint32 chainSlug_, + address owner_, + string memory version_ + ) Socket(chainSlug_, owner_, version_) {} + + // Expose internal functions for testing + function createDigest( + address transmitter_, + bytes32 payloadId_, + bytes32 appGatewayId_, + ExecuteParams calldata executeParams_ + ) external view returns (bytes32) { + return _createDigest(transmitter_, payloadId_, appGatewayId_, executeParams_); + } + + function encodeTriggerId() external returns (bytes32) { + return _encodeTriggerId(); + } + + function executeInternal( + bytes32 payloadId_, + ExecuteParams calldata executeParams_, + TransmissionParams calldata transmissionParams_ + ) external payable returns (bool, bytes memory) { + return _execute(payloadId_, executeParams_, transmissionParams_); + } +} + +/** + * @title SocketTestBase + * @dev Base contract for Socket protocol unit tests + * Provides common setup, utilities, and mock contracts + */ +contract SocketTestBase is Test { + uint256 c = 1; + string constant VERSION = "1.0.0"; + address public socketOwner = address(uint160(c++)); + address public transmitter = address(uint160(c++)); + address public testUser = address(uint160(c++)); + + uint32 constant TEST_CHAIN_SLUG = 1; + bytes32 constant TEST_APP_GATEWAY_ID = keccak256("TEST_APP_GATEWAY"); + bytes constant TEST_PAYLOAD = hex"1234567890abcdef"; + bytes constant TEST_OVERRIDES = hex"abcdef"; + + // Contracts + Socket public socket; + MockFastSwitchboard public mockSwitchboard; + MockPlug public mockPlug; + MockFeeManager public mockFeeManager; + SuperToken public mockToken; + MockTarget public mockTarget; + SocketTestWrapper public socketWrapper; + + uint64 public switchboardId; + ExecuteParams public executeParams; + TransmissionParams public transmissionParams; + + event ExecutionSuccess(bytes32 payloadId, bool exceededMaxCopy, bytes returnData); + event ExecutionFailed(bytes32 payloadId, bool exceededMaxCopy, bytes returnData); + + function setUp() public virtual { + socket = new Socket(TEST_CHAIN_SLUG, socketOwner, VERSION); + mockSwitchboard = new MockFastSwitchboard(TEST_CHAIN_SLUG, address(socket), socketOwner); + mockPlug = new MockPlug(); + mockFeeManager = new MockFeeManager(); + mockToken = new SuperToken("Test Token", "TEST", 18, testUser, 1000000000000000000); + mockTarget = new MockTarget(); + socketWrapper = new SocketTestWrapper(TEST_CHAIN_SLUG, socketOwner, VERSION); + mockToken.setOwner(socketOwner); + + // Set up initial state + vm.startPrank(socketOwner); + socket.grantRole(GOVERNANCE_ROLE, socketOwner); + socket.grantRole(RESCUE_ROLE, socketOwner); + socket.grantRole(SWITCHBOARD_DISABLER_ROLE, socketOwner); + + socket.setSocketFeeManager(address(mockFeeManager)); + mockToken.setSocket(address(socket)); + vm.stopPrank(); + + switchboardId = mockSwitchboard.registerSwitchboard(); + mockPlug.initSocket(TEST_APP_GATEWAY_ID, address(socket), switchboardId); + + executeParams = _createExecuteParams(); + transmissionParams = _createTransmissionParams(); + + vm.deal(transmitter, 100 ether); + vm.deal(testUser, 100 ether); + } + + function _createExecuteParams() internal view returns (ExecuteParams memory) { + return + ExecuteParams({ + callType: WRITE, + payloadPointer: 1, + deadline: block.timestamp + 1 hours, + gasLimit: 100000, + value: 0, + prevBatchDigestHash: bytes32(0), + target: address(mockPlug), + payload: TEST_PAYLOAD, + extraData: bytes("") + }); + } + + function _createTransmissionParams() internal view returns (TransmissionParams memory) { + return + TransmissionParams({ + socketFees: 0, + refundAddress: testUser, + extraData: bytes(""), + transmitterProof: bytes("") + }); + } + + function createSignature( + bytes32 digest_, + uint256 privateKey_ + ) public pure returns (bytes memory sig) { + bytes32 digest = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", digest_)); + (uint8 sigV, bytes32 sigR, bytes32 sigS) = vm.sign(privateKey_, digest); + sig = new bytes(65); + bytes1 v32 = bytes1(sigV); + assembly { + mstore(add(sig, 96), v32) + mstore(add(sig, 32), sigR) + mstore(add(sig, 64), sigS) + } + } +} + +/** + * @title SocketExecuteTest + * @dev Tests for Socket execute function + */ +contract SocketExecuteTest is SocketTestBase { + function testConstructorWithValidParameters() public view { + assertEq(socket.chainSlug(), TEST_CHAIN_SLUG, "Chain slug should match"); + assertEq(socket.owner(), socketOwner, "Owner should match"); + assertEq(socket.version(), keccak256(bytes(VERSION)), "Version should match"); + assertEq(socket.gasLimitBuffer(), 105, "Gas limit buffer should be 105"); + } + + function testExecuteDeadlinePassed() public { + executeParams.deadline = block.timestamp - 1; // Past deadline + vm.expectRevert(DeadlinePassed.selector); + socket.execute{value: 1 ether}(executeParams, transmissionParams); + } + + function testExecutePlugNotFound() public { + executeParams.target = address(0x999); // Non-existent plug + vm.expectRevert(PlugNotFound.selector); + socket.execute{value: 1 ether}(executeParams, transmissionParams); + } + + function testExecuteInsufficientValue() public { + executeParams.value = 1 ether; + transmissionParams.socketFees = 0.5 ether; + + vm.expectRevert(Socket.InsufficientMsgValue.selector); + socket.execute{value: 0.5 ether}(executeParams, transmissionParams); + } + + function testExecuteInvalidSwitchboardDisabled() public { + hoax(socketOwner); + socket.disableSwitchboard(switchboardId); + + vm.expectRevert(InvalidSwitchboard.selector); + socket.execute{value: 1 ether}(executeParams, transmissionParams); + } + + function testExecuteWithInvalidCallType() public { + executeParams.callType = bytes4(0x12345678); // Invalid call type + + vm.expectRevert(InvalidCallType.selector); + socket.execute{value: 1 ether}(executeParams, transmissionParams); + } + + function testExecuteRefundIfExecutionFails() public { + executeParams.target = address(mockPlug); + executeParams.value = 0.5 ether; + executeParams.payload = abi.encodeWithSelector( + mockPlug.callMockTarget.selector, + address(mockTarget), + abi.encodeWithSelector(mockTarget.increment.selector) + ); + + // Set up mock target to revert + mockTarget.setShouldRevert(true); + + uint256 userBalance = testUser.balance; + transmissionParams.refundAddress = testUser; + + hoax(transmitter); + (bool success, ) = socket.execute{value: 1 ether}(executeParams, transmissionParams); + assertFalse(success, "Execution should fail"); + + // Check that refund was sent + assertEq(testUser.balance, userBalance + 1 ether, "Refund should be sent to user"); + + // Set up mock target to revert + mockTarget.setShouldRevert(false); + userBalance = testUser.balance; + + hoax(transmitter); + (success, ) = socket.execute{value: 1 ether}(executeParams, transmissionParams); + assertTrue(success, "Execution should succeed"); + + // Check that refund was sent + assertEq(testUser.balance, userBalance, "Refund should not be sent to user"); + } + + function testExecuteWithValidParameters() public { + // Use mockPlug as target since it's connected to socket + executeParams.target = address(mockPlug); + executeParams.payload = abi.encodeWithSelector( + mockPlug.processPayload.selector, + TEST_PAYLOAD + ); + + bytes32 payloadId = createPayloadId( + executeParams.payloadPointer, + switchboardId, + TEST_CHAIN_SLUG + ); + + vm.expectEmit(true, true, true, true, address(socket)); + emit ExecutionSuccess(payloadId, false, bytes(abi.encode(true))); + (bool success, ) = socket.execute{value: 1 ether}(executeParams, transmissionParams); + assertTrue(success, "Execution should succeed"); + } + + function testExecuteWithPayloadAlreadyExecuted() public { + executeParams.payload = abi.encodeWithSelector( + mockPlug.processPayload.selector, + TEST_PAYLOAD + ); + + bytes32 payloadId = createPayloadId( + executeParams.payloadPointer, + switchboardId, + TEST_CHAIN_SLUG + ); + + vm.expectEmit(true, true, true, true, address(socket)); + emit ExecutionSuccess(payloadId, false, bytes(abi.encode(true))); + socket.execute{value: 1 ether}(executeParams, transmissionParams); + + vm.expectRevert( + abi.encodeWithSelector(Socket.PayloadAlreadyExecuted.selector, ExecutionStatus.Executed) + ); + socket.execute{value: 1 ether}(executeParams, transmissionParams); + } + + function testExecuteWithVerificationFailed() public { + // Override the allowPayload function to return false + mockSwitchboard.setIsPayloadAllowed(false); + + vm.expectRevert(Socket.VerificationFailed.selector); + socket.execute{value: 1 ether}(executeParams, transmissionParams); + } + + function testExecuteWithFailedExecution() public { + executeParams.target = address(mockPlug); + executeParams.payload = abi.encodeWithSelector( + mockPlug.callMockTarget.selector, + address(mockTarget), + abi.encodeWithSelector(mockTarget.increment.selector) + ); + + // Set up mock target to revert + mockTarget.setShouldRevert(true); + + bytes32 payloadId = createPayloadId( + executeParams.payloadPointer, + switchboardId, + TEST_CHAIN_SLUG + ); + + vm.expectEmit(true, true, true, true, address(socket)); + emit ExecutionFailed( + payloadId, + false, + abi.encodeWithSelector(MockPlug.CallFailed.selector) + ); + (bool success, ) = socket.execute{value: 1 ether}(executeParams, transmissionParams); + assertFalse(success, "Execution should fail"); + assertEq(mockTarget.counter(), 0, "Target should not be called"); + } + + function testExecuteWithExceededMaxCopyBytes() public { + // Set up mock target to return large data + executeParams.target = address(mockPlug); + executeParams.payload = abi.encodeWithSelector(mockPlug.returnLargeData.selector); + + (bool success, bytes memory returnData) = socket.execute{value: 1 ether}( + executeParams, + transmissionParams + ); + + // The return data should be truncated to maxCopyBytes (2048 bytes) + assertEq(returnData.length, 2048, "Return data should be exactly maxCopyBytes"); + assertLt(returnData.length, 3072, "Return data should be truncated"); + assertTrue(success, "Execution should succeed even with large return data"); + } + + function testExecutionRetryIfFailing() public { + executeParams.target = address(mockPlug); + executeParams.payload = abi.encodeWithSelector( + mockPlug.callMockTarget.selector, + address(mockTarget), + abi.encodeWithSelector(mockTarget.increment.selector) + ); + + bytes32 payloadId = createPayloadId( + executeParams.payloadPointer, + switchboardId, + TEST_CHAIN_SLUG + ); + + mockTarget.setShouldRevert(true); + vm.expectEmit(true, true, true, true, address(socket)); + emit ExecutionFailed( + payloadId, + false, + abi.encodeWithSelector(MockPlug.CallFailed.selector) + ); + (bool success, ) = socket.execute{value: 1 ether}(executeParams, transmissionParams); + assertFalse(success, "First execution should fail"); + + mockTarget.setShouldRevert(false); + vm.expectEmit(true, true, true, true, address(socket)); + emit ExecutionSuccess(payloadId, false, bytes(abi.encode(true))); + (success, ) = socket.execute{value: 1 ether}(executeParams, transmissionParams); + assertTrue(success, "Second execution should succeed"); + } + + function testGasUsageForExecute() public { + executeParams.target = address(mockPlug); + executeParams.payload = abi.encodeWithSelector( + mockPlug.callMockTarget.selector, + address(mockTarget), + abi.encodeWithSelector(mockTarget.increment.selector) + ); + + uint256 gasBefore = gasleft(); + socket.execute{value: 1 ether}(executeParams, transmissionParams); + uint256 gasUsed = gasBefore - gasleft(); + console.log("gasUsed", gasUsed); + } + + function testExecuteLowGasLimit() public { + // set high gas limit + executeParams.gasLimit = 10000000; + + vm.expectRevert(Socket.LowGasLimit.selector); + socket.execute{value: 1 ether, gas: 100000}(executeParams, transmissionParams); + } +} + +/** + * @title SocketTriggerTest + * @dev Tests for Socket triggerAppGateway function + */ +contract SocketTriggerTest is SocketTestBase { + function testTriggerAppGatewayPlugNotFound() public { + bytes memory triggerData = abi.encodeWithSelector( + mockPlug.processPayload.selector, + TEST_PAYLOAD + ); + + hoax(testUser); + vm.expectRevert(PlugNotFound.selector); + socket.triggerAppGateway{value: 1 ether}(triggerData); + } + + function testTriggerAppGatewayWithInvalidSwitchboard() public { + // Give mockPlug some funds + vm.deal(address(mockPlug), 10 ether); + + hoax(socketOwner); + socket.disableSwitchboard(switchboardId); + + bytes memory triggerData = abi.encodeWithSelector( + mockPlug.processPayload.selector, + TEST_PAYLOAD + ); + + vm.expectRevert(InvalidSwitchboard.selector); + hoax(address(mockPlug)); + socket.triggerAppGateway{value: 1 ether}(triggerData); + } + + function testGasUsageForTriggerAppGateway() public { + // Give mockPlug some funds + vm.deal(address(mockPlug), 10 ether); + + bytes memory triggerData = abi.encodeWithSelector( + mockPlug.processPayload.selector, + TEST_PAYLOAD + ); + + uint256 gasBefore = gasleft(); + hoax(address(mockPlug)); + socket.triggerAppGateway{value: 1 ether}(triggerData); + uint256 gasUsed = gasBefore - gasleft(); + + // Gas usage should be reasonable + console.log("gasUsed", gasUsed); + } +} + +/** + * @title SocketConnectDisconnectTest + * @dev Tests for Socket connect and disconnect functions + */ +contract SocketConnectDisconnectTest is SocketTestBase { + function testConnectWithInvalidSwitchboard() public { + vm.expectRevert(InvalidSwitchboard.selector); + mockPlug.initSocket(TEST_APP_GATEWAY_ID, address(socket), switchboardId + 1); + } + + function testConnectWithNewSwitchboard() public { + // Create a new switchboard + MockFastSwitchboard newSwitchboard = new MockFastSwitchboard( + TEST_CHAIN_SLUG, + address(socket), + socketOwner + ); + uint64 newSwitchboardId = newSwitchboard.registerSwitchboard(); + mockPlug.initSocket(TEST_APP_GATEWAY_ID, address(socket), newSwitchboardId); + + (bytes32 appGatewayId, uint64 switchboardId) = socket.getPlugConfig(address(mockPlug)); + assertEq(appGatewayId, TEST_APP_GATEWAY_ID, "App gateway ID should match"); + assertEq(switchboardId, newSwitchboardId, "Switchboard ID should match"); + } + + // Try to disconnect a plug that was never connected + function testDisconnectWithPlugNotConnected() public { + MockPlug newPlug = new MockPlug(); + newPlug.setSocket(address(socket)); + + vm.expectRevert(SocketConfig.PlugNotConnected.selector); + newPlug.disconnect(); + } +} + +/** + * @title SocketSwitchboardManagementTest + * @dev Tests for Socket switchboard management functions + */ +contract SocketSwitchboardManagementTest is SocketTestBase { + function testRegisterSwitchboardWithExistingSwitchboard() public { + assertEq(mockSwitchboard.switchboardId(), socket.switchboardIds(address(mockSwitchboard))); + + // Try to register the same switchboard again + vm.expectRevert(SocketConfig.SwitchboardExists.selector); + mockSwitchboard.registerSwitchboard(); + } + + function testDisableSwitchboardWithGovernanceRole() public { + hoax(socketOwner); + socket.disableSwitchboard(switchboardId); + + // Try to register the same switchboard again + vm.expectRevert(SocketConfig.SwitchboardExists.selector); + mockSwitchboard.registerSwitchboard(); + + assertEq( + uint256(socket.isValidSwitchboard(switchboardId)), + uint256(SwitchboardStatus.DISABLED), + "Switchboard should be disabled" + ); + } + + function testEnableSwitchboardWithGovernanceRole() public { + // First disable the switchboard + hoax(socketOwner); + socket.disableSwitchboard(switchboardId); + assertEq( + uint256(socket.isValidSwitchboard(switchboardId)), + uint256(SwitchboardStatus.DISABLED), + "Switchboard should be disabled" + ); + + // Then enable it + hoax(socketOwner); + socket.enableSwitchboard(switchboardId); + assertEq( + uint256(socket.isValidSwitchboard(switchboardId)), + uint256(SwitchboardStatus.REGISTERED), + "Switchboard should be enabled" + ); + } + + function testSwitchboardStatusValidation() public { + // Test initial status + assertEq( + uint256(socket.isValidSwitchboard(switchboardId)), + uint256(SwitchboardStatus.REGISTERED), + "Switchboard should be registered initially" + ); + + // Test disabled status + hoax(socketOwner); + socket.disableSwitchboard(switchboardId); + assertEq( + uint256(socket.isValidSwitchboard(switchboardId)), + uint256(SwitchboardStatus.DISABLED), + "Switchboard should be disabled" + ); + + // Test enabled status + hoax(socketOwner); + socket.enableSwitchboard(switchboardId); + + assertEq( + uint256(socket.isValidSwitchboard(switchboardId)), + uint256(SwitchboardStatus.REGISTERED), + "Switchboard should be enabled" + ); + } +} + +/** + * @title SocketSetterTest + * @dev Tests for Socket setter functions + */ +contract SocketSetterTest is SocketTestBase { + function testSetGasLimitBuffer() public { + uint256 newBuffer = 110; + + hoax(testUser); + vm.expectRevert(abi.encodeWithSelector(AccessControl.NoPermit.selector, GOVERNANCE_ROLE)); + socket.setGasLimitBuffer(newBuffer); + + hoax(socketOwner); + socket.setGasLimitBuffer(newBuffer); + + assertEq(socket.gasLimitBuffer(), newBuffer, "Gas limit buffer should be updated"); + } + + function testSetMaxCopyBytes() public { + uint16 newMaxCopyBytes = 4096; + + hoax(testUser); + vm.expectRevert(abi.encodeWithSelector(AccessControl.NoPermit.selector, GOVERNANCE_ROLE)); + socket.setMaxCopyBytes(newMaxCopyBytes); + + hoax(socketOwner); + socket.setMaxCopyBytes(newMaxCopyBytes); + assertEq(socket.maxCopyBytes(), newMaxCopyBytes, "Max copy bytes should be updated"); + } + + function testSetSocketFeeManager() public { + address newFeeManager = address(0x123); + + hoax(testUser); + vm.expectRevert(abi.encodeWithSelector(AccessControl.NoPermit.selector, GOVERNANCE_ROLE)); + socket.setSocketFeeManager(newFeeManager); + + hoax(socketOwner); + socket.setSocketFeeManager(newFeeManager); + assertEq( + address(socket.socketFeeManager()), + newFeeManager, + "Socket fee manager should be updated" + ); + } + + function testConfigurationValidation() public { + // Test initial configuration + assertEq(socket.gasLimitBuffer(), 105, "Initial gas limit buffer should be 105"); + assertEq(socket.maxCopyBytes(), 2048, "Initial max copy bytes should be 2048"); + assertEq( + address(socket.socketFeeManager()), + address(mockFeeManager), + "Initial fee manager should be mockFeeManager" + ); + + MockFeeManager newFeeManager = new MockFeeManager(); + // Test configuration updates + vm.startPrank(socketOwner); + socket.setGasLimitBuffer(120); + socket.setMaxCopyBytes(4096); + socket.setSocketFeeManager(address(newFeeManager)); + vm.stopPrank(); + + assertEq(socket.gasLimitBuffer(), 120, "Gas limit buffer should be updated"); + assertEq(socket.maxCopyBytes(), 4096, "Max copy bytes should be updated"); + assertEq( + address(socket.socketFeeManager()), + address(newFeeManager), + "Fee manager should be updated" + ); + } +} + +/** + * @title SocketDigestTest + * @dev Tests for digest creation functionality + */ +contract SocketDigestTest is SocketTestBase { + function testCreateDigestWithBasicPayload() public view { + ExecuteParams memory params = ExecuteParams({ + target: address(mockTarget), + value: 1 ether, + gasLimit: 100000, + deadline: block.timestamp + 3600, + callType: WRITE, + payload: TEST_PAYLOAD, + payloadPointer: uint160(1), + prevBatchDigestHash: bytes32(uint256(0)), + extraData: bytes("") + }); + + bytes32 digest = socketWrapper.createDigest( + transmitter, + bytes32(uint256(0x123)), + TEST_APP_GATEWAY_ID, + params + ); + + assertTrue(digest != bytes32(0), "Digest should not be zero"); + } + + function testCreateDigestWithLargePayload() public view { + bytes memory largePayload = new bytes(1000); + for (uint256 i = 0; i < 1000; i++) { + largePayload[i] = bytes1(uint8(i % 256)); + } + + ExecuteParams memory params = ExecuteParams({ + target: address(mockTarget), + value: 2 ether, + gasLimit: 200000, + deadline: block.timestamp + 7200, + callType: WRITE, + payload: largePayload, + payloadPointer: uint160(1), + prevBatchDigestHash: bytes32(uint256(0)), + extraData: bytes("") + }); + + bytes32 digest = socketWrapper.createDigest( + transmitter, + bytes32(uint256(0xdef)), + TEST_APP_GATEWAY_ID, + params + ); + + assertTrue(digest != bytes32(0), "Digest should not be zero"); + } + + function testCreateDigestWithDifferentTransmitters() public view { + ExecuteParams memory params = ExecuteParams({ + target: address(mockTarget), + value: 1 ether, + gasLimit: 100000, + deadline: block.timestamp + 3600, + callType: WRITE, + payload: TEST_PAYLOAD, + payloadPointer: uint160(1), + prevBatchDigestHash: bytes32(0), + extraData: bytes("") + }); + + bytes32 digest1 = socketWrapper.createDigest( + transmitter, + bytes32(uint256(0x123)), + TEST_APP_GATEWAY_ID, + params + ); + + bytes32 digest2 = socketWrapper.createDigest( + address(uint160(0x456)), + bytes32(uint256(0x123)), + TEST_APP_GATEWAY_ID, + params + ); + + assertTrue(digest1 != digest2, "Digests should be different for different transmitters"); + } + + function testCreateDigestWithDifferentPayloads() public view { + ExecuteParams memory params1 = ExecuteParams({ + target: address(mockTarget), + value: 1 ether, + gasLimit: 100000, + deadline: block.timestamp + 3600, + callType: WRITE, + payload: TEST_PAYLOAD, + payloadPointer: uint160(1), + prevBatchDigestHash: bytes32(0), + extraData: bytes("") + }); + + ExecuteParams memory params2 = ExecuteParams({ + target: address(mockTarget), + value: 1 ether, + gasLimit: 100000, + deadline: block.timestamp + 3600, + callType: WRITE, + payload: hex"abcdef", + payloadPointer: uint160(1), + prevBatchDigestHash: bytes32(0), + extraData: bytes("") + }); + + bytes32 digest1 = socketWrapper.createDigest( + transmitter, + bytes32(uint256(0x123)), + TEST_APP_GATEWAY_ID, + params1 + ); + + bytes32 digest2 = socketWrapper.createDigest( + transmitter, + bytes32(uint256(0x123)), + TEST_APP_GATEWAY_ID, + params2 + ); + + assertTrue(digest1 != digest2, "Digests should be different for different payloads"); + } +} + +/** + * @title SocketTriggerIdTest + * @dev Tests for trigger ID encoding and uniqueness + */ +contract SocketTriggerIdTest is SocketTestBase { + function testEncodeTriggerIdIncrementsCounter() public { + bytes32 triggerId1 = socketWrapper.encodeTriggerId(); + bytes32 triggerId2 = socketWrapper.encodeTriggerId(); + bytes32 triggerId3 = socketWrapper.encodeTriggerId(); + + assertTrue(triggerId1 != triggerId2, "Trigger IDs should be different"); + assertTrue(triggerId2 != triggerId3, "Trigger IDs should be different"); + assertTrue(triggerId1 != triggerId3, "Trigger IDs should be different"); + } + + function testTriggerIdUniqueness() public { + bytes32[] memory triggerIds = new bytes32[](100); + + for (uint256 i = 0; i < 100; i++) { + triggerIds[i] = socketWrapper.encodeTriggerId(); + } + + // Check for uniqueness + for (uint256 i = 0; i < 100; i++) { + for (uint256 j = i + 1; j < 100; j++) { + assertTrue(triggerIds[i] != triggerIds[j], "Trigger IDs should be unique"); + assertEq( + uint32(uint256(triggerIds[i]) >> 224), + TEST_CHAIN_SLUG, + "Chain slug should match" + ); + assertEq( + address(uint160(uint256(triggerIds[i]) >> 64)), + address(socketWrapper), + "Socket address should match" + ); + assertEq(uint64(uint256(triggerIds[i])), i, "Counter should increment"); + } + } + } + + function testTriggerIdFormatFuzz(uint64 counter) public { + vm.assume(counter < type(uint64).max - 1000); + + // Set the counter to a specific value + uint256 counterSlot = uint256(57); + vm.store(address(socketWrapper), bytes32(counterSlot), bytes32(uint256(counter))); + + bytes32 triggerId = socketWrapper.encodeTriggerId(); + uint32 chainSlugFromId = uint32(uint256(triggerId) >> 224); + address socketAddressFromId = address(uint160(uint256(triggerId) >> 64)); + uint64 counterFromId = uint64(uint256(triggerId)); + + assertEq(chainSlugFromId, TEST_CHAIN_SLUG, "Chain slug should match"); + assertEq(socketAddressFromId, address(socketWrapper), "Socket address should match"); + assertEq(counterFromId, counter, "Counter should match"); + } +} + +/** + * @title SocketSimulationTest + * @dev Tests for simulation functionality + */ +contract SocketSimulationTest is SocketTestBase { + function testSimulationModifier() public { + SocketUtils.SimulateParams[] memory params = new SocketUtils.SimulateParams[](1); + params[0] = SocketUtils.SimulateParams({ + target: address(mockTarget), + value: 1 ether, + gasLimit: 100000, + payload: TEST_PAYLOAD + }); + + // Should revert when called by non-off-chain caller + vm.expectRevert(SocketUtils.OnlyOffChain.selector); + socket.simulate(params); + } +} + +/** + * @title SocketRescueTest + * @dev Tests for rescue functionality + */ +contract SocketRescueTest is SocketTestBase { + function testRescueFunds() public { + // Send some ETH to the socket + vm.deal(address(socket), 10 ether); + uint256 balanceBefore = testUser.balance; + + hoax(socketOwner); + socket.rescueFunds(ETH_ADDRESS, testUser, 5 ether); + + uint256 balanceAfter = testUser.balance; + assertEq(balanceAfter - balanceBefore, 5 ether, "User should receive rescued ETH"); + } + + function testRescueFundsWithNonRescueRole() public { + vm.deal(address(socket), 10 ether); + + hoax(testUser); + vm.expectRevert(abi.encodeWithSelector(AccessControl.NoPermit.selector, RESCUE_ROLE)); + socket.rescueFunds(address(0), testUser, 5 ether); + } + + function testRescueTokenFunds() public { + // Transfer some tokens to the socket + hoax(address(socket)); + mockToken.mint(address(socket), 1000); + uint256 balanceBefore = mockToken.balanceOf(testUser); + + hoax(socketOwner); + socket.rescueFunds(address(mockToken), testUser, 500); + + uint256 balanceAfter = mockToken.balanceOf(testUser); + assertEq(balanceAfter - balanceBefore, 500, "User should receive rescued tokens"); + } + + function testSendingEthToSocket() public { + vm.expectRevert("Socket does not accept ETH"); + address(socket).call{value: 1 ether}(""); + } + + function testRescueNFT() public { + // Deploy a mock ERC721 NFT and mint one to this test contract + MockERC721 mockNFT = new MockERC721(); + uint256 tokenId = 1; + mockNFT.mint(address(socket), tokenId); + assertEq(mockNFT.ownerOf(tokenId), address(socket), "Socket should own the NFT"); + + hoax(socketOwner); + socket.rescueFunds(address(mockNFT), testUser, tokenId); + + // Check that testUser received the NFT + assertEq(mockNFT.ownerOf(tokenId), testUser, "User should receive rescued NFT"); + } +} + +/** + * @title SocketFeeManagerTest + * @dev Tests for fee manager functionality + */ +contract SocketFeeManagerTest is SocketTestBase { + function testFeeCollectedIfExecutionSuccess() public { + // Set up execution parameters with fees + executeParams.gasLimit = 100000; + transmissionParams.socketFees = 0.1 ether; + executeParams.target = address(mockPlug); + executeParams.payload = abi.encodeWithSelector( + mockPlug.processPayload.selector, + TEST_PAYLOAD + ); + + // Execute with fees + socket.execute{value: 1.1 ether}(executeParams, transmissionParams); + + // Check that fees were collected + assertEq(address(mockFeeManager).balance, 0.1 ether, "Fee manager should receive fees"); + } + + function testGasUsage() public { + executeParams.gasLimit = 100000; + transmissionParams.socketFees = 0.1 ether; + + // mockSwitchboard.setTransmitter(transmitter); + + uint256 gasBefore = gasleft(); + + vm.deal(testUser, 2 ether); + hoax(testUser); + socket.execute{value: 1.1 ether}(executeParams, transmissionParams); + + uint256 gasUsed = gasBefore - gasleft(); + console.log("Gas used for execution with fees:", gasUsed); + + assertTrue(gasUsed > 0, "Gas should be used"); + } + + function testFeeManagerNotSet() public { + // Remove fee manager + hoax(socketOwner); + socket.setSocketFeeManager(address(0)); + + executeParams.gasLimit = 100000; + transmissionParams.socketFees = 0.1 ether; + + // mockSwitchboard.setTransmitter(transmitter); + + // Should still execute successfully without fee manager + vm.deal(testUser, 2 ether); + hoax(testUser); + socket.execute{value: 1.1 ether}(executeParams, transmissionParams); + + // No fees should be collected + assertEq( + address(mockFeeManager).balance, + 0, + "No fees should be collected when fee manager is not set" + ); + } +} From 918b71a8821c47f8e2116fc1ff87fc937f64a9d9 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 31 Jul 2025 14:20:52 +0530 Subject: [PATCH 066/139] test: utils --- test/Utils.t.sol | 149 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 test/Utils.t.sol diff --git a/test/Utils.t.sol b/test/Utils.t.sol new file mode 100644 index 00000000..7cba44a8 --- /dev/null +++ b/test/Utils.t.sol @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import "forge-std/Test.sol"; +import "../contracts/utils/common/IdUtils.sol"; +import "../contracts/utils/common/Converters.sol"; + +/** + * @title IdUtilsTest + * @dev Tests for IdUtils utility functions + */ +contract IdUtilsTest is Test { + function testCreatePayloadId() public { + uint160 payloadPointer = 12345; + uint64 switchboardId = 67890; + uint32 chainSlug = 1; + + bytes32 payloadId = createPayloadId(payloadPointer, switchboardId, chainSlug); + + // Verify the structure + uint32 chainSlugFromId = uint32(uint256(payloadId) >> 224); + uint64 switchboardIdFromId = uint64(uint256(payloadId) >> 160); + uint160 payloadPointerFromId = uint160(uint256(payloadId)); + + assertEq(chainSlugFromId, chainSlug, "Chain slug should match"); + assertEq(switchboardIdFromId, switchboardId, "Switchboard ID should match"); + assertEq(payloadPointerFromId, payloadPointer, "Payload pointer should match"); + } + + function testCreatePayloadIdWithZeroValues() public { + bytes32 payloadId = createPayloadId(0, 0, 0); + + assertEq(payloadId, bytes32(0), "Payload ID should be zero for zero inputs"); + } + + function testCreatePayloadIdWithMaxValues() public { + uint160 maxPayloadPointer = type(uint160).max; + uint64 maxSwitchboardId = type(uint64).max; + uint32 maxChainSlug = type(uint32).max; + + bytes32 payloadId = createPayloadId(maxPayloadPointer, maxSwitchboardId, maxChainSlug); + + // Verify the structure + uint32 chainSlugFromId = uint32(uint256(payloadId) >> 224); + uint64 switchboardIdFromId = uint64(uint256(payloadId) >> 160); + uint160 payloadPointerFromId = uint160(uint256(payloadId)); + + assertEq(chainSlugFromId, maxChainSlug, "Chain slug should match"); + assertEq(switchboardIdFromId, maxSwitchboardId, "Switchboard ID should match"); + assertEq(payloadPointerFromId, maxPayloadPointer, "Payload pointer should match"); + } + + function testCreatePayloadIdFuzz( + uint160 payloadPointer, + uint64 switchboardId, + uint32 chainSlug + ) public { + bytes32 payloadId = createPayloadId(payloadPointer, switchboardId, chainSlug); + + // Verify the structure + uint32 chainSlugFromId = uint32(uint256(payloadId) >> 224); + uint64 switchboardIdFromId = uint64(uint256(payloadId) >> 160); + uint160 payloadPointerFromId = uint160(uint256(payloadId)); + + assertEq(chainSlugFromId, chainSlug, "Chain slug should match"); + assertEq(switchboardIdFromId, switchboardId, "Switchboard ID should match"); + assertEq(payloadPointerFromId, payloadPointer, "Payload pointer should match"); + } +} + +/** + * @title ConvertersTest + * @dev Tests for Converters utility functions + */ +contract ConvertersTest is Test { + function testToBytes32Format() public { + address testAddr = address(0x1234567890123456789012345678901234567890); + bytes32 result = toBytes32Format(testAddr); + + assertEq(result, bytes32(uint256(uint160(testAddr))), "Conversion should be correct"); + } + + function testToBytes32FormatWithZeroAddress() public { + bytes32 result = toBytes32Format(address(0)); + + assertEq(result, bytes32(0), "Zero address should convert to zero bytes32"); + } + + function testFromBytes32Format() public { + address originalAddr = address(0x1234567890123456789012345678901234567890); + bytes32 bytes32Format = toBytes32Format(originalAddr); + + address convertedAddr = fromBytes32Format(bytes32Format); + + assertEq(convertedAddr, originalAddr, "Conversion should be reversible"); + } + + function testFromBytes32FormatWithZeroAddress() public { + bytes32 zeroBytes32 = bytes32(0); + address convertedAddr = fromBytes32Format(zeroBytes32); + + assertEq(convertedAddr, address(0), "Zero bytes32 should convert to zero address"); + } + + function testFromBytes32FormatWithInvalidAddress() public { + // Create a bytes32 with non-zero upper bits + bytes32 invalidBytes32 = bytes32(uint256(1) << 160); + + try this.fromBytes32FormatWrapper(invalidBytes32) { + fail(); + } catch { + // Expected to revert + } + } + + function fromBytes32FormatWrapper( + bytes32 bytes32FormatAddress + ) external pure returns (address) { + return fromBytes32Format(bytes32FormatAddress); + } + + function testFromBytes32FormatWithMaxValidAddress() public { + address maxAddr = address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF); + bytes32 bytes32Format = toBytes32Format(maxAddr); + + address convertedAddr = fromBytes32Format(bytes32Format); + + assertEq(convertedAddr, maxAddr, "Max address should convert correctly"); + } + + function testConvertersRoundTrip() public { + address originalAddr = address(0xabCDEF1234567890ABcDEF1234567890aBCDeF12); + + bytes32 bytes32Format = toBytes32Format(originalAddr); + address convertedAddr = fromBytes32Format(bytes32Format); + + assertEq(convertedAddr, originalAddr, "Round trip conversion should work"); + } + + function testConvertersFuzz(address addr) public { + // Skip addresses that would cause overflow + vm.assume(uint256(uint160(addr)) <= type(uint160).max); + + bytes32 bytes32Format = toBytes32Format(addr); + address convertedAddr = fromBytes32Format(bytes32Format); + + assertEq(convertedAddr, addr, "Fuzz test should pass"); + } +} From 8c00261fc8a2dcabe117575fa8c4f8ae96c96f73 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 31 Jul 2025 17:21:48 +0530 Subject: [PATCH 067/139] fix: rescue nft --- contracts/utils/RescueFundsLib.sol | 25 +++++++++- test/SetupTest.t.sol | 42 +++++++++++----- test/apps/ParallelCounter.t.sol | 78 ++++++++++++++++++------------ 3 files changed, 100 insertions(+), 45 deletions(-) diff --git a/contracts/utils/RescueFundsLib.sol b/contracts/utils/RescueFundsLib.sol index 738ec796..d2921df9 100644 --- a/contracts/utils/RescueFundsLib.sol +++ b/contracts/utils/RescueFundsLib.sol @@ -5,6 +5,19 @@ import "solady/utils/SafeTransferLib.sol"; import {ZeroAddress, InvalidTokenAddress} from "./common/Errors.sol"; import {ETH_ADDRESS} from "./common/Constants.sol"; +interface IERC721 { + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external; +} + +interface IERC165 { + function supportsInterface(bytes4 interfaceId) external view returns (bool); +} + /** * @title RescueFundsLib * @dev A library that provides a function to rescue funds from a contract. @@ -23,7 +36,17 @@ library RescueFundsLib { SafeTransferLib.forceSafeTransferETH(rescueTo_, amount_); } else { if (token_.code.length == 0) revert InvalidTokenAddress(); - SafeTransferLib.safeTransfer(token_, rescueTo_, amount_); + + // Identify if a token is an NFT (ERC721) by checking if it supports the ERC721 interface + try IERC165(token_).supportsInterface(0x80ac58cd) returns (bool isERC721) { + if (isERC721) + IERC721(token_).safeTransferFrom(address(this), rescueTo_, amount_, ""); + else { + SafeTransferLib.safeTransfer(token_, rescueTo_, amount_); + } + } catch { + SafeTransferLib.safeTransfer(token_, rescueTo_, amount_); + } } } } diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 303935a2..434f6f46 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -1130,21 +1130,45 @@ contract WatcherSetup is AuctionSetup { ) internal { // Count valid plugs first. In some cases we might have contractIds such that oly a subset is // deployed on a chain. for ex, vault on source, and supertoken on destination. - uint256 validPlugCount = 0; + uint256 validPlugCount = _countValidPlugs(appGateway_, contractIds_, chainSlug_); + + // Create array with exact size needed + AppGatewayConfig[] memory configs = new AppGatewayConfig[](validPlugCount); + _populateConfigs(configs, appGateway_, contractIds_, chainSlug_); + + // Only call watcher if we have valid configs + if (validPlugCount > 0) { + watcherMultiCall( + address(configurations), + abi.encodeWithSelector(Configurations.setAppGatewayConfigs.selector, configs) + ); + } + } + + function _countValidPlugs( + IAppGateway appGateway_, + bytes32[] memory contractIds_, + uint32 chainSlug_ + ) internal view returns (uint256 validCount) { for (uint i = 0; i < contractIds_.length; i++) { bytes32 plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); if (plug != bytes32(0)) { - validPlugCount++; + validCount++; } } + } - // Create array with exact size needed - AppGatewayConfig[] memory configs = new AppGatewayConfig[](validPlugCount); + function _populateConfigs( + AppGatewayConfig[] memory configs, + IAppGateway appGateway_, + bytes32[] memory contractIds_, + uint32 chainSlug_ + ) internal view { uint256 configIndex = 0; + uint64 switchboardId = configurations.switchboards(chainSlug_, appGateway_.sbType()); for (uint i = 0; i < contractIds_.length; i++) { bytes32 plug = appGateway_.getOnChainAddress(contractIds_[i], chainSlug_); - uint64 switchboardId = configurations.switchboards(chainSlug_, appGateway_.sbType()); if (plug != bytes32(0)) { configs[configIndex] = AppGatewayConfig({ plug: plug, @@ -1157,14 +1181,6 @@ contract WatcherSetup is AuctionSetup { configIndex++; } } - - // Only call watcher if we have valid configs - if (validPlugCount > 0) { - watcherMultiCall( - address(configurations), - abi.encodeWithSelector(Configurations.setAppGatewayConfigs.selector, configs) - ); - } } } diff --git a/test/apps/ParallelCounter.t.sol b/test/apps/ParallelCounter.t.sol index 51763bb3..b71587fd 100644 --- a/test/apps/ParallelCounter.t.sol +++ b/test/apps/ParallelCounter.t.sol @@ -37,6 +37,11 @@ contract ParallelCounterTest is AppGatewayBaseSetup { chainSlugs[1] = optChainSlug; deployCounterApp(chainSlugs); + // Break down into smaller functions to avoid stack too deep + _testForwarderAddresses(); + } + + function _testForwarderAddresses() internal view { (bytes32 onChainArb1, address forwarderArb1) = getOnChainAndForwarderAddresses( arbChainSlug, counterId1, @@ -61,44 +66,55 @@ contract ParallelCounterTest is AppGatewayBaseSetup { parallelCounterGateway ); - assertEq( - IForwarder(forwarderArb1).getChainSlug(), - arbChainSlug, - "Forwarder chainSlug should be correct" - ); - assertEq( - IForwarder(forwarderArb1).getOnChainAddress(), + _assertForwarderAddresses( + forwarderArb1, onChainArb1, - "Forwarder onChainAddress should be correct" - ); - assertEq( - IForwarder(forwarderOpt1).getChainSlug(), - optChainSlug, - "Forwarder chainSlug should be correct" - ); - assertEq( - IForwarder(forwarderOpt1).getOnChainAddress(), - onChainOpt1, - "Forwarder onChainAddress should be correct" - ); - assertEq( - IForwarder(forwarderArb2).getChainSlug(), arbChainSlug, - "Forwarder chainSlug should be correct" - ); - assertEq( - IForwarder(forwarderArb2).getOnChainAddress(), + forwarderOpt1, + onChainOpt1, + optChainSlug, + forwarderArb2, onChainArb2, - "Forwarder onChainAddress should be correct" + arbChainSlug, + forwarderOpt2, + onChainOpt2, + optChainSlug ); + } + + function _assertForwarderAddresses( + address forwarderArb1, + bytes32 onChainArb1, + uint32 arbChainSlug, + address forwarderOpt1, + bytes32 onChainOpt1, + uint32 optChainSlug, + address forwarderArb2, + bytes32 onChainArb2, + uint32 arbChainSlug2, + address forwarderOpt2, + bytes32 onChainOpt2, + uint32 optChainSlug2 + ) internal view { + _assertForwarderAddress(forwarderArb1, onChainArb1, arbChainSlug); + _assertForwarderAddress(forwarderOpt1, onChainOpt1, optChainSlug); + _assertForwarderAddress(forwarderArb2, onChainArb2, arbChainSlug2); + _assertForwarderAddress(forwarderOpt2, onChainOpt2, optChainSlug2); + } + + function _assertForwarderAddress( + address forwarder, + bytes32 onChainAddress, + uint32 chainSlug + ) internal view { assertEq( - IForwarder(forwarderOpt2).getOnChainAddress(), - onChainOpt2, - "Forwarder onChainAddress should be correct" + IForwarder(forwarder).getChainSlug(), + chainSlug, + "Forwarder chainSlug should be correct" ); assertEq( - IForwarder(forwarderOpt2).getOnChainAddress(), - onChainOpt2, + IForwarder(forwarder).getOnChainAddress(), + onChainAddress, "Forwarder onChainAddress should be correct" ); } From c6b8b8506a7de80a4b0e9471b7463a7690c2fc56 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 15:03:37 +0530 Subject: [PATCH 068/139] test: memory to storage --- contracts/protocol/Socket.sol | 7 +++---- test/Socket.t.sol | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index f08e44cc..57e5e05e 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -67,7 +67,7 @@ contract Socket is SocketUtils { // check if the call type is valid if (executeParams_.callType != WRITE) revert InvalidCallType(); - PlugConfigEvm memory plugConfig = _plugConfigs[executeParams_.target]; + PlugConfigEvm storage plugConfig = _plugConfigs[executeParams_.target]; // check if the plug is disconnected if (plugConfig.appGatewayId == bytes32(0)) revert PlugNotFound(); @@ -157,9 +157,8 @@ contract Socket is SocketUtils { } else { payloadExecuted[payloadId_] = ExecutionStatus.Reverted; - address receiver = transmissionParams_.refundAddress == address(0) - ? msg.sender - : transmissionParams_.refundAddress; + address receiver = transmissionParams_.refundAddress; + if (receiver == address(0)) receiver = msg.sender; SafeTransferLib.forceSafeTransferETH(receiver, msg.value); emit ExecutionFailed(payloadId_, exceededMaxCopy, returnData); } diff --git a/test/Socket.t.sol b/test/Socket.t.sol index 190cdcb3..10bcf4e0 100644 --- a/test/Socket.t.sol +++ b/test/Socket.t.sol @@ -869,7 +869,7 @@ contract SocketRescueTest is SocketTestBase { function testSendingEthToSocket() public { vm.expectRevert("Socket does not accept ETH"); - address(socket).call{value: 1 ether}(""); + (bool success, ) = address(socket).call{value: 1 ether}(""); } function testRescueNFT() public { From 72d02cef592c63821581c98fd65ebe1dae1f1669 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 16:34:29 +0530 Subject: [PATCH 069/139] fix: use init socket to initialise plugs --- hardhat-scripts/deploy/6.connect.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hardhat-scripts/deploy/6.connect.ts b/hardhat-scripts/deploy/6.connect.ts index 32975a63..031e12b9 100644 --- a/hardhat-scripts/deploy/6.connect.ts +++ b/hardhat-scripts/deploy/6.connect.ts @@ -1,9 +1,8 @@ -import { ethers, Wallet } from "ethers"; +import { Wallet } from "ethers"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; import { chains, EVMX_CHAIN_ID, mode } from "../config"; import { AppGatewayConfig, DeploymentAddresses } from "../constants"; import { - checkIfAddressExists, checkIfAppGatewayIdExists, getAddresses, getAppGatewayId, @@ -56,7 +55,12 @@ async function connectPlug( } // Connect the plug - const tx = await plug.functions["connectSocket"]( + let functionName = "initSocket"; + + const isInitialized = await plug.isSocketInitialized(); + if (isInitialized.toNumber() === 1) functionName = "connectSocket"; + + const tx = await plug.functions[functionName]( appGatewayId, socket.address, switchboardId, From 25b1954c184cf12e93f08cfa0579657b7d7b47ad Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 16:55:35 +0530 Subject: [PATCH 070/139] doc: natspecs --- contracts/protocol/Socket.sol | 73 +++++++++++------ contracts/protocol/SocketBatcher.sol | 14 +++- contracts/protocol/SocketConfig.sol | 78 +++++++++++++------ contracts/protocol/SocketFeeManager.sol | 26 ++++++- contracts/protocol/SocketUtils.sol | 45 +++++++---- contracts/protocol/base/PlugBase.sol | 17 ++++ .../protocol/interfaces/ICCTPSwitchboard.sol | 10 ++- .../protocol/interfaces/IMessageHandler.sol | 10 +-- .../interfaces/IMessageTransmitter.sol | 25 ++++++ contracts/protocol/interfaces/IPlug.sol | 1 + contracts/protocol/interfaces/ISocket.sol | 52 ++++++++++--- .../protocol/interfaces/ISocketBatcher.sol | 4 +- .../protocol/interfaces/ISocketFeeManager.sol | 14 ++-- .../protocol/interfaces/ISwitchboard.sol | 2 + .../protocol/switchboard/FastSwitchboard.sol | 3 + .../protocol/switchboard/SwitchboardBase.sol | 14 ++++ 16 files changed, 298 insertions(+), 90 deletions(-) diff --git a/contracts/protocol/Socket.sol b/contracts/protocol/Socket.sol index 57e5e05e..4d4b2257 100644 --- a/contracts/protocol/Socket.sol +++ b/contracts/protocol/Socket.sol @@ -14,30 +14,22 @@ import {createPayloadId} from "../utils/common/IdUtils.sol"; contract Socket is SocketUtils { using LibCall for address; - // @notice mapping of payload id to execution status + // mapping of payload id to execution status mapping(bytes32 => ExecutionStatus) public payloadExecuted; - // @notice mapping of payload id to execution status + // mapping of payload id to digest mapping(bytes32 => bytes32) public payloadIdToDigest; //////////////////////////////////////////////////////// ////////////////////// ERRORS ////////////////////////// //////////////////////////////////////////////////////// - /** - * @dev Error emitted when a payload has already been executed - */ + /// @notice Thrown when a payload has already been executed error PayloadAlreadyExecuted(ExecutionStatus status); - /** - * @dev Error emitted when verification fails - */ + /// @notice Thrown when verification fails error VerificationFailed(); - /** - * @dev Error emitted when less gas limit is provided for execution than expected - */ + /// @notice Thrown when less gas limit is provided for execution than expected error LowGasLimit(); - /** - * @dev Error emitted when the message value is insufficient - */ + /// @notice Thrown when the message value is insufficient error InsufficientMsgValue(); /** @@ -56,6 +48,10 @@ contract Socket is SocketUtils { /** * @notice Executes a payload that has been delivered by transmitters and authenticated by switchboards + * @param executeParams_ The execution parameters + * @param transmissionParams_ The transmission parameters + * @return success True if the payload was executed successfully + * @return returnData The return data from the execution */ function execute( ExecuteParams calldata executeParams_, @@ -67,10 +63,11 @@ contract Socket is SocketUtils { // check if the call type is valid if (executeParams_.callType != WRITE) revert InvalidCallType(); + // check if the plug is connected PlugConfigEvm storage plugConfig = _plugConfigs[executeParams_.target]; - // check if the plug is disconnected if (plugConfig.appGatewayId == bytes32(0)) revert PlugNotFound(); + // check if the message value is sufficient if (msg.value < executeParams_.value + transmissionParams_.socketFees) revert InsufficientMsgValue(); @@ -85,12 +82,21 @@ contract Socket is SocketUtils { // verify the digest _verify(payloadId, plugConfig, executeParams_, transmissionParams_.transmitterProof); + + // execute the payload return _execute(payloadId, executeParams_, transmissionParams_); } //////////////////////////////////////////////////////// ////////////////// INTERNAL FUNCS ////////////////////// //////////////////////////////////////////////////////// + /** + * @notice Verifies the digest of the payload + * @param payloadId_ The id of the payload + * @param plugConfig_ The plug configuration + * @param executeParams_ The execution parameters (appGatewayId, value, payloadPointer, callType, gasLimit) + * @param transmitterProof_ The transmitter proof + */ function _verify( bytes32 payloadId_, PlugConfigEvm memory plugConfig_, @@ -123,9 +129,10 @@ contract Socket is SocketUtils { } /** - * This function assumes localPlug_ will have code while executing. As the payload - * execution failure is not blocking the system, it is not necessary to check if - * code exists in the given address. + * @notice Executes the payload + * @param payloadId_ The id of the payload + * @param executeParams_ The execution parameters (appGatewayId, value, payloadPointer, callType, gasLimit) + * @param transmissionParams_ The transmission parameters (socketFees, transmitterProof, refundAddress) */ function _execute( bytes32 payloadId_, @@ -148,6 +155,7 @@ contract Socket is SocketUtils { if (success) { emit ExecutionSuccess(payloadId_, exceededMaxCopy, returnData); + // pay and check fees if (address(socketFeeManager) != address(0)) { socketFeeManager.payAndCheckFees{value: transmissionParams_.socketFees}( executeParams_, @@ -157,6 +165,7 @@ contract Socket is SocketUtils { } else { payloadExecuted[payloadId_] = ExecutionStatus.Reverted; + // refund the fees address receiver = transmissionParams_.refundAddress; if (receiver == address(0)) receiver = msg.sender; SafeTransferLib.forceSafeTransferETH(receiver, msg.value); @@ -165,8 +174,11 @@ contract Socket is SocketUtils { return (success, returnData); } - /// @notice Validates the execution status of a payload - /// @dev This function can be retried till execution status is executed + /** + * @notice Validates the execution status of a payload + * @dev This function can be retried till execution status is executed + * @param payloadId_ The id of the payload + */ function _validateExecutionStatus(bytes32 payloadId_) internal { if (payloadExecuted[payloadId_] == ExecutionStatus.Executed) revert PayloadAlreadyExecuted(payloadExecuted[payloadId_]); @@ -178,13 +190,21 @@ contract Socket is SocketUtils { ////////////////////// Trigger ////////////////////// //////////////////////////////////////////////////////// - /// @notice To trigger to a connected remote chain. Should only be called by a plug. + /** + * @notice To trigger to a connected remote chain. Should only be called by a plug. + * @param data_ The data to trigger the app gateway + * @return triggerId The id of the trigger + */ function triggerAppGateway(bytes calldata data_) external payable returns (bytes32 triggerId) { triggerId = _triggerAppGateway(msg.sender, msg.value, data_); } /** * @notice To trigger to a connected remote chain. Should only be called by a plug. + * @param plug_ The address of the plug + * @param value_ The value to trigger the app gateway + * @param data_ The data to trigger the app gateway + * @return triggerId The id of the trigger */ function _triggerAppGateway( address plug_, @@ -219,14 +239,19 @@ contract Socket is SocketUtils { ); } - /// @notice Fallback function that forwards all calls to Socket's callAppGateway - /// @dev The calldata is passed as-is to the gateways + /** + * @notice Fallback function that forwards all calls to Socket's callAppGateway + * @dev The calldata is passed as-is to the gateways + * @return The trigger id + */ fallback(bytes calldata) external payable returns (bytes memory) { // return the trigger id return abi.encode(_triggerAppGateway(msg.sender, msg.value, msg.data)); } - /// @notice Receive function that forwards all calls to Socket's callAppGateway + /** + * @notice Sending ETH to the socket will revert + */ receive() external payable { revert("Socket does not accept ETH"); } diff --git a/contracts/protocol/SocketBatcher.sol b/contracts/protocol/SocketBatcher.sol index 85710e77..1ed5a359 100644 --- a/contracts/protocol/SocketBatcher.sol +++ b/contracts/protocol/SocketBatcher.sol @@ -10,13 +10,17 @@ import "../utils/RescueFundsLib.sol"; import {ExecuteParams, TransmissionParams, CCTPBatchParams, CCTPExecutionParams} from "../utils/common/Structs.sol"; import {createPayloadId} from "../utils/common/IdUtils.sol"; +/** + * @title IFastSwitchboard + * @notice Interface for the fast switchboard + */ interface IFastSwitchboard is ISwitchboard { function attest(bytes32 digest_, bytes calldata proof_) external; } /** * @title SocketBatcher - * @notice The SocketBatcher contract is responsible for batching payloads and transmitting them to the destination chain + * @notice The SocketBatcher contract is responsible for batching payloads and executing them on the socket */ contract SocketBatcher is ISocketBatcher, Ownable { // socket contract @@ -61,6 +65,14 @@ contract SocketBatcher is ISocketBatcher, Ownable { ); } + /** + * @notice Attests a CCTP payload and proves and executes it + * @param execParams_ The execution parameters + * @param cctpParams_ The CCTP parameters + * @param switchboardId_ The switchboard id + * @return success True if the payload was executed successfully + * @return returnData The return data from the execution + */ function attestCCTPAndProveAndExecute( CCTPExecutionParams calldata execParams_, CCTPBatchParams calldata cctpParams_, diff --git a/contracts/protocol/SocketConfig.sol b/contracts/protocol/SocketConfig.sol index a9c0e2ed..990003f4 100644 --- a/contracts/protocol/SocketConfig.sol +++ b/contracts/protocol/SocketConfig.sol @@ -55,23 +55,38 @@ abstract contract SocketConfig is ISocket, AccessControl { event SwitchboardEnabled(uint64 switchboardId); // @notice event triggered when a socket fee manager is updated event SocketFeeManagerUpdated(address oldSocketFeeManager, address newSocketFeeManager); + // @notice event triggered when the gas limit buffer is updated + event GasLimitBufferUpdated(uint256 gasLimitBuffer); + // @notice event triggered when the max copy bytes is updated + event MaxCopyBytesUpdated(uint16 maxCopyBytes); - // @notice function to register a switchboard - // @dev only callable by switchboards + /** + * @notice Registers a switchboard on the socket + * @dev This function is called by the switchboard to register itself on the socket + * @dev This function will revert if the switchboard already exists + * @return switchboardId The id of the switchboard + */ function registerSwitchboard() external returns (uint64 switchboardId) { switchboardId = switchboardIds[msg.sender]; if (switchboardId != 0) revert SwitchboardExists(); + // increment the switchboard id counter switchboardId = switchboardIdCounter++; + + // set the switchboard id and address switchboardIds[msg.sender] = switchboardId; switchboardAddresses[switchboardId] = msg.sender; - isValidSwitchboard[switchboardId] = SwitchboardStatus.REGISTERED; + // set the switchboard status to registered + isValidSwitchboard[switchboardId] = SwitchboardStatus.REGISTERED; emit SwitchboardAdded(msg.sender, switchboardId); } - // @notice function to disable a switchboard - // @dev only callable by governance role + /** + * @notice Disables a switchboard + * @dev This function is called by the governance role to disable a switchboard + * @param switchboardId_ The id of the switchboard to disable + */ function disableSwitchboard( uint64 switchboardId_ ) external onlyRole(SWITCHBOARD_DISABLER_ROLE) { @@ -79,25 +94,32 @@ abstract contract SocketConfig is ISocket, AccessControl { emit SwitchboardDisabled(switchboardId_); } - // @notice function to enable a switchboard if disabled - // @dev only callable by governance role + /** + * @notice Enables a switchboard if disabled + * @dev This function is called by the governance role to enable a switchboard + * @param switchboardId_ The id of the switchboard to enable + */ function enableSwitchboard(uint64 switchboardId_) external onlyRole(GOVERNANCE_ROLE) { isValidSwitchboard[switchboardId_] = SwitchboardStatus.REGISTERED; emit SwitchboardEnabled(switchboardId_); } - // @notice function to set the socket fee manager - // @dev only callable by governance role - // @param socketFeeManager_ address of the socket fee manager + /** + * @notice Sets the socket fee manager + * @dev This function is called by the governance role to set the socket fee manager + * @param socketFeeManager_ The address of the socket fee manager + */ function setSocketFeeManager(address socketFeeManager_) external onlyRole(GOVERNANCE_ROLE) { socketFeeManager = ISocketFeeManager(socketFeeManager_); emit SocketFeeManagerUpdated(address(socketFeeManager), socketFeeManager_); } - // @notice function to connect a plug to socket - // @dev only callable by plug - // @param appGatewayId_ app gateway id - // @param switchboardId_ switchboard id + /** + * @notice Connects a plug to socket + * @dev This function is called by the plug to connect itself to the socket + * @param appGatewayId_ The app gateway id + * @param switchboardId_ The switchboard id + */ function connect(bytes32 appGatewayId_, uint64 switchboardId_) external override { if (isValidSwitchboard[switchboardId_] != SwitchboardStatus.REGISTERED) revert InvalidSwitchboard(); @@ -109,8 +131,10 @@ abstract contract SocketConfig is ISocket, AccessControl { emit PlugConnected(msg.sender, appGatewayId_, switchboardId_); } - // @notice function to disconnect a plug from socket - // @dev only callable by plug + /** + * @notice Disconnects a plug from socket + * @dev This function is called by the plug to disconnect itself from the socket + */ function disconnect() external override { PlugConfigEvm storage _plugConfig = _plugConfigs[msg.sender]; if (_plugConfig.appGatewayId == bytes32(0)) revert PlugNotConnected(); @@ -120,23 +144,29 @@ abstract contract SocketConfig is ISocket, AccessControl { emit PlugDisconnected(msg.sender); } - // @notice function to set the gas limit buffer for socket - // @dev only callable by governance role - // @param gasLimitBuffer_ gas limit buffer for socket + /** + * @notice Sets the gas limit buffer for socket + * @dev This function is called by the governance role to set the gas limit buffer for socket + * @param gasLimitBuffer_ The gas limit buffer for socket + */ function setGasLimitBuffer(uint256 gasLimitBuffer_) external onlyRole(GOVERNANCE_ROLE) { gasLimitBuffer = gasLimitBuffer_; + emit GasLimitBufferUpdated(gasLimitBuffer_); } - // @notice function to set the max copy bytes for socket - // @dev only callable by governance role - // @param maxCopyBytes_ max copy bytes for socket + /** + * @notice Sets the max copy bytes for socket + * @dev This function is called by the governance role to set the max copy bytes for socket + * @param maxCopyBytes_ The max copy bytes for socket + */ function setMaxCopyBytes(uint16 maxCopyBytes_) external onlyRole(GOVERNANCE_ROLE) { maxCopyBytes = maxCopyBytes_; + emit MaxCopyBytesUpdated(maxCopyBytes_); } /** - * @notice returns the config for given `plugAddress_` - * @param plugAddress_ address of plug present at current chain + * @notice Returns the config for given `plugAddress_` + * @param plugAddress_ The address of the plug present at current chain * @return appGatewayId The app gateway id * @return switchboardId The switchboard id */ diff --git a/contracts/protocol/SocketFeeManager.sol b/contracts/protocol/SocketFeeManager.sol index 3e3bfa8e..da78687f 100644 --- a/contracts/protocol/SocketFeeManager.sol +++ b/contracts/protocol/SocketFeeManager.sol @@ -12,12 +12,28 @@ import "../utils/RescueFundsLib.sol"; * @notice The SocketFeeManager contract is responsible for managing socket fees */ contract SocketFeeManager is ISocketFeeManager, AccessControl { - // Current socket fees in native tokens + // current socket fees in native tokens uint256 public socketFees; + //////////////////////////////////////////////////////////// + ////////////////////// ERRORS ////////////////////////// + //////////////////////////////////////////////////////////// + + /// @notice Thrown when the fees are insufficient error InsufficientFees(); + + /// @notice Thrown when the fees are too low error FeeTooLow(); + //////////////////////////////////////////////////////////// + ////////////////////// EVENTS ////////////////////////// + //////////////////////////////////////////////////////////// + + /** + * @notice Emitted when the socket fees are updated + * @param oldFees The old socket fees + * @param newFees The new socket fees + */ event SocketFeesUpdated(uint256 oldFees, uint256 newFees); /** @@ -26,16 +42,18 @@ contract SocketFeeManager is ISocketFeeManager, AccessControl { * @param socketFees_ Initial socket fees amount */ constructor(address owner_, uint256 socketFees_) { - emit SocketFeesUpdated(0, socketFees_); - socketFees = socketFees_; _grantRole(GOVERNANCE_ROLE, owner_); _grantRole(RESCUE_ROLE, owner_); + + socketFees = socketFees_; + emit SocketFeesUpdated(0, socketFees_); } /** * @notice Pays and validates fees for execution + * @dev This function is payable and will revert if the fees are insufficient */ - function payAndCheckFees(ExecuteParams memory, TransmissionParams memory) external payable { + function payAndCheckFees() external payable { if (msg.value < socketFees) revert InsufficientFees(); } diff --git a/contracts/protocol/SocketUtils.sol b/contracts/protocol/SocketUtils.sol index ac652670..303d67ab 100644 --- a/contracts/protocol/SocketUtils.sol +++ b/contracts/protocol/SocketUtils.sol @@ -25,30 +25,35 @@ abstract contract SocketUtils is SocketConfig { bytes payload; } + // address of the off-chain caller address public constant OFF_CHAIN_CALLER = address(0xDEAD); - // Prefix for trigger ID containing chain slug and address bits + // prefix for trigger ID containing chain slug and address bits uint256 private immutable triggerPrefix; - // Version string for this socket instance + // version string for this socket instance bytes32 public immutable version; - // ChainSlug for this deployed socket instance + // chain slug for this deployed socket instance uint32 public immutable chainSlug; - // @notice counter for trigger id + // counter for trigger id uint64 public triggerCounter; + /// @notice Thrown when the caller is not off-chain error OnlyOffChain(); + + /// @notice Thrown when the simulation fails error SimulationFailed(); + /// @notice Modifier to check if the caller is off-chain modifier onlyOffChain() { if (msg.sender != OFF_CHAIN_CALLER) revert OnlyOffChain(); _; } - /* - * @notice constructor for creating a new Socket contract instance. - * @param chainSlug_ The unique identifier of the chain this socket is deployed on. - * @param owner_ The address of the owner who has the initial admin role. - * @param version_ The version string which is hashed and stored in socket. + /** + * @notice constructor for creating a new Socket contract instance + * @param chainSlug_ The unique identifier of the chain this socket is deployed on + * @param owner_ The address of the owner who has the initial admin role + * @param version_ The version string which is hashed and stored in socket */ constructor(uint32 chainSlug_, address owner_, string memory version_) { chainSlug = chainSlug_; @@ -59,12 +64,13 @@ abstract contract SocketUtils is SocketConfig { } /** - * @notice creates the digest for the payload + * @notice Creates the digest for the payload * @param transmitter_ The address of the transmitter * @param payloadId_ The ID of the payload * @param appGatewayId_ The id of the app gateway * @param executeParams_ The parameters of the payload * @return The packed payload as a bytes32 hash + * @dev This function is used to create the digest for the payload */ function _createDigest( address transmitter_, @@ -94,17 +100,30 @@ abstract contract SocketUtils is SocketConfig { /** * @notice Encodes the trigger ID with the chain slug, socket address and nonce * @return The trigger ID + * @dev This function is used to encode the trigger ID with the chain slug, socket address and nonce */ function _encodeTriggerId() internal returns (bytes32) { return bytes32(triggerPrefix | triggerCounter++); } + /** + * @notice Simulation result + * @param success True if the simulation was successful + * @param returnData The return data from the simulation + * @param exceededMaxCopy True if the simulation exceeded the max copy bytes + */ struct SimulationResult { bool success; bytes returnData; bool exceededMaxCopy; } + /** + * @notice Simulates the payload + * @dev This function is used to simulate the payload offchain for gas estimation and checking reverts + * @param params The parameters of the simulation + * @return The simulation results + */ function simulate( SimulateParams[] calldata params ) external payable onlyOffChain returns (SimulationResult[] memory) { @@ -127,9 +146,9 @@ abstract contract SocketUtils is SocketConfig { /** * @notice Rescues funds from the contract if they are locked by mistake. This contract does not * theoretically need this function but it is added for safety. - * @param token_ The address of the token contract. - * @param rescueTo_ The address where rescued tokens need to be sent. - * @param amount_ The amount of tokens to be rescued. + * @param token_ The address of the token contract + * @param rescueTo_ The address where rescued tokens need to be sent + * @param amount_ The amount of tokens to be rescued */ function rescueFunds( address token_, diff --git a/contracts/protocol/base/PlugBase.sol b/contracts/protocol/base/PlugBase.sol index 46c9bf9b..a6eda992 100644 --- a/contracts/protocol/base/PlugBase.sol +++ b/contracts/protocol/base/PlugBase.sol @@ -9,11 +9,19 @@ import {NotSocket, SocketAlreadyInitialized} from "../../utils/common/Errors.sol /// @notice Abstract contract for plugs /// @dev This contract contains helpers for socket connection, disconnection, and overrides abstract contract PlugBase is IPlug { + // socket instance ISocket public socket__; + + // app gateway id connected to this plug bytes32 public appGatewayId; + + // tracks if socket is initialized uint256 public isSocketInitialized; + + // overrides encoded in bytes bytes public overrides; + // event emitted when plug is disconnected event ConnectorPlugDisconnected(); /// @notice Modifier to ensure only the socket can call the function @@ -41,6 +49,8 @@ abstract contract PlugBase is IPlug { ) internal { _setSocket(socket_); appGatewayId = appGatewayId_; + + // connect to the app gateway and switchboard socket__.connect(appGatewayId_, switchboardId_); } @@ -57,11 +67,18 @@ abstract contract PlugBase is IPlug { } /// @notice Sets the overrides needed for the trigger + /// @dev encoding format depends on the watcher system /// @param overrides_ The overrides function _setOverrides(bytes memory overrides_) internal { overrides = overrides_; } + /// @notice Initializes the socket + /// @dev this function should be called even if deployed independently + /// to avoid ownership and permission exploit + /// @param appGatewayId_ The app gateway id + /// @param socket_ The socket address + /// @param switchboardId_ The switchboard id function initSocket( bytes32 appGatewayId_, address socket_, diff --git a/contracts/protocol/interfaces/ICCTPSwitchboard.sol b/contracts/protocol/interfaces/ICCTPSwitchboard.sol index 796ee602..cbf8894d 100644 --- a/contracts/protocol/interfaces/ICCTPSwitchboard.sol +++ b/contracts/protocol/interfaces/ICCTPSwitchboard.sol @@ -45,14 +45,20 @@ interface ICCTPSwitchboard is ISwitchboard { /** * @notice Verifies the attestations - * @param messages_ The messages - * @param attestations_ The attestations + * @param messages_ The list of messages + * @param attestations_ The list of attestations */ function verifyAttestations( bytes[] calldata messages_, bytes[] calldata attestations_ ) external; + /** + * @notice Attests, verifies and proves the executions + * @param execParams_ The execution parameters + * @param cctpParams_ The CCTP parameters + * @param payloadId_ The payload id + */ function attestVerifyAndProveExecutions( CCTPExecutionParams calldata execParams_, CCTPBatchParams calldata cctpParams_, diff --git a/contracts/protocol/interfaces/IMessageHandler.sol b/contracts/protocol/interfaces/IMessageHandler.sol index c6c29b10..cdc4764e 100644 --- a/contracts/protocol/interfaces/IMessageHandler.sol +++ b/contracts/protocol/interfaces/IMessageHandler.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; + /** * @title IMessageHandler - * @notice Handles messages on destination domain forwarded from - * an IReceiver + * @notice Handles messages on destination forwarded from IReceiver */ interface IMessageHandler { /** - * @notice handles an incoming message from a Receiver - * @param sourceDomain the source domain of the message - * @param sender the sender of the message + * @notice Handles an incoming message from a Receiver + * @param sourceDomain The source chain slug of the message + * @param sender The sender of the message * @param messageBody The message raw bytes * @return success bool, true if successful */ diff --git a/contracts/protocol/interfaces/IMessageTransmitter.sol b/contracts/protocol/interfaces/IMessageTransmitter.sol index 427f2813..a00626f0 100644 --- a/contracts/protocol/interfaces/IMessageTransmitter.sol +++ b/contracts/protocol/interfaces/IMessageTransmitter.sol @@ -1,19 +1,44 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; +/** + * @title IMessageTransmitter + * @notice Transmits messages to a destination domain + */ interface IMessageTransmitter { + /** + * @notice Sends a message to a destination domain + * @param destinationDomain The destination domain + * @param recipient The recipient of the message + * @param messageBody The message body + * @return nonce The nonce of the message + */ function sendMessage( uint32 destinationDomain, bytes32 recipient, bytes calldata messageBody ) external returns (uint64 nonce); + /** + * @notice Receives a message from a source domain + * @param message The message body + * @param attestation The attestation + * @return success True if the message was received successfully + */ function receiveMessage( bytes calldata message, bytes calldata attestation ) external returns (bool success); + /** + * @notice Returns the local domain + * @return localDomain The local domain + */ function localDomain() external view returns (uint32); + /** + * @notice Returns the attestation manager + * @return attestationManager The attestation manager address + */ function attestationManager() external view returns (address); } diff --git a/contracts/protocol/interfaces/IPlug.sol b/contracts/protocol/interfaces/IPlug.sol index 2eb70721..f67160a4 100644 --- a/contracts/protocol/interfaces/IPlug.sol +++ b/contracts/protocol/interfaces/IPlug.sol @@ -13,6 +13,7 @@ interface IPlug { function initSocket(bytes32 appGatewayId_, address socket_, uint64 switchboardId_) external; /// @notice Gets the overrides + /// @dev encoding format depends on the watcher system /// @return overrides_ The overrides function overrides() external view returns (bytes memory overrides_); } diff --git a/contracts/protocol/interfaces/ISocket.sol b/contracts/protocol/interfaces/ISocket.sol index 04bc8d85..166c0f88 100644 --- a/contracts/protocol/interfaces/ISocket.sol +++ b/contracts/protocol/interfaces/ISocket.sol @@ -26,15 +26,15 @@ interface ISocket { /** * @notice emits the config set by a plug for a remoteChainSlug - * @param plug address of plug on current chain - * @param appGatewayId address of plug on sibling chain - * @param switchboardId outbound switchboard (select from registered options) + * @param plug The address of plug on current chain + * @param appGatewayId The address of plug on sibling chain + * @param switchboardId The outbound switchboard (select from registered options) */ event PlugConnected(address plug, bytes32 appGatewayId, uint64 switchboardId); /** * @notice emits the config set by a plug for a remoteChainSlug - * @param plug address of plug on current chain + * @param plug The address of plug on current chain */ event PlugDisconnected(address plug); @@ -56,7 +56,11 @@ interface ISocket { ); /** - * @notice executes a payload + * @notice Executes a payload + * @param executeParams_ The execution parameters + * @param transmissionParams_ The transmission parameters + * @return success True if the payload was executed successfully + * @return returnData The return data from the execution */ function execute( ExecuteParams calldata executeParams_, @@ -65,36 +69,62 @@ interface ISocket { /** * @notice sets the config specific to the plug - * @param appGatewayId_ address of plug present at sibling chain - * @param switchboardId_ the id of switchboard to use for executing payloads + * @param appGatewayId_ The address of plug present at sibling chain + * @param switchboardId_ The id of switchboard to use for executing payloads */ function connect(bytes32 appGatewayId_, uint64 switchboardId_) external; /** - * @notice disconnects Plug from Socket + * @notice Disconnects Plug from Socket */ function disconnect() external; /** - * @notice registers a switchboard for the socket + * @notice Registers a switchboard for the socket + * @return switchboardId The id of the switchboard */ function registerSwitchboard() external returns (uint64); /** - * @notice returns the config for given `plugAddress_` and `siblingChainSlug_` - * @param plugAddress_ address of plug present at current chain + * @notice Returns the config for given `plugAddress_` and `siblingChainSlug_` + * @param plugAddress_ The address of plug present at current chain + * @return appGatewayId The address of plug on sibling chain + * @return switchboardId The id of the switchboard */ function getPlugConfig( address plugAddress_ ) external view returns (bytes32 appGatewayId, uint64 switchboardId); + /** + * @notice Returns the execution status of a payload + * @param payloadId_ The payload id + * @return executionStatus The execution status + */ function payloadExecuted(bytes32 payloadId_) external view returns (ExecutionStatus); + /** + * @notice Returns the chain slug + * @return chainSlug The chain slug + */ function chainSlug() external view returns (uint32); + /** + * @notice Returns the digest of a payload + * @param payloadId_ The payload id + * @return digest The digest + */ function payloadIdToDigest(bytes32 payloadId_) external view returns (bytes32); + /** + * @notice Returns the current trigger counter + * @return triggerCounter The trigger counter + */ function triggerCounter() external view returns (uint64); + /** + * @notice Returns the switchboard address for a given switchboard id + * @param switchboardId_ The switchboard id + * @return switchboardAddress The switchboard address + */ function switchboardAddresses(uint64 switchboardId_) external view returns (address); } diff --git a/contracts/protocol/interfaces/ISocketBatcher.sol b/contracts/protocol/interfaces/ISocketBatcher.sol index 662a477e..f31782b1 100644 --- a/contracts/protocol/interfaces/ISocketBatcher.sol +++ b/contracts/protocol/interfaces/ISocketBatcher.sol @@ -5,7 +5,8 @@ import {ExecuteParams} from "../../utils/common/Structs.sol"; /** * @title ISocketBatcher - * @notice Interface for a helper contract for socket which batches attest (on sb) and execute calls (on socket). + * @notice Interface for a helper contract for socket which batches attest (on sb) + * and execute calls (on socket) */ interface ISocketBatcher { /** @@ -14,6 +15,7 @@ interface ISocketBatcher { * @param digest_ The digest of the payload * @param proof_ The proof of the payload * @param transmitterSignature_ The signature of the transmitter + * @param refundAddress_ The address to refund the fees to * @return The return data after execution */ function attestAndExecute( diff --git a/contracts/protocol/interfaces/ISocketFeeManager.sol b/contracts/protocol/interfaces/ISocketFeeManager.sol index b1029300..029379e5 100644 --- a/contracts/protocol/interfaces/ISocketFeeManager.sol +++ b/contracts/protocol/interfaces/ISocketFeeManager.sol @@ -3,11 +3,15 @@ pragma solidity ^0.8.21; import {ExecuteParams, TransmissionParams} from "../../utils/common/Structs.sol"; +/** + * @title ISocketFeeManager + * @notice Interface for the socket fee manager + */ interface ISocketFeeManager { /** * @notice Pays and validates fees for execution - * @param executeParams_ Execute params - * @param transmissionParams_ Transmission params + * @param executeParams_ The execution parameters + * @param transmissionParams_ The transmission parameters */ function payAndCheckFees( ExecuteParams memory executeParams_, @@ -16,19 +20,19 @@ interface ISocketFeeManager { /** * @notice Gets minimum fees required for execution - * @return nativeFees Minimum native token fees required + * @return nativeFees The minimum native token fees required */ function getMinSocketFees() external view returns (uint256 nativeFees); /** * @notice Sets socket fees - * @param socketFees_ New socket fees amount + * @param socketFees_ The new socket fees amount */ function setSocketFees(uint256 socketFees_) external; /** * @notice Gets current socket fees - * @return Current socket fees amount + * @return socketFees The current socket fees amount */ function socketFees() external view returns (uint256); } diff --git a/contracts/protocol/interfaces/ISwitchboard.sol b/contracts/protocol/interfaces/ISwitchboard.sol index e8518d64..f462cd18 100644 --- a/contracts/protocol/interfaces/ISwitchboard.sol +++ b/contracts/protocol/interfaces/ISwitchboard.sol @@ -17,6 +17,8 @@ interface ISwitchboard { /** * @notice Processes a trigger and creates payload + * @dev This function is called by the socket to process a trigger + * @dev sb can override this function to add additional logic * @param triggerId_ Trigger ID from socket * @param plug_ Source plug address * @param payload_ Payload data diff --git a/contracts/protocol/switchboard/FastSwitchboard.sol b/contracts/protocol/switchboard/FastSwitchboard.sol index 95a41629..abdd3ce7 100644 --- a/contracts/protocol/switchboard/FastSwitchboard.sol +++ b/contracts/protocol/switchboard/FastSwitchboard.sol @@ -61,6 +61,9 @@ contract FastSwitchboard is SwitchboardBase { return isAttested[digest_]; } + /** + * @inheritdoc ISwitchboard + */ function processTrigger( address plug_, bytes32 triggerId_, diff --git a/contracts/protocol/switchboard/SwitchboardBase.sol b/contracts/protocol/switchboard/SwitchboardBase.sol index a6ae97cb..33a90c66 100644 --- a/contracts/protocol/switchboard/SwitchboardBase.sol +++ b/contracts/protocol/switchboard/SwitchboardBase.sol @@ -11,11 +11,13 @@ import {RESCUE_ROLE} from "../../utils/common/AccessRoles.sol"; /// @title SwitchboardBase /// @notice Base contract for switchboards, contains common and util functions for all switchboards abstract contract SwitchboardBase is ISwitchboard, AccessControl { + // socket contract ISocket public immutable socket__; // chain slug of deployed chain uint32 public immutable chainSlug; + // switchboard id uint64 public switchboardId; /** @@ -29,10 +31,22 @@ abstract contract SwitchboardBase is ISwitchboard, AccessControl { _initializeOwner(owner_); } + /** + * @notice Registers a switchboard on the socket + * @dev This function is called by the owner of the switchboard + */ function registerSwitchboard() external onlyOwner { switchboardId = socket__.registerSwitchboard(); } + /** + * @notice Returns the transmitter for a given payload + * @dev If the transmitter signature is provided, the function will return the signer of the signature + * @param sender_ The sender of the payload + * @param payloadId_ The payload id + * @param transmitterSignature_ The transmitter signature (optional) + * @return transmitter The transmitter address + */ function getTransmitter( address sender_, bytes32 payloadId_, From 35472ee9ba6d4a49a00226471c3e460bbbba2d49 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 17:15:14 +0530 Subject: [PATCH 071/139] feat: emit promise execution params --- contracts/evmx/interfaces/IPromise.sol | 6 +++++ .../precompiles/SchedulePrecompile.sol | 22 +++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/contracts/evmx/interfaces/IPromise.sol b/contracts/evmx/interfaces/IPromise.sol index 9809d549..f323ae69 100644 --- a/contracts/evmx/interfaces/IPromise.sol +++ b/contracts/evmx/interfaces/IPromise.sol @@ -12,6 +12,12 @@ interface IPromise { /// @dev The callback will be executed on this address function localInvoker() external view returns (address); + /// @notice The callback selector of the promise + function callbackSelector() external view returns (bytes4); + + /// @notice The callback data of the promise + function callbackData() external view returns (bytes memory); + /// @notice The request count of the promise function requestCount() external view returns (uint40); diff --git a/contracts/evmx/watcher/precompiles/SchedulePrecompile.sol b/contracts/evmx/watcher/precompiles/SchedulePrecompile.sol index 597928c7..186c9b42 100644 --- a/contracts/evmx/watcher/precompiles/SchedulePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/SchedulePrecompile.sol @@ -2,6 +2,8 @@ pragma solidity ^0.8.21; import "../../interfaces/IPrecompile.sol"; +import "../../interfaces/IPromise.sol"; + import "../../../utils/common/Structs.sol"; import {InvalidScheduleDelay, ResolvingScheduleTooEarly} from "../../../utils/common/Errors.sol"; import "../../../utils/RescueFundsLib.sol"; @@ -32,7 +34,14 @@ contract SchedulePrecompile is IPrecompile, WatcherBase { /// @notice Emitted when the expiry time for a schedule is set event ExpiryTimeSet(uint256 expiryTime_); /// @notice Emitted when a schedule is requested - event ScheduleRequested(bytes32 payloadId, uint256 executeAfter, uint256 deadline); + event ScheduleRequested( + bytes32 payloadId, + uint256 executeAfter, + uint256 deadline, + address localInvoker, + bytes4 callbackSelector, + bytes callbackData + ); /// @notice Emitted when a schedule is resolved event ScheduleResolved(bytes32 payloadId); @@ -128,8 +137,17 @@ contract SchedulePrecompile is IPrecompile, WatcherBase { precompileData = abi.encode(delayInSeconds, executeAfter); fees = getPrecompileFees(precompileData); + IPromise promise_ = IPromise(payloadParams.asyncPromise); + // emits event for watcher to track schedule and resolve when deadline is reached - emit ScheduleRequested(payloadParams.payloadId, executeAfter, deadline); + emit ScheduleRequested( + payloadParams.payloadId, + executeAfter, + deadline, + promise_.localInvoker(), + promise_.callbackSelector(), + promise_.callbackData() + ); } function resolvePayload(PayloadParams calldata payloadParams_) external onlyRequestHandler { From f52fc1214b42c565478d115d8df6e36a26e125ee Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 17:20:43 +0530 Subject: [PATCH 072/139] fix: expire bid and end auction --- contracts/evmx/AuctionManager.sol | 25 +++++++++++-------- contracts/evmx/interfaces/IAuctionManager.sol | 5 ++-- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/contracts/evmx/AuctionManager.sol b/contracts/evmx/AuctionManager.sol index 1c4b0a9f..cc27bb1b 100644 --- a/contracts/evmx/AuctionManager.sol +++ b/contracts/evmx/AuctionManager.sol @@ -169,8 +169,10 @@ contract AuctionManager is AuctionManagerStorage, Initializable, AppGatewayBase, } /// @notice Ends an auction - /// @param requestCount_ The ID of the auction - function endAuction(uint40 requestCount_) external override onlyPromises { + /// @param data The encoded request count + function endAuction(bytes memory data, bytes memory) external override onlyPromises { + uint40 requestCount_ = abi.decode(data, (uint40)); + if (requestCount_ == 0) revert InvalidBid(); if ( auctionStatus[requestCount_] == AuctionStatus.CLOSED || auctionStatus[requestCount_] == AuctionStatus.NOT_STARTED @@ -207,10 +209,11 @@ contract AuctionManager is AuctionManagerStorage, Initializable, AppGatewayBase, /// @notice Expires a bid and restarts an auction in case a request is not fully executed. /// @dev Auction can be restarted only for `maxReAuctionCount` times. /// @dev It also unblocks the fees from last transmitter to be assigned to the new winner. - /// @param requestCount_ The request id - function expireBid(uint40 requestCount_) external override onlyPromises { - if (reAuctionCount[requestCount_] >= maxReAuctionCount) revert MaxReAuctionCountReached(); - RequestParams memory requestParams = watcher__().getRequestParams(requestCount_); + /// @param data The encoded request count + function expireBid(bytes memory data, bytes memory) external override onlyPromises { + uint40 requestCount = abi.decode(data, (uint40)); + if (reAuctionCount[requestCount] >= maxReAuctionCount) revert MaxReAuctionCountReached(); + RequestParams memory requestParams = watcher__().getRequestParams(requestCount); // if executed or cancelled, bid is not expired if ( @@ -218,15 +221,15 @@ contract AuctionManager is AuctionManagerStorage, Initializable, AppGatewayBase, requestParams.requestTrackingParams.isRequestCancelled ) return; - delete winningBids[requestCount_]; - auctionStatus[requestCount_] = AuctionStatus.RESTARTED; - reAuctionCount[requestCount_]++; + delete winningBids[requestCount]; + auctionStatus[requestCount] = AuctionStatus.RESTARTED; + reAuctionCount[requestCount]++; watcher__().requestHandler__().assignTransmitter( - requestCount_, + requestCount, Bid({fee: 0, transmitter: address(0), extraData: ""}) ); - emit AuctionRestarted(requestCount_); + emit AuctionRestarted(requestCount); } function _createRequest( diff --git a/contracts/evmx/interfaces/IAuctionManager.sol b/contracts/evmx/interfaces/IAuctionManager.sol index 5bacbf3a..2fd882d6 100644 --- a/contracts/evmx/interfaces/IAuctionManager.sol +++ b/contracts/evmx/interfaces/IAuctionManager.sol @@ -31,8 +31,9 @@ interface IAuctionManager { /// @notice Expires a bid and restarts an auction in case a request is not fully executed. /// @dev Auction can be restarted only for `maxReAuctionCount` times. /// @dev It also unblocks the fees from last transmitter to be assigned to the new winner. - /// @param requestCount_ The request id - function expireBid(uint40 requestCount_) external; + /// @param data The encoded request count + /// @param returnData The return data from the bid + function expireBid(bytes memory data, bytes memory returnData) external; /// @notice Checks if an auction is closed /// @param requestCount_ The request count From 285732e02dd1c035961980b00676927926df1acb Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 17:20:53 +0530 Subject: [PATCH 073/139] fix: build --- contracts/protocol/SocketFeeManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/protocol/SocketFeeManager.sol b/contracts/protocol/SocketFeeManager.sol index da78687f..c0b7b946 100644 --- a/contracts/protocol/SocketFeeManager.sol +++ b/contracts/protocol/SocketFeeManager.sol @@ -53,7 +53,7 @@ contract SocketFeeManager is ISocketFeeManager, AccessControl { * @notice Pays and validates fees for execution * @dev This function is payable and will revert if the fees are insufficient */ - function payAndCheckFees() external payable { + function payAndCheckFees(ExecuteParams memory, TransmissionParams memory) external payable { if (msg.value < socketFees) revert InsufficientFees(); } From b3cb0e43c55de8c5355024a50fcf18425443269c Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 17:22:33 +0530 Subject: [PATCH 074/139] fix: promise callback test --- test/apps/app-gateways/counter/CounterAppGateway.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/apps/app-gateways/counter/CounterAppGateway.sol b/test/apps/app-gateways/counter/CounterAppGateway.sol index 8615c82c..ac887076 100644 --- a/test/apps/app-gateways/counter/CounterAppGateway.sol +++ b/test/apps/app-gateways/counter/CounterAppGateway.sol @@ -119,8 +119,9 @@ contract CounterAppGateway is AppGatewayBase, Ownable { then(this.resolveSchedule.selector, abi.encode(block.timestamp)); } - function resolveSchedule(uint256 creationTimestamp_) external onlyPromises { - emit CounterScheduleResolved(creationTimestamp_, block.timestamp); + function resolveSchedule(bytes memory data, bytes memory) external onlyPromises { + uint256 creationTimestamp = abi.decode(data, (uint256)); + emit CounterScheduleResolved(creationTimestamp, block.timestamp); } // UTILS From 676cdd3fcb0f07cf2c33e19d241e806a5237d6af Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 17:27:17 +0530 Subject: [PATCH 075/139] fix: build --- contracts/evmx/AuctionManager.sol | 2 +- contracts/evmx/interfaces/IAuctionManager.sol | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/evmx/AuctionManager.sol b/contracts/evmx/AuctionManager.sol index cc27bb1b..ff593e94 100644 --- a/contracts/evmx/AuctionManager.sol +++ b/contracts/evmx/AuctionManager.sol @@ -170,7 +170,7 @@ contract AuctionManager is AuctionManagerStorage, Initializable, AppGatewayBase, /// @notice Ends an auction /// @param data The encoded request count - function endAuction(bytes memory data, bytes memory) external override onlyPromises { + function endAuction(bytes memory data, bytes memory) external onlyPromises { uint40 requestCount_ = abi.decode(data, (uint40)); if (requestCount_ == 0) revert InvalidBid(); if ( diff --git a/contracts/evmx/interfaces/IAuctionManager.sol b/contracts/evmx/interfaces/IAuctionManager.sol index 2fd882d6..af867f81 100644 --- a/contracts/evmx/interfaces/IAuctionManager.sol +++ b/contracts/evmx/interfaces/IAuctionManager.sol @@ -25,8 +25,8 @@ interface IAuctionManager { ) external; /// @notice Ends an auction - /// @param requestCount_ The request count - function endAuction(uint40 requestCount_) external; + /// @param data The encoded request count + function endAuction(bytes memory data, bytes memory) external; /// @notice Expires a bid and restarts an auction in case a request is not fully executed. /// @dev Auction can be restarted only for `maxReAuctionCount` times. From 62cba88d559c946114393d0e33c888a166dd37fb Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 17:33:35 +0530 Subject: [PATCH 076/139] feat: upgrade AM and schedule prec --- EventTopics.md | 18 +-- FunctionSignatures.md | 4 +- .../protocol/switchboard/SwitchboardBase.sol | 3 +- deployments/dev_addresses.json | 21 +++- deployments/dev_verification.json | 105 +++++++++++++++++- foundry.toml | 46 ++++---- 6 files changed, 157 insertions(+), 40 deletions(-) diff --git a/EventTopics.md b/EventTopics.md index 0a408806..26cce93c 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -24,6 +24,8 @@ | `AppGatewayCallRequested` | `(triggerId: bytes32, appGatewayId: bytes32, switchboardId: uint64, plug: bytes32, overrides: bytes, payload: bytes)` | `0x8ff0599581fd62c5733e52cea3abd7874731f4a9f86ebb929e5e4afe103f74d4` | | `ExecutionFailed` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x385334bc68a32c4d164625189adc7633e6074eb1b837fb4d11d768245151e4ce` | | `ExecutionSuccess` | `(payloadId: bytes32, exceededMaxCopy: bool, returnData: bytes)` | `0x324d63a433b21a12b90e79cd2ba736b2a5238be6165e03b750fa4a7d5193d5d9` | +| `GasLimitBufferUpdated` | `(gasLimitBuffer: uint256)` | `0xd0e3eb5d0d212f0a08af2be98373721fc901ed26fbac645e08bd664fef818366` | +| `MaxCopyBytesUpdated` | `(maxCopyBytes: uint16)` | `0x294d0c11af52572317e5a0e1362cbf85b3b7c1f7b3f6c7b7e3e5c29c76da33e2` | | `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | | `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | | `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | @@ -287,14 +289,14 @@ ## SchedulePrecompile -| Event | Arguments | Topic | -| ------------------------------ | ---------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | -| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | -| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | -| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | -| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256)` | `0xd099d3e3d0f0e2c9c40e0066affeea125aab71d763b7ab0a279ccec3dff70b64` | -| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | +| Event | Arguments | Topic | +| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `ExpiryTimeSet` | `(expiryTime_: uint256)` | `0x07e837e13ad9a34715a6bd45f49bbf12de19f06df79cb0be12b3a7d7f2397fa9` | +| `MaxScheduleDelayInSecondsSet` | `(maxScheduleDelayInSeconds_: uint256)` | `0xfd5e4f0e96753ffb08a583390c2f151c51001d8e560625ab93b7fa7b4dac6d75` | +| `ScheduleCallbackFeesSet` | `(scheduleCallbackFees_: uint256)` | `0x82a2f41efc81ce7bfabc0affda7354dae42a3d09bd74a6196e8904b223138a52` | +| `ScheduleFeesPerSecondSet` | `(scheduleFeesPerSecond_: uint256)` | `0x7901a21229f6d2543d8676f53e21214d15f42513e7d46e0dcb510357222bdc7c` | +| `ScheduleRequested` | `(payloadId: bytes32, executeAfter: uint256, deadline: uint256, localInvoker: address, callbackSelector: bytes4, callbackData: bytes)` | `0xbeceaccdb128631e58b881241d4fb46e53d8b2b2aa3f1ce77ba6fb80af038e30` | +| `ScheduleResolved` | `(payloadId: bytes32)` | `0x925dc6c3ebffa07cac89d6e9675f1a5d04e045f2ed9a4fa442665935cb73e26b` | ## WritePrecompile diff --git a/FunctionSignatures.md b/FunctionSignatures.md index fc6866b7..e86293ef 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -16,9 +16,9 @@ | `consumeFrom` | `0x40dd78be` | | `creationCodeWithArgs` | `0xc126dcc4` | | `deployForwarder__` | `0xd4e3b034` | -| `endAuction` | `0x1212e653` | +| `endAuction` | `0x7426f0f6` | | `evmxSlug` | `0x8bae77c2` | -| `expireBid` | `0x1dd5022c` | +| `expireBid` | `0x33b5b234` | | `feesManager__` | `0x70568b58` | | `forwarderAddresses` | `0x5390fdcb` | | `getOnChainAddress` | `0xb6abffd7` | diff --git a/contracts/protocol/switchboard/SwitchboardBase.sol b/contracts/protocol/switchboard/SwitchboardBase.sol index 33a90c66..43d5cf52 100644 --- a/contracts/protocol/switchboard/SwitchboardBase.sol +++ b/contracts/protocol/switchboard/SwitchboardBase.sol @@ -42,13 +42,12 @@ abstract contract SwitchboardBase is ISwitchboard, AccessControl { /** * @notice Returns the transmitter for a given payload * @dev If the transmitter signature is provided, the function will return the signer of the signature - * @param sender_ The sender of the payload * @param payloadId_ The payload id * @param transmitterSignature_ The transmitter signature (optional) * @return transmitter The transmitter address */ function getTransmitter( - address sender_, + address, bytes32 payloadId_, bytes calldata transmitterSignature_ ) external view returns (address transmitter) { diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 800d41be..4271f6fb 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -5,7 +5,7 @@ "AsyncDeployer": "0xF1D3ebDF91Cf4b1bc7C9A1D78413CD1Ed2d3123d", "AsyncDeployerImpl": "0x8daf174Be9Bb708c04b708A92b88Cc89bd223498", "AuctionManager": "0xE4243383566fcA32aA6815dE83e8EA86b2027b8b", - "AuctionManagerImpl": "0x122beAFCfc2E99D825322a78EAFD8a11fa2d9E0b", + "AuctionManagerImpl": "0x8EB4402AFAa335b05Bb37f80377F77eeC678b734", "Configurations": "0x6a6697A2AD51DB9a41BaEE78e194335c1aD7369d", "ConfigurationsImpl": "0x8A9256F31b0bb85863c253F8CAE800A32Cb2d595", "DeployForwarder": "0xE986bCd19b8725ea3417C2A7728158ecABA6C8bE", @@ -18,13 +18,30 @@ "ReadPrecompile": "0xE693bEc40e39223749AC351156E713b7256541B0", "RequestHandler": "0xE785Fdbd049D0647e8B2Bd28C75a679dEBaD9D6f", "RequestHandlerImpl": "0x5332d341cd7B423C2f75AF7Ca295455e5F08fAcb", - "SchedulePrecompile": "0x99af65efe676C4899F6e500DF18d4fD84dbe0A1D", + "SchedulePrecompile": "0x1099338aB85627640bB7A0D55c683921EA766C75", "startBlock": 10904, "Watcher": "0x96ACe2d4a36a1Fd6e3eeE1cD3FeDA36eA62E3064", "WatcherImpl": "0xE5542FAB56B652A95aBD05a08E920687d1ef3849", "WritePrecompile": "0x27794dd1166ED0c6A70c655C297BB79bF06bf44A", "WritePrecompileImpl": "0xc2Ca571f4d4C2008Da4Bd750BaD3d50A5705ffF8" }, + "84532": { + "CCTPSwitchboard": "0xBD6770182fB47DD77924aDf3F200246Ab851f9c2", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0x6320Ff773a4E01Cb8EB849EA906F17Cf6c48Ff9c", + "FastSwitchboard": "0x2420B85D7e126d1948a4602f0c78a685655292Bd", + "FastSwitchboardId": "0", + "FeesPlug": "0x89634ecFea933aFaD5d3D6557b13cb8D466313d2", + "MessageSwitchboard": "0xd94741a4654953817faEe228739a6d10C0683839", + "MessageSwitchboardId": "0", + "Socket": "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", + "SocketBatcher": "0x138C1B6e301C7d1B59920bEe2834f5B481bA39dF", + "startBlock": 29270214, + "SwitchboardIdToAddressMap": { + "0": "0xd94741a4654953817faEe228739a6d10C0683839", + "2": "0xBD6770182fB47DD77924aDf3F200246Ab851f9c2" + } + }, "421614": { "CCTPSwitchboard": "0xaF912b7eaD59f5d8c8179f8606A3fa93459a612C", "CCTPSwitchboardId": "2", diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 3b3f4600..ad4ac5cd 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1,5 +1,100 @@ { - "14323": [], + "14323": [ + [ + "0x1099338aB85627640bB7A0D55c683921EA766C75", + "SchedulePrecompile", + "contracts/evmx/watcher/precompiles/SchedulePrecompile.sol", + [ + "0x96ACe2d4a36a1Fd6e3eeE1cD3FeDA36eA62E3064", + 86400, + { + "type": "BigNumber", + "hex": "0x02540be400" + }, + { + "type": "BigNumber", + "hex": "0xe8d4a51000" + }, + 3600 + ] + ], + [ + "0x8EB4402AFAa335b05Bb37f80377F77eeC678b734", + "AuctionManager", + "contracts/evmx/AuctionManager.sol", + [] + ] + ], + "84532": [ + [ + "0x6320Ff773a4E01Cb8EB849EA906F17Cf6c48Ff9c", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x89634ecFea933aFaD5d3D6557b13cb8D466313d2", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xd94741a4654953817faEe228739a6d10C0683839", + "MessageSwitchboard", + "contracts/protocol/switchboard/MessageSwitchboard.sol", + [ + 84532, + "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xBD6770182fB47DD77924aDf3F200246Ab851f9c2", + "CCTPSwitchboard", + "contracts/protocol/switchboard/CCTPSwitchboard.sol", + [ + 84532, + "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD" + ] + ], + [ + "0x2420B85D7e126d1948a4602f0c78a685655292Bd", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 84532, + "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x138C1B6e301C7d1B59920bEe2834f5B481bA39dF", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xA90f2aB2804e8575D021882aAB74399fa282A8A3" + ] + ], + [ + "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", + "Socket", + "contracts/protocol/Socket.sol", + [ + 84532, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], "421614": [], "7625382": [ [ @@ -12,7 +107,9 @@ "0x13A3018920c7b56B20dd34E29C298121025E6de4", "FeesPool", "contracts/evmx/fees/FeesPool.sol", - ["0xb62505feacC486e809392c65614Ce4d7b051923b"] + [ + "0xb62505feacC486e809392c65614Ce4d7b051923b" + ] ], [ "0xC3f93140EF2f57a87FDdCe7DdADB544873b67C7D", @@ -61,7 +158,9 @@ "0xe0047f9b97c4C73948fe23F1bA807FE7906040C0", "PromiseResolver", "contracts/evmx/watcher/PromiseResolver.sol", - ["0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB"] + [ + "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB" + ] ], [ "0x95aB9c53FDa2ad009B6698d814735D0030796805", diff --git a/foundry.toml b/foundry.toml index 5144b5ba..2499c44b 100644 --- a/foundry.toml +++ b/foundry.toml @@ -10,26 +10,26 @@ evm_version = 'paris' via_ir = false [labels] -0xAA77c2dE14CfFF4244a127deED6b53ce79481e14 = "AddressResolver" -0xe857a826D330Fc0429c67FaBEB8B66C26ea1DD5f = "AddressResolverImpl" -0x24c3f774c231ADFeb5e22Ad826a666A0FF9742C8 = "AsyncDeployer" -0xB7Bf09935108753491E59114dc0B713cDa6F703F = "AsyncDeployerImpl" -0xd5853f69f5dE728AEF7d1cF029cB3bF1581A4ED4 = "AuctionManager" -0x89A0D4550D5aFa809B74856624D4595188641BCe = "AuctionManagerImpl" -0x0f2801ee741A3BdeA2245d97AB54B1C4d7734534 = "Configurations" -0xD41d93042Dd1aB8c712C212A6907d4dC0718D021 = "ConfigurationsImpl" -0x54676a772aEe69E3F87178F2b5E4414dcE9A9720 = "DeployForwarder" -0x9882ce57b618175Bd9d3a4eC50ebD682B39bc467 = "DeployForwarderImpl" -0x61788F19CA1b098cE8437f8eb13B1Ad68f4FcD77 = "ERC1967Factory" -0x9339e8D915Aaf467d2fC01a4e694c8FE85621e94 = "FeesManager" -0x27b763c5410E83c02F21D97B33555729B77B2Ce1 = "FeesManagerImpl" -0xC8d803B7c1719cdF21392405879D1B56398045C4 = "FeesPool" -0x9BE3513a5d32E74935a54e5516b4daa198da5574 = "PromiseResolver" -0x784730D5e5D2F64eA63BfafeDC759317438c9186 = "ReadPrecompile" -0x22FaddfD47B9E0B545f83a2E7Cd05c12889c7a57 = "RequestHandler" -0xAA6EfF8dbd53B8d95a02c59Fe5C8A8422B08F5AA = "RequestHandlerImpl" -0x074118aB15e54A84b42Ff3de5233721434cF9f55 = "SchedulePrecompile" -0xdd25a87AeB5bCEeBAc0EB27aFfaBB6eB5a2857ca = "Watcher" -0xb143810f13fDF66F7a9B973252AEC80ec47FF0cb = "WatcherImpl" -0x66ce424303EC8499C5cdC4F6437A0434D8bd9b81 = "WritePrecompile" -0x962E1db23f6C5879A5c9D58CcB8c67CD282F1000 = "WritePrecompileImpl" +0x774f608eD8fc03B05a9da51588F8571ced4c2eb2 = "AddressResolver" +0x9c58dAABeBE7D6DfD8F70097c6f9c87FEC9b83DE = "AddressResolverImpl" +0xF1D3ebDF91Cf4b1bc7C9A1D78413CD1Ed2d3123d = "AsyncDeployer" +0x8daf174Be9Bb708c04b708A92b88Cc89bd223498 = "AsyncDeployerImpl" +0xE4243383566fcA32aA6815dE83e8EA86b2027b8b = "AuctionManager" +0x8EB4402AFAa335b05Bb37f80377F77eeC678b734 = "AuctionManagerImpl" +0x6a6697A2AD51DB9a41BaEE78e194335c1aD7369d = "Configurations" +0x8A9256F31b0bb85863c253F8CAE800A32Cb2d595 = "ConfigurationsImpl" +0xE986bCd19b8725ea3417C2A7728158ecABA6C8bE = "DeployForwarder" +0xfBe803842B50d8A2a91DA3dD88B67E92D5C0bd97 = "DeployForwarderImpl" +0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79 = "ERC1967Factory" +0xa6D93e7B2cde3C8d318f45890dE3dB0a2E54058B = "FeesManager" +0x38A7558D2C3b4097c2098444a46D625D51E7336F = "FeesManagerImpl" +0x13A3018920c7b56B20dd34E29C298121025E6de4 = "FeesPool" +0x40834274ee715B1748e450A67cFf2B52b0388eC3 = "PromiseResolver" +0xE693bEc40e39223749AC351156E713b7256541B0 = "ReadPrecompile" +0xE785Fdbd049D0647e8B2Bd28C75a679dEBaD9D6f = "RequestHandler" +0x5332d341cd7B423C2f75AF7Ca295455e5F08fAcb = "RequestHandlerImpl" +0x1099338aB85627640bB7A0D55c683921EA766C75 = "SchedulePrecompile" +0x96ACe2d4a36a1Fd6e3eeE1cD3FeDA36eA62E3064 = "Watcher" +0xE5542FAB56B652A95aBD05a08E920687d1ef3849 = "WatcherImpl" +0x27794dd1166ED0c6A70c655C297BB79bF06bf44A = "WritePrecompile" +0xc2Ca571f4d4C2008Da4Bd750BaD3d50A5705ffF8 = "WritePrecompileImpl" From a84a176287c643bc567400396c78d75d497d1fec Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 17:39:06 +0530 Subject: [PATCH 077/139] fix: sb ids --- deployments/dev_addresses.json | 9 +-- deployments/dev_verification.json | 106 ++---------------------------- 2 files changed, 9 insertions(+), 106 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 4271f6fb..a540d6af 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -30,16 +30,17 @@ "CCTPSwitchboardId": "2", "ContractFactoryPlug": "0x6320Ff773a4E01Cb8EB849EA906F17Cf6c48Ff9c", "FastSwitchboard": "0x2420B85D7e126d1948a4602f0c78a685655292Bd", - "FastSwitchboardId": "0", + "FastSwitchboardId": "1", "FeesPlug": "0x89634ecFea933aFaD5d3D6557b13cb8D466313d2", "MessageSwitchboard": "0xd94741a4654953817faEe228739a6d10C0683839", - "MessageSwitchboardId": "0", + "MessageSwitchboardId": "3", "Socket": "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", "SocketBatcher": "0x138C1B6e301C7d1B59920bEe2834f5B481bA39dF", "startBlock": 29270214, "SwitchboardIdToAddressMap": { - "0": "0xd94741a4654953817faEe228739a6d10C0683839", - "2": "0xBD6770182fB47DD77924aDf3F200246Ab851f9c2" + "1": "0x2420B85D7e126d1948a4602f0c78a685655292Bd", + "2": "0xBD6770182fB47DD77924aDf3F200246Ab851f9c2", + "3": "0xd94741a4654953817faEe228739a6d10C0683839" } }, "421614": { diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index ad4ac5cd..9040b3a1 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1,100 +1,6 @@ { - "14323": [ - [ - "0x1099338aB85627640bB7A0D55c683921EA766C75", - "SchedulePrecompile", - "contracts/evmx/watcher/precompiles/SchedulePrecompile.sol", - [ - "0x96ACe2d4a36a1Fd6e3eeE1cD3FeDA36eA62E3064", - 86400, - { - "type": "BigNumber", - "hex": "0x02540be400" - }, - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - 3600 - ] - ], - [ - "0x8EB4402AFAa335b05Bb37f80377F77eeC678b734", - "AuctionManager", - "contracts/evmx/AuctionManager.sol", - [] - ] - ], - "84532": [ - [ - "0x6320Ff773a4E01Cb8EB849EA906F17Cf6c48Ff9c", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0x89634ecFea933aFaD5d3D6557b13cb8D466313d2", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0xd94741a4654953817faEe228739a6d10C0683839", - "MessageSwitchboard", - "contracts/protocol/switchboard/MessageSwitchboard.sol", - [ - 84532, - "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0xBD6770182fB47DD77924aDf3F200246Ab851f9c2", - "CCTPSwitchboard", - "contracts/protocol/switchboard/CCTPSwitchboard.sol", - [ - 84532, - "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD" - ] - ], - [ - "0x2420B85D7e126d1948a4602f0c78a685655292Bd", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 84532, - "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0x138C1B6e301C7d1B59920bEe2834f5B481bA39dF", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0xA90f2aB2804e8575D021882aAB74399fa282A8A3" - ] - ], - [ - "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", - "Socket", - "contracts/protocol/Socket.sol", - [ - 84532, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] - ] - ], + "14323": [], + "84532": [], "421614": [], "7625382": [ [ @@ -107,9 +13,7 @@ "0x13A3018920c7b56B20dd34E29C298121025E6de4", "FeesPool", "contracts/evmx/fees/FeesPool.sol", - [ - "0xb62505feacC486e809392c65614Ce4d7b051923b" - ] + ["0xb62505feacC486e809392c65614Ce4d7b051923b"] ], [ "0xC3f93140EF2f57a87FDdCe7DdADB544873b67C7D", @@ -158,9 +62,7 @@ "0xe0047f9b97c4C73948fe23F1bA807FE7906040C0", "PromiseResolver", "contracts/evmx/watcher/PromiseResolver.sol", - [ - "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB" - ] + ["0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB"] ], [ "0x95aB9c53FDa2ad009B6698d814735D0030796805", From 343161541d344bd07f348572946eab9a9af6b132 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 4 Aug 2025 17:43:11 +0530 Subject: [PATCH 078/139] fix: rearrange tests --- test/Utils.t.sol | 20 ++++++++--------- test/{ => evmx}/AuctionManager.t.sol | 4 ++-- test/{ => evmx}/FeesTest.t.sol | 4 ++-- test/{ => evmx}/ProxyMigration.t.sol | 2 +- test/{ => evmx}/ProxyStorage.t.sol | 2 +- test/{ => evmx}/Watcher.t.sol | 2 +- test/{ => protocol}/Socket.t.sol | 22 +++++++++---------- test/{ => protocol}/SocketFeeManager.t.sol | 8 +++---- test/{ => protocol}/TriggerTest.t.sol | 6 ++--- .../MessageSwitchboardTest.t copy.sol} | 4 ++-- 10 files changed, 37 insertions(+), 37 deletions(-) rename test/{ => evmx}/AuctionManager.t.sol (96%) rename test/{ => evmx}/FeesTest.t.sol (99%) rename test/{ => evmx}/ProxyMigration.t.sol (99%) rename test/{ => evmx}/ProxyStorage.t.sol (99%) rename test/{ => evmx}/Watcher.t.sol (97%) rename test/{ => protocol}/Socket.t.sol (98%) rename test/{ => protocol}/SocketFeeManager.t.sol (96%) rename test/{ => protocol}/TriggerTest.t.sol (95%) rename test/{MessageSwitchboardTest.t.sol => protocol/switchboards/MessageSwitchboardTest.t copy.sol} (96%) diff --git a/test/Utils.t.sol b/test/Utils.t.sol index 7cba44a8..de86f2a3 100644 --- a/test/Utils.t.sol +++ b/test/Utils.t.sol @@ -27,13 +27,13 @@ contract IdUtilsTest is Test { assertEq(payloadPointerFromId, payloadPointer, "Payload pointer should match"); } - function testCreatePayloadIdWithZeroValues() public { + function testCreatePayloadIdWithZeroValues() public pure { bytes32 payloadId = createPayloadId(0, 0, 0); assertEq(payloadId, bytes32(0), "Payload ID should be zero for zero inputs"); } - function testCreatePayloadIdWithMaxValues() public { + function testCreatePayloadIdWithMaxValues() public pure { uint160 maxPayloadPointer = type(uint160).max; uint64 maxSwitchboardId = type(uint64).max; uint32 maxChainSlug = type(uint32).max; @@ -54,7 +54,7 @@ contract IdUtilsTest is Test { uint160 payloadPointer, uint64 switchboardId, uint32 chainSlug - ) public { + ) public pure { bytes32 payloadId = createPayloadId(payloadPointer, switchboardId, chainSlug); // Verify the structure @@ -73,20 +73,20 @@ contract IdUtilsTest is Test { * @dev Tests for Converters utility functions */ contract ConvertersTest is Test { - function testToBytes32Format() public { + function testToBytes32Format() public pure { address testAddr = address(0x1234567890123456789012345678901234567890); bytes32 result = toBytes32Format(testAddr); assertEq(result, bytes32(uint256(uint160(testAddr))), "Conversion should be correct"); } - function testToBytes32FormatWithZeroAddress() public { + function testToBytes32FormatWithZeroAddress() public pure { bytes32 result = toBytes32Format(address(0)); assertEq(result, bytes32(0), "Zero address should convert to zero bytes32"); } - function testFromBytes32Format() public { + function testFromBytes32Format() public pure { address originalAddr = address(0x1234567890123456789012345678901234567890); bytes32 bytes32Format = toBytes32Format(originalAddr); @@ -95,7 +95,7 @@ contract ConvertersTest is Test { assertEq(convertedAddr, originalAddr, "Conversion should be reversible"); } - function testFromBytes32FormatWithZeroAddress() public { + function testFromBytes32FormatWithZeroAddress() public pure { bytes32 zeroBytes32 = bytes32(0); address convertedAddr = fromBytes32Format(zeroBytes32); @@ -119,7 +119,7 @@ contract ConvertersTest is Test { return fromBytes32Format(bytes32FormatAddress); } - function testFromBytes32FormatWithMaxValidAddress() public { + function testFromBytes32FormatWithMaxValidAddress() public pure { address maxAddr = address(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF); bytes32 bytes32Format = toBytes32Format(maxAddr); @@ -128,7 +128,7 @@ contract ConvertersTest is Test { assertEq(convertedAddr, maxAddr, "Max address should convert correctly"); } - function testConvertersRoundTrip() public { + function testConvertersRoundTrip() public pure { address originalAddr = address(0xabCDEF1234567890ABcDEF1234567890aBCDeF12); bytes32 bytes32Format = toBytes32Format(originalAddr); @@ -137,7 +137,7 @@ contract ConvertersTest is Test { assertEq(convertedAddr, originalAddr, "Round trip conversion should work"); } - function testConvertersFuzz(address addr) public { + function testConvertersFuzz(address addr) public pure { // Skip addresses that would cause overflow vm.assume(uint256(uint160(addr)) <= type(uint160).max); diff --git a/test/AuctionManager.t.sol b/test/evmx/AuctionManager.t.sol similarity index 96% rename from test/AuctionManager.t.sol rename to test/evmx/AuctionManager.t.sol index 3c3cebdf..665b6ba8 100644 --- a/test/AuctionManager.t.sol +++ b/test/evmx/AuctionManager.t.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; -import "./SetupTest.t.sol"; -import "./apps/Counter.t.sol"; +import "../SetupTest.t.sol"; +import "../apps/Counter.t.sol"; contract AuctionManagerTest is AppGatewayBaseSetup { uint32 feesChainSlug = arbChainSlug; diff --git a/test/FeesTest.t.sol b/test/evmx/FeesTest.t.sol similarity index 99% rename from test/FeesTest.t.sol rename to test/evmx/FeesTest.t.sol index 7fdf9d3e..457d2ede 100644 --- a/test/FeesTest.t.sol +++ b/test/evmx/FeesTest.t.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; -import "./apps/Counter.t.sol"; -import "./SetupTest.t.sol"; +import "../apps/Counter.t.sol"; +import "../SetupTest.t.sol"; contract FeesTest is AppGatewayBaseSetup { uint32 feesChainSlug = arbChainSlug; diff --git a/test/ProxyMigration.t.sol b/test/evmx/ProxyMigration.t.sol similarity index 99% rename from test/ProxyMigration.t.sol rename to test/evmx/ProxyMigration.t.sol index d05b2897..cb1acfa3 100644 --- a/test/ProxyMigration.t.sol +++ b/test/evmx/ProxyMigration.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.21; import "./ProxyStorage.t.sol"; -import "./mock/MockWatcherPrecompile.sol"; +import "../mock/MockWatcherPrecompile.sol"; contract MigrationTest is ProxyStorageAssertions { // ERC1967Factory emits this event with both proxy and implementation addresses diff --git a/test/ProxyStorage.t.sol b/test/evmx/ProxyStorage.t.sol similarity index 99% rename from test/ProxyStorage.t.sol rename to test/evmx/ProxyStorage.t.sol index 3533c6df..960f90f7 100644 --- a/test/ProxyStorage.t.sol +++ b/test/evmx/ProxyStorage.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; -import "./SetupTest.t.sol"; +import "../SetupTest.t.sol"; contract ProxyStorageAssertions is AppGatewayBaseSetup { uint256 public constant FIRST_SLOT = 50; diff --git a/test/Watcher.t.sol b/test/evmx/Watcher.t.sol similarity index 97% rename from test/Watcher.t.sol rename to test/evmx/Watcher.t.sol index b3d0e960..98dddcc3 100644 --- a/test/Watcher.t.sol +++ b/test/evmx/Watcher.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; -import "./SetupTest.t.sol"; +import "../SetupTest.t.sol"; contract WatcherTest is AppGatewayBaseSetup { function setUp() public { diff --git a/test/Socket.t.sol b/test/protocol/Socket.t.sol similarity index 98% rename from test/Socket.t.sol rename to test/protocol/Socket.t.sol index 10bcf4e0..1a71ec20 100644 --- a/test/Socket.t.sol +++ b/test/protocol/Socket.t.sol @@ -4,17 +4,17 @@ pragma solidity ^0.8.21; import {Test} from "forge-std/Test.sol"; import {console} from "forge-std/console.sol"; -import {MockFastSwitchboard} from "./mock/MockFastSwitchboard.sol"; -import {MockPlug, MockTarget} from "./mock/MockPlug.sol"; -import {MockFeeManager} from "./mock/MockFeesManager.sol"; -import {SuperToken} from "./apps/app-gateways/super-token/SuperToken.sol"; -import {MockERC721} from "./mock/MockERC721.sol"; - -import "../contracts/protocol/Socket.sol"; -import "../contracts/protocol/SocketUtils.sol"; -import "../contracts/utils/common/Errors.sol"; -import "../contracts/utils/common/Constants.sol"; -import "../contracts/utils/common/Structs.sol"; +import {MockFastSwitchboard} from "../mock/MockFastSwitchboard.sol"; +import {MockPlug, MockTarget} from "../mock/MockPlug.sol"; +import {MockFeeManager} from "../mock/MockFeesManager.sol"; +import {SuperToken} from "../apps/app-gateways/super-token/SuperToken.sol"; +import {MockERC721} from "../mock/MockERC721.sol"; + +import "../../contracts/protocol/Socket.sol"; +import "../../contracts/protocol/SocketUtils.sol"; +import "../../contracts/utils/common/Errors.sol"; +import "../../contracts/utils/common/Constants.sol"; +import "../../contracts/utils/common/Structs.sol"; /** * @title SocketTestWrapper diff --git a/test/SocketFeeManager.t.sol b/test/protocol/SocketFeeManager.t.sol similarity index 96% rename from test/SocketFeeManager.t.sol rename to test/protocol/SocketFeeManager.t.sol index e696b95e..19db0329 100644 --- a/test/SocketFeeManager.t.sol +++ b/test/protocol/SocketFeeManager.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {SocketFeeManager} from "../contracts/protocol/SocketFeeManager.sol"; -import {MockFastSwitchboard} from "./mock/MockFastSwitchboard.sol"; -import "./SetupTest.t.sol"; -import "./apps/Counter.t.sol"; +import {SocketFeeManager} from "../../contracts/protocol/SocketFeeManager.sol"; +import {MockFastSwitchboard} from "../mock/MockFastSwitchboard.sol"; +import "../SetupTest.t.sol"; +import "../apps/Counter.t.sol"; contract SocketFeeManagerTest is AppGatewayBaseSetup { Counter public counter; diff --git a/test/TriggerTest.t.sol b/test/protocol/TriggerTest.t.sol similarity index 95% rename from test/TriggerTest.t.sol rename to test/protocol/TriggerTest.t.sol index eb4c0ea0..24f475e7 100644 --- a/test/TriggerTest.t.sol +++ b/test/protocol/TriggerTest.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; -import {CounterAppGateway} from "./apps/Counter.t.sol"; -import {Counter} from "./apps/Counter.t.sol"; -import "./SetupTest.t.sol"; +import {CounterAppGateway} from "../apps/Counter.t.sol"; +import {Counter} from "../apps/Counter.t.sol"; +import "../SetupTest.t.sol"; contract TriggerTest is AppGatewayBaseSetup { uint256 constant feesAmount = 0.01 ether; diff --git a/test/MessageSwitchboardTest.t.sol b/test/protocol/switchboards/MessageSwitchboardTest.t copy.sol similarity index 96% rename from test/MessageSwitchboardTest.t.sol rename to test/protocol/switchboards/MessageSwitchboardTest.t copy.sol index 36fe93b0..73398fcd 100644 --- a/test/MessageSwitchboardTest.t.sol +++ b/test/protocol/switchboards/MessageSwitchboardTest.t copy.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; -import "./SetupTest.t.sol"; -import {CounterPlug} from "./apps/app-gateways/counter/MessageCounter.sol"; +import "../../SetupTest.t.sol"; +import {CounterPlug} from "../../apps/app-gateways/counter/MessageCounter.sol"; contract MessageSwitchboardTest is MessageSwitchboardSetup { CounterPlug public arbPlug; From aa38de3408aa55438d1ea01bffc0bc432ed062e5 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 5 Aug 2025 00:02:09 +0530 Subject: [PATCH 079/139] feat: sb tests --- .../protocol/switchboard/FastSwitchboard.sol | 2 +- test/Utils.t.sol | 2 +- .../switchboards/FastSwitchboardTest.t.sol | 188 ++++++++++++++++++ 3 files changed, 190 insertions(+), 2 deletions(-) create mode 100644 test/protocol/switchboards/FastSwitchboardTest.t.sol diff --git a/contracts/protocol/switchboard/FastSwitchboard.sol b/contracts/protocol/switchboard/FastSwitchboard.sol index abdd3ce7..3995a380 100644 --- a/contracts/protocol/switchboard/FastSwitchboard.sol +++ b/contracts/protocol/switchboard/FastSwitchboard.sol @@ -69,5 +69,5 @@ contract FastSwitchboard is SwitchboardBase { bytes32 triggerId_, bytes calldata payload_, bytes calldata overrides_ - ) external payable {} + ) external payable virtual {} } diff --git a/test/Utils.t.sol b/test/Utils.t.sol index de86f2a3..ff8cef98 100644 --- a/test/Utils.t.sol +++ b/test/Utils.t.sol @@ -10,7 +10,7 @@ import "../contracts/utils/common/Converters.sol"; * @dev Tests for IdUtils utility functions */ contract IdUtilsTest is Test { - function testCreatePayloadId() public { + function testCreatePayloadId() public pure { uint160 payloadPointer = 12345; uint64 switchboardId = 67890; uint32 chainSlug = 1; diff --git a/test/protocol/switchboards/FastSwitchboardTest.t.sol b/test/protocol/switchboards/FastSwitchboardTest.t.sol new file mode 100644 index 00000000..f27ab1fb --- /dev/null +++ b/test/protocol/switchboards/FastSwitchboardTest.t.sol @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +import "../../SetupTest.t.sol"; +import {CounterAppGateway} from "../../apps/app-gateways/counter/CounterAppGateway.sol"; +import {FastSwitchboard} from "../../../contracts/protocol/switchboard/FastSwitchboard.sol"; +import {WATCHER_ROLE} from "../../../contracts/utils/common/AccessRoles.sol"; +import {toBytes32Format} from "../../../contracts/utils/common/Converters.sol"; + +contract FastSwitchboardExtended is FastSwitchboard { + event TriggerProcessed( + address indexed plug, + bytes32 indexed triggerId, + bytes payload, + bytes overrides + ); + + constructor( + uint32 chainSlug_, + ISocket socket_, + address owner_ + ) FastSwitchboard(chainSlug_, socket_, owner_) {} + + function processTrigger( + address plug_, + bytes32 triggerId_, + bytes calldata payload_, + bytes calldata overrides_ + ) external payable override { + emit TriggerProcessed(plug_, triggerId_, payload_, overrides_); + } +} + +contract FastSwitchboardTest is AppGatewayBaseSetup { + CounterAppGateway public appGateway; + FastSwitchboard public fastSwitchboard; + bytes32 public testDigest = keccak256(abi.encodePacked("test payload")); + bytes32 public sigDigest; + bytes public validProof; + + function setUp() public { + _deploy(); + appGateway = new CounterAppGateway(address(addressResolver), writeFees); + fastSwitchboard = getSocketConfig(arbChainSlug).switchboard; + + // Create valid proof from watcher + sigDigest = keccak256( + abi.encodePacked(toBytes32Format(address(fastSwitchboard)), arbChainSlug, testDigest) + ); + validProof = createSignature(sigDigest, watcherPrivateKey); + } + + function testAttestWithValidWatcherSignature() public { + assertTrue( + fastSwitchboard.hasRole(WATCHER_ROLE, watcherEOA), + "Watcher should have WATCHER_ROLE" + ); + + vm.expectEmit(true, true, true, false); + emit FastSwitchboard.Attested(testDigest, watcherEOA); + fastSwitchboard.attest(testDigest, validProof); + + assertTrue(fastSwitchboard.isAttested(testDigest), "Payload should be attested"); + } + + function testAttestWithAlreadyAttestedPayload() public { + fastSwitchboard.attest(testDigest, validProof); + assertTrue(fastSwitchboard.isAttested(testDigest), "Payload should be attested"); + + vm.expectRevert(FastSwitchboard.AlreadyAttested.selector); + fastSwitchboard.attest(testDigest, validProof); + } + + function testAllowPayloadReturnsCorrectStatus() public { + assertFalse( + fastSwitchboard.allowPayload(testDigest, bytes32(0)), + "Payload should not be allowed initially" + ); + + fastSwitchboard.attest(testDigest, validProof); + assertTrue( + fastSwitchboard.allowPayload(testDigest, bytes32(0)), + "Payload should be allowed after attestation" + ); + } + + function testAttestWithNonWatcherAddress() public { + // Create proof from a non-watcher address + uint256 nonWatcherPrivateKey = 0x1234567890123456789012345678901234567890123456789012345678901234; + address nonWatcherAddress = vm.addr(nonWatcherPrivateKey); + bytes memory nonWatcherProof = createSignature(sigDigest, nonWatcherPrivateKey); + + // Verify non-watcher doesn't have WATCHER_ROLE + assertFalse( + fastSwitchboard.hasRole(WATCHER_ROLE, nonWatcherAddress), + "Non-watcher should not have WATCHER_ROLE" + ); + + // Try to attest with non-watcher proof + vm.expectRevert(FastSwitchboard.WatcherNotFound.selector); + fastSwitchboard.attest(testDigest, nonWatcherProof); + } + + function testMultipleAttestationsForDifferentDigests() public { + bytes32 digest1 = keccak256(abi.encodePacked("payload 1")); + bytes32 digest2 = keccak256(abi.encodePacked("payload 2")); + + // Create proofs for both digests + bytes32 sigDigest1 = keccak256( + abi.encodePacked(toBytes32Format(address(fastSwitchboard)), arbChainSlug, digest1) + ); + bytes32 sigDigest2 = keccak256( + abi.encodePacked(toBytes32Format(address(fastSwitchboard)), arbChainSlug, digest2) + ); + + bytes memory proof1 = createSignature(sigDigest1, watcherPrivateKey); + bytes memory proof2 = createSignature(sigDigest2, watcherPrivateKey); + + // Attest both payloads + fastSwitchboard.attest(digest1, proof1); + fastSwitchboard.attest(digest2, proof2); + + // Verify both are attested + assertTrue(fastSwitchboard.isAttested(digest1), "Digest1 should be attested"); + assertTrue(fastSwitchboard.isAttested(digest2), "Digest2 should be attested"); + + // Verify both are allowed + assertTrue(fastSwitchboard.allowPayload(digest1, bytes32(0)), "Digest1 should be allowed"); + assertTrue(fastSwitchboard.allowPayload(digest2, bytes32(0)), "Digest2 should be allowed"); + } + + function testProcessTriggerDoesNothing() public { + FastSwitchboardExtended fastSwitchboardExtended = new FastSwitchboardExtended( + arbChainSlug, + getSocketConfig(arbChainSlug).socket, + socketOwner + ); + + vm.expectEmit(true, true, true, true); + emit FastSwitchboardExtended.TriggerProcessed( + address(0x123), + bytes32(uint256(0x456)), + bytes("test payload"), + bytes("test overrides") + ); + fastSwitchboardExtended.processTrigger( + address(0x123), + bytes32(uint256(0x456)), + bytes("test payload"), + bytes("test overrides") + ); + } + + function testFuzzLargeProofs(bytes32 digest, uint256 proofSize) public { + vm.assume(digest != bytes32(0)); + vm.assume(proofSize >= 65 && proofSize <= 1000); // Reasonable proof sizes + + // Create a large proof + bytes memory largeProof = new bytes(proofSize); + for (uint256 i = 0; i < proofSize; i++) { + largeProof[i] = bytes1(uint8(i % 256)); + } + + vm.expectRevert(InvalidSignature.selector); + fastSwitchboard.attest(digest, largeProof); + } + + function testFuzzAttestWithRandomDigests(bytes32 digest) public { + // Skip zero digest to avoid edge cases + vm.assume(digest != bytes32(0)); + + // Create valid proof for the digest + sigDigest = keccak256( + abi.encodePacked(toBytes32Format(address(fastSwitchboard)), arbChainSlug, digest) + ); + bytes memory proof = createSignature(sigDigest, watcherPrivateKey); + + // Expect success and event emission + vm.expectEmit(true, true, true, false); + emit FastSwitchboard.Attested(digest, watcherEOA); + + fastSwitchboard.attest(digest, proof); + + // Verify attestation + assertTrue(fastSwitchboard.isAttested(digest), "Digest should be attested"); + assertTrue(fastSwitchboard.allowPayload(digest, bytes32(0)), "Payload should be allowed"); + } +} From db5a18df8b275572c1a294dfbd31616912aa06ab Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 8 Aug 2025 16:02:20 +0530 Subject: [PATCH 080/139] feat: watcher tests --- contracts/evmx/watcher/Configurations.sol | 4 +- contracts/evmx/watcher/RequestHandler.sol | 4 + contracts/evmx/watcher/Watcher.sol | 4 + contracts/evmx/watcher/WatcherBase.sol | 8 +- contracts/utils/common/Errors.sol | 3 + test/SetupTest.t.sol | 4 +- test/evmx/Watcher.t.sol | 934 +++++++++++++++++++++- test/protocol/TriggerTest.t.sol | 2 + 8 files changed, 944 insertions(+), 19 deletions(-) diff --git a/contracts/evmx/watcher/Configurations.sol b/contracts/evmx/watcher/Configurations.sol index 33d239ca..50bb0999 100644 --- a/contracts/evmx/watcher/Configurations.sol +++ b/contracts/evmx/watcher/Configurations.sol @@ -66,7 +66,7 @@ contract Configurations is ConfigurationsStorage, Initializable, Ownable, Watche /// @param chainSlug The identifier of the network /// @param plug The address of the plug /// @param isValid Whether the plug is valid - event IsValidPlugSet(address appGateway, uint32 chainSlug, bytes32 plug, bool isValid); + event IsValidPlugSet(bool isValid, uint32 chainSlug, bytes32 plug, address appGateway); constructor() { _disableInitializers(); // disable for implementation @@ -128,7 +128,7 @@ contract Configurations is ConfigurationsStorage, Initializable, Ownable, Watche address appGateway_ ) external onlyWatcher { isValidPlug[appGateway_][chainSlug_][plug_] = isValid_; - emit IsValidPlugSet(appGateway_, chainSlug_, plug_, isValid_); + emit IsValidPlugSet(isValid_, chainSlug_, plug_, appGateway_); } /// @notice Retrieves the configuration for a specific plug on a network diff --git a/contracts/evmx/watcher/RequestHandler.sol b/contracts/evmx/watcher/RequestHandler.sol index b6f53d4c..c3836d40 100644 --- a/contracts/evmx/watcher/RequestHandler.sol +++ b/contracts/evmx/watcher/RequestHandler.sol @@ -77,6 +77,8 @@ contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, Addres event RequestSettled(uint40 requestCount, address winner); event RequestCompletedWithErrors(uint40 requestCount); event RequestCancelled(uint40 requestCount); + event PrecompileSet(bytes4 callType, IPrecompile precompile); + event RequestPayloadCountLimitSet(uint128 requestPayloadCountLimit); modifier isRequestCancelled(uint40 requestCount_) { if (_requests[requestCount_].requestTrackingParams.isRequestCancelled) @@ -101,10 +103,12 @@ contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, Addres function setPrecompile(bytes4 callType_, IPrecompile precompile_) external onlyOwner { precompiles[callType_] = precompile_; + emit PrecompileSet(callType_, precompile_); } function setRequestPayloadCountLimit(uint128 requestPayloadCountLimit_) external onlyOwner { requestPayloadCountLimit = requestPayloadCountLimit_; + emit RequestPayloadCountLimitSet(requestPayloadCountLimit_); } function getPrecompileFees( diff --git a/contracts/evmx/watcher/Watcher.sol b/contracts/evmx/watcher/Watcher.sol index 18c0380d..0c714c3f 100644 --- a/contracts/evmx/watcher/Watcher.sol +++ b/contracts/evmx/watcher/Watcher.sol @@ -7,6 +7,8 @@ import "../interfaces/IPromise.sol"; contract Watcher is Trigger { using LibCall for address; + event CoreContractsSet(address requestHandler, address configManager, address promiseResolver); + constructor() { _disableInitializers(); // disable for implementation } @@ -31,6 +33,8 @@ contract Watcher is Trigger { requestHandler__ = IRequestHandler(requestHandler_); configurations__ = IConfigurations(configManager_); promiseResolver__ = IPromiseResolver(promiseResolver_); + + emit CoreContractsSet(requestHandler_, configManager_, promiseResolver_); } function isWatcher(address account_) public view override returns (bool) { diff --git a/contracts/evmx/watcher/WatcherBase.sol b/contracts/evmx/watcher/WatcherBase.sol index 468dcbcf..c661c288 100644 --- a/contracts/evmx/watcher/WatcherBase.sol +++ b/contracts/evmx/watcher/WatcherBase.sol @@ -5,6 +5,7 @@ import "../interfaces/IWatcher.sol"; import "../interfaces/IConfigurations.sol"; import "../interfaces/IPromiseResolver.sol"; import "../interfaces/IRequestHandler.sol"; +import "../../utils/common/Errors.sol"; /// @title WatcherBase /// @notice Base contract for the Watcher contract @@ -13,19 +14,18 @@ contract WatcherBase { // The address of the Watcher contract IWatcher public watcher__; - // Only Watcher can call functions modifier onlyWatcher() { - require(msg.sender == address(watcher__), "Only Watcher can call"); + if (msg.sender != address(watcher__)) revert OnlyWatcherAllowed(); _; } modifier onlyRequestHandler() { - require(msg.sender == address(requestHandler__()), "Only RequestHandler can call"); + if (msg.sender != address(requestHandler__())) revert OnlyRequestHandlerAllowed(); _; } modifier onlyPromiseResolver() { - require(msg.sender == address(promiseResolver__()), "Only PromiseResolver can call"); + if (msg.sender != address(promiseResolver__())) revert OnlyPromiseResolverAllowed(); _; } diff --git a/contracts/utils/common/Errors.sol b/contracts/utils/common/Errors.sol index 40cfcf80..60e0778c 100644 --- a/contracts/utils/common/Errors.sol +++ b/contracts/utils/common/Errors.sol @@ -74,3 +74,6 @@ error InvalidData(); error InvalidSignature(); error DeadlinePassed(); +// Only Watcher can call functions +error OnlyRequestHandlerAllowed(); +error OnlyPromiseResolverAllowed(); diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 434f6f46..c83c8c55 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -54,11 +54,11 @@ contract SetupStore is Test { uint32 optChainSlug = 11155420; uint32 evmxSlug = 1; - uint256 expiryTime = 864000; + uint256 expiryTime = 86400; uint256 bidTimeout = 86400; uint256 maxReAuctionCount = 10; uint256 auctionEndDelaySeconds = 0; - uint256 maxScheduleDelayInSeconds = 86400; + uint256 maxScheduleDelayInSeconds = 86500; uint256 maxMsgValueLimit = 1 ether; uint256 writeFees = 10000; diff --git a/test/evmx/Watcher.t.sol b/test/evmx/Watcher.t.sol index 98dddcc3..dafcfbee 100644 --- a/test/evmx/Watcher.t.sol +++ b/test/evmx/Watcher.t.sol @@ -2,27 +2,939 @@ pragma solidity ^0.8.21; import "../SetupTest.t.sol"; +import "../../contracts/evmx/watcher/Watcher.sol"; +import "../../contracts/evmx/watcher/RequestHandler.sol"; +import "../../contracts/evmx/watcher/Configurations.sol"; +import "../../contracts/evmx/watcher/PromiseResolver.sol"; +import "../../contracts/evmx/watcher/precompiles/ReadPrecompile.sol"; +import "../../contracts/evmx/watcher/precompiles/WritePrecompile.sol"; +import "../../contracts/evmx/watcher/precompiles/SchedulePrecompile.sol"; +import "../../contracts/evmx/interfaces/IWatcher.sol"; +import "../../contracts/evmx/interfaces/IRequestHandler.sol"; +import "../../contracts/evmx/interfaces/IConfigurations.sol"; +import "../../contracts/evmx/interfaces/IPromiseResolver.sol"; +import "../../contracts/evmx/interfaces/IPrecompile.sol"; +import "../../contracts/utils/common/Structs.sol"; +import "../../contracts/utils/common/Errors.sol"; +import "../../contracts/utils/common/Converters.sol"; +import "solady/auth/Ownable.sol"; +import "../apps/app-gateways/counter/CounterAppGateway.sol"; contract WatcherTest is AppGatewayBaseSetup { + uint256 private ownerPrivateKey = + 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef; + + address public owner = vm.addr(ownerPrivateKey); + address public nonOwner = vm.addr(c++); + address public user = vm.addr(c++); + bytes32 plug = toBytes32Format(vm.addr(c++)); + + CounterAppGateway public appGateway; + address public watcherAddress; + address public requestHandlerAddress; + address public configurationsAddress; + address public promiseResolverAddress; + function setUp() public { deploy(); + + watcherAddress = address(watcher); + requestHandlerAddress = address(requestHandler); + configurationsAddress = address(configurations); + promiseResolverAddress = address(promiseResolver); + + appGateway = new CounterAppGateway(address(addressResolver), writeFees); + depositNativeAndCredits(arbChainSlug, 1 ether, 0, address(appGateway)); + + hoax(address(appGateway)); + watcher.setIsValidPlug(true, arbConfig.chainSlug, plug); } - function testWatcherDeployment() public { - deploy(); + // ============ WATCHER ACCESS CONTROL TESTS ============ + + function testWatcherSetCoreContracts() public { + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(Ownable.Unauthorized.selector)); + watcher.setCoreContracts(address(0x1), address(0x2), address(0x3)); + + hoax(watcherEOA); + vm.expectEmit(true, true, true, true); + emit Watcher.CoreContractsSet(address(0x1), address(0x2), address(0x3)); + watcher.setCoreContracts(address(0x1), address(0x2), address(0x3)); + + assertEq(address(watcher.requestHandler__()), address(0x1)); + assertEq(address(watcher.configurations__()), address(0x2)); + assertEq(address(watcher.promiseResolver__()), address(0x3)); + } + + function testWatcherRescueFunds() public { + vm.expectRevert(abi.encodeWithSelector(InvalidSignature.selector)); + watcher.rescueFunds(ETH_ADDRESS, user, 100, watcherNonce, ""); + assertEq(user.balance, 0); + + bytes memory invalidSignature = _createWatcherSignature( + address(0), + abi.encode(ETH_ADDRESS, user, uint256(100)) + ); + + vm.expectRevert(abi.encodeWithSelector(InvalidSignature.selector)); + watcher.rescueFunds(ETH_ADDRESS, user, 100, watcherNonce, invalidSignature); + assertEq(user.balance, 0); + + bytes memory signature = _createWatcherSignature( + watcherAddress, + abi.encode(ETH_ADDRESS, user, uint256(100)) + ); + + vm.deal(watcherAddress, 100); + watcher.rescueFunds(ETH_ADDRESS, user, 100, watcherNonce, signature); + assertEq(user.balance, 100); + } + + function testWatcherSetTriggerFees() public { + uint256 newFees = 1000000; + + vm.expectRevert(abi.encodeWithSelector(InvalidSignature.selector)); + watcher.setTriggerFees(newFees, watcherNonce, ""); + assertEq(watcher.triggerFees(), triggerFees); + + bytes memory invalidSignature = _createWatcherSignature(address(0), abi.encode(newFees)); + vm.expectRevert(abi.encodeWithSelector(InvalidSignature.selector)); + watcher.setTriggerFees(newFees, watcherNonce, invalidSignature); + assertEq(watcher.triggerFees(), triggerFees); + + bytes memory signature = _createWatcherSignature(watcherAddress, abi.encode(newFees)); + vm.expectEmit(true, true, true, true); + emit Trigger.TriggerFeesSet(newFees); + watcher.setTriggerFees(newFees, watcherNonce, signature); + + assertEq(watcher.triggerFees(), newFees); + } + + function testWatcherMultiCall() public { + address contractAddress = address(writePrecompile); + bytes32 payloadId = keccak256(abi.encodePacked("random id")); + bytes32 digest = keccak256(abi.encodePacked("random digest")); + bytes memory proof = createSignature( + keccak256( + abi.encodePacked( + toBytes32Format(address(arbConfig.switchboard)), + arbConfig.chainSlug, + digest + ) + ), + watcherPrivateKey + ); + bytes memory data = abi.encodeWithSelector( + WritePrecompile.uploadProof.selector, + payloadId, + proof + ); + bytes memory signature = _createWatcherSignature(contractAddress, data); + + WatcherMultiCallParams[] memory params = new WatcherMultiCallParams[](1); + vm.expectRevert(abi.encodeWithSelector(InvalidContract.selector)); + watcher.watcherMultiCall(params); + + params[0] = WatcherMultiCallParams({ + contractAddress: contractAddress, + data: bytes(""), + nonce: watcherNonce, + signature: signature + }); + vm.expectRevert(abi.encodeWithSelector(InvalidData.selector)); + watcher.watcherMultiCall(params); + + params[0] = WatcherMultiCallParams({ + contractAddress: contractAddress, + data: data, + nonce: watcherNonce, + signature: bytes("") + }); + vm.expectRevert(abi.encodeWithSelector(InvalidSignature.selector)); + watcher.watcherMultiCall(params); + + bytes32 multiCallDigest = keccak256( + abi.encode(address(watcher), evmxSlug, watcherNonce, contractAddress, data) + ); + bytes memory invalidSignature = createSignature(multiCallDigest, ownerPrivateKey); + params[0] = WatcherMultiCallParams({ + contractAddress: contractAddress, + data: data, + nonce: watcherNonce, + signature: invalidSignature + }); + vm.expectRevert(abi.encodeWithSelector(InvalidSignature.selector)); + watcher.watcherMultiCall(params); + + params[0] = WatcherMultiCallParams({ + contractAddress: contractAddress, + data: data, + nonce: watcherNonce, + signature: signature + }); + vm.expectEmit(true, true, true, false); + emit WriteProofUploaded(payloadId, proof); + watcher.watcherMultiCall(params); + assertEq(writePrecompile.watcherProofs(payloadId), proof); + + vm.expectRevert(abi.encodeWithSelector(NonceUsed.selector)); + watcher.watcherMultiCall(params); + watcherNonce++; + } + + function testWatcherCallAppGateways() public { + TriggerParams[] memory params = new TriggerParams[](1); + params[0] = TriggerParams({ + triggerId: bytes32(0), + plug: plug, + appGatewayId: toBytes32Format(address(appGateway)), + chainSlug: arbConfig.chainSlug, + overrides: "", + payload: abi.encodeWithSelector( + CounterAppGateway.initializeOnChain.selector, + arbConfig.chainSlug + ) + }); + + bytes memory signature = _createWatcherSignature(address(watcher), abi.encode(params)); + bytes32 multiCallDigest = keccak256( + abi.encode(address(watcher), evmxSlug, watcherNonce, watcherAddress, abi.encode(params)) + ); + bytes memory invalidSignature = createSignature(multiCallDigest, ownerPrivateKey); + + WatcherMultiCallParams memory callParams = WatcherMultiCallParams({ + contractAddress: address(watcher), + data: abi.encode(params), + nonce: watcherNonce, + signature: invalidSignature + }); + vm.expectRevert(abi.encodeWithSelector(InvalidSignature.selector)); + watcher.callAppGateways(callParams); + + callParams.signature = signature; + vm.expectEmit(true, true, true, true); + emit Trigger.TriggerSucceeded( + 0x0000000000000000000000000000000000000000000000000000000000000000 + ); + watcher.callAppGateways(callParams); + + vm.expectRevert(abi.encodeWithSelector(NonceUsed.selector)); + watcher.callAppGateways(callParams); + } + + // // ============ REQUEST HANDLER ACCESS CONTROL TESTS ============ + + function testRequestHandlerSetPrecompile() public { + vm.expectRevert(abi.encodeWithSelector(Ownable.Unauthorized.selector)); + requestHandler.setPrecompile(bytes4(0x12345678), IPrecompile(address(0x1))); + + hoax(watcherEOA); + vm.expectEmit(true, true, true, true); + emit RequestHandler.PrecompileSet(bytes4(0x12345678), IPrecompile(address(0x1))); + requestHandler.setPrecompile(bytes4(0x12345678), IPrecompile(address(0x1))); + } + + function testRequestHandlerSetRequestPayloadCountLimit() public { + vm.expectRevert(abi.encodeWithSelector(Ownable.Unauthorized.selector)); + requestHandler.setRequestPayloadCountLimit(200); + + hoax(watcherEOA); + vm.expectEmit(true, true, true, true); + emit RequestHandler.RequestPayloadCountLimitSet(200); + requestHandler.setRequestPayloadCountLimit(200); + } + + function testRequestHandlerRescueFunds() public { + address rescueTo = address(0x2); + uint256 initialBalance = rescueTo.balance; + + vm.deal(address(requestHandler), 100); + hoax(watcherAddress); + requestHandler.rescueFunds(ETH_ADDRESS, rescueTo, 100); + + assertEq(rescueTo.balance, initialBalance + 100); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + requestHandler.rescueFunds(ETH_ADDRESS, rescueTo, 100); + } + + function testRequestHandlerSubmitRequest() public { + QueueParams[] memory queueParams = new QueueParams[](0); + + hoax(watcherAddress); + requestHandler.submitRequest( + 1000, + address(0x1), + address(0x2), + address(0x3), + queueParams, + "" + ); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + requestHandler.submitRequest( + 1000, + address(0x1), + address(0x2), + address(0x3), + queueParams, + "" + ); + } + + function testRequestHandlerIncreaseFees() public { + uint40 requestCount = 0; + appGateway.deployContracts(arbConfig.chainSlug); + + hoax(watcherAddress); + vm.expectRevert(abi.encodeWithSelector(OnlyAppGateway.selector)); + requestHandler.increaseFees(requestCount, writeFees + 100, address(vm.addr(c++))); + + hoax(watcherAddress); + vm.expectRevert( + abi.encodeWithSelector(NewMaxFeesLowerThanCurrent.selector, writeFees, writeFees) + ); + requestHandler.increaseFees(requestCount, writeFees, address(appGateway)); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + requestHandler.increaseFees(requestCount, writeFees, address(appGateway)); + + hoax(watcherAddress); + vm.expectRevert(abi.encodeWithSelector(InsufficientFees.selector)); + requestHandler.increaseFees(requestCount, 2 ether, address(appGateway)); + + hoax(watcherAddress); + requestHandler.increaseFees(requestCount, writeFees + 100, address(appGateway)); + + bytes32[] memory contractIds = new bytes32[](1); + contractIds[0] = appGateway.counter(); + requestCount = executeDeploy(appGateway, arbConfig.chainSlug, contractIds); + + hoax(watcherAddress); + vm.expectRevert(abi.encodeWithSelector(RequestAlreadySettled.selector)); + requestHandler.increaseFees(requestCount, writeFees + 100, address(appGateway)); + } + + function testRequestHandlerCancelRequestForReverts() public { + uint40 requestCount = 0; + appGateway.deployContracts(arbConfig.chainSlug); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(NotPromiseResolver.selector)); + requestHandler.cancelRequestForReverts(requestCount); + + hoax(promiseResolverAddress); + vm.expectEmit(true, true, true, true); + emit RequestHandler.RequestCancelled(requestCount); + emit RequestHandler.RequestSettled(requestCount, address(0)); + requestHandler.cancelRequestForReverts(requestCount); + + hoax(promiseResolverAddress); + vm.expectRevert(abi.encodeWithSelector(RequestAlreadyCancelled.selector)); + requestHandler.cancelRequestForReverts(requestCount); + } + + function testRequestHandlerHandleRevert() public { + uint40 requestCount = 0; + appGateway.deployContracts(arbConfig.chainSlug); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(NotPromiseResolver.selector)); + requestHandler.handleRevert(requestCount); + + hoax(promiseResolverAddress); + vm.expectEmit(true, true, true, true); + emit RequestHandler.RequestCancelled(requestCount); + emit RequestHandler.RequestSettled(requestCount, address(0)); + requestHandler.handleRevert(requestCount); + + hoax(promiseResolverAddress); + vm.expectRevert(abi.encodeWithSelector(RequestAlreadyCancelled.selector)); + requestHandler.handleRevert(requestCount); + } + + function testRequestHandlerCancelRequest() public { + uint40 requestCount = 0; + appGateway.deployContracts(arbConfig.chainSlug); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + requestHandler.cancelRequest(requestCount, address(appGateway)); + + hoax(watcherAddress); + vm.expectRevert(abi.encodeWithSelector(InvalidCaller.selector)); + requestHandler.cancelRequest(requestCount, address(0x01)); + + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit RequestHandler.RequestCancelled(requestCount); + emit RequestHandler.RequestSettled(requestCount, address(0)); + requestHandler.cancelRequest(requestCount, address(appGateway)); + + hoax(watcherAddress); + vm.expectRevert(abi.encodeWithSelector(RequestAlreadyCancelled.selector)); + requestHandler.cancelRequest(requestCount, address(appGateway)); + } - vm.assertEq(address(arbConfig.feesPlug.socket__()), address(arbConfig.socket)); - vm.assertEq(address(optConfig.feesPlug.socket__()), address(optConfig.socket)); + function testRequestHandlerAssignTransmitter() public { + uint40 requestCount = 0; + appGateway.deployContracts(arbConfig.chainSlug); + Bid memory bid = Bid({fee: 100, transmitter: transmitterEOA, extraData: ""}); - vm.assertEq(address(arbConfig.contractFactoryPlug.socket__()), address(arbConfig.socket)); - vm.assertEq(address(optConfig.contractFactoryPlug.socket__()), address(optConfig.socket)); + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(InvalidCaller.selector)); + requestHandler.assignTransmitter(1, bid); + + hoax(address(auctionManager)); + requestHandler.assignTransmitter(requestCount, bid); + + hoax(watcherAddress); + requestHandler.cancelRequest(requestCount, address(appGateway)); + hoax(address(auctionManager)); + vm.expectRevert(abi.encodeWithSelector(RequestAlreadyCancelled.selector)); + requestHandler.assignTransmitter(requestCount, bid); + } + + function testRequestHandlerUpdateRequestAndProcessBatch() public { + appGateway.deployContracts(arbConfig.chainSlug); + uint40 requestCount = 0; + uint40[] memory batches = requestHandler.getRequestBatchIds(requestCount); + bytes32[] memory payloadIds = requestHandler.getBatchPayloadIds(batches[0]); + bytes32 payloadId = payloadIds[0]; + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(NotPromiseResolver.selector)); + requestHandler.updateRequestAndProcessBatch(requestCount, payloadId); + + hoax(watcherAddress); + requestHandler.cancelRequest(requestCount, address(appGateway)); + hoax(address(promiseResolver)); + vm.expectRevert(abi.encodeWithSelector(RequestAlreadyCancelled.selector)); + requestHandler.updateRequestAndProcessBatch(requestCount, payloadId); + } + + // ============ CONFIGURATIONS ACCESS CONTROL TESTS ============ + + function testConfigurationsSetSocket() public { + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(Ownable.Unauthorized.selector)); + configurations.setSocket(1, bytes32(uint256(1))); + + hoax(watcherEOA); + vm.expectEmit(true, true, true, true); + emit Configurations.SocketSet(1, bytes32(uint256(1))); + configurations.setSocket(1, bytes32(uint256(1))); + } + + function testConfigurationsSetSwitchboard() public { + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(Ownable.Unauthorized.selector)); + configurations.setSwitchboard(1, bytes32(uint256(1)), 1); + + hoax(watcherEOA); + vm.expectEmit(true, true, true, true); + emit Configurations.SwitchboardSet(1, bytes32(uint256(1)), 1); + configurations.setSwitchboard(1, bytes32(uint256(1)), 1); } - function testRevertInitSocketPlug() public { - address hackerEOA = address(0x123); - uint64 sbId = arbConfig.switchboard.switchboardId(); + function testConfigurationsSetAppGatewayConfigs() public { + AppGatewayConfig[] memory configs = new AppGatewayConfig[](1); + configs[0] = AppGatewayConfig({ + chainSlug: 1, + plug: bytes32(uint256(1)), + plugConfig: PlugConfigGeneric({appGatewayId: bytes32(uint256(1)), switchboardId: 1}) + }); + + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit Configurations.PlugAdded(bytes32(uint256(1)), 1, bytes32(uint256(1))); + configurations.setAppGatewayConfigs(configs); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + configurations.setAppGatewayConfigs(configs); + } + + function testConfigurationsSetIsValidPlug() public { + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit Configurations.IsValidPlugSet(true, 1, bytes32(uint256(1)), address(appGateway)); + configurations.setIsValidPlug(true, 1, bytes32(uint256(1)), address(appGateway)); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + configurations.setIsValidPlug(true, 1, bytes32(uint256(1)), address(appGateway)); + } + + function testConfigurationsRescueFunds() public { + address rescueTo = address(0x2); + uint256 initialBalance = rescueTo.balance; + + vm.deal(address(configurations), 100); + hoax(watcherAddress); + configurations.rescueFunds(ETH_ADDRESS, rescueTo, 100); + + assertEq(rescueTo.balance, initialBalance + 100); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + configurations.rescueFunds(ETH_ADDRESS, rescueTo, 100); + } + + // ============ PROMISE RESOLVER ACCESS CONTROL TESTS ============ + + function testPromiseResolverResolvePromises() public { + appGateway.deployContracts(arbConfig.chainSlug); + uint40 requestCount = 0; + uint40[] memory batches = requestHandler.getRequestBatchIds(requestCount); + bytes32[] memory payloadIds = requestHandler.getBatchPayloadIds(batches[0]); + bytes32 payloadId = payloadIds[0]; + Bid memory bid = Bid({fee: 100, transmitter: transmitterEOA, extraData: ""}); + hoax(address(auctionManager)); + requestHandler.assignTransmitter(requestCount, bid); + + PromiseReturnData[] memory promiseReturnData = new PromiseReturnData[](1); + promiseReturnData[0] = PromiseReturnData({ + exceededMaxCopy: false, + payloadId: payloadId, + returnData: abi.encode(vm.addr(c++)) + }); + + vm.expectEmit(true, true, true, true); + emit PromiseResolver.PromiseResolved( + payloadId, + watcher.getPayloadParams(payloadId).asyncPromise + ); + hoax(watcherAddress); + promiseResolver.resolvePromises(promiseReturnData); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + promiseResolver.resolvePromises(promiseReturnData); + } + + function testPromiseResolverMarkRevert() public { + PromiseReturnData memory resolvedPromise = PromiseReturnData({ + exceededMaxCopy: false, + payloadId: bytes32(uint256(1)), + returnData: "" + }); + + hoax(watcherAddress); + promiseResolver.markRevert(resolvedPromise, true); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + promiseResolver.markRevert(resolvedPromise, true); + } + + function testPromiseResolverRescueFunds() public { + address rescueTo = address(0x2); + uint256 initialBalance = rescueTo.balance; + + vm.deal(address(promiseResolver), 100); + hoax(watcherAddress); + promiseResolver.rescueFunds(ETH_ADDRESS, rescueTo, 100); + assertEq(rescueTo.balance, initialBalance + 100); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + promiseResolver.rescueFunds(ETH_ADDRESS, rescueTo, 100); + } + + // // ============ READ PRECOMPILE ACCESS CONTROL TESTS ============ + + function testReadPrecompileSetFees() public { + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit ReadPrecompile.ReadFeesSet(1000); + readPrecompile.setFees(1000); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + readPrecompile.setFees(1000); + } + + function testReadPrecompileSetExpiryTime() public { + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit ReadPrecompile.ExpiryTimeSet(3600); + readPrecompile.setExpiryTime(3600); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + readPrecompile.setExpiryTime(3600); + } + + function testReadPrecompileRescueFunds() public { + address rescueTo = address(0x2); + uint256 initialBalance = rescueTo.balance; + + vm.deal(address(readPrecompile), 100); + hoax(watcherAddress); + readPrecompile.rescueFunds(ETH_ADDRESS, rescueTo, 100); + + assertEq(rescueTo.balance, initialBalance + 100); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + readPrecompile.rescueFunds(ETH_ADDRESS, rescueTo, 100); + } + + function testReadPrecompileHandlePayload() public { + Transaction memory transaction = Transaction({ + chainSlug: 1, + target: bytes32(uint256(0x1)), + payload: abi.encode(vm.addr(c++)) + }); + PayloadParams memory payloadParams = PayloadParams({ + payloadPointer: 0, + callType: bytes4(0), + asyncPromise: address(0), + appGateway: address(0), + payloadId: bytes32(0), + precompileData: abi.encode(transaction, 0), + deadline: 0, + resolvedAt: 0 + }); + + hoax(address(requestHandler)); + vm.expectEmit(true, true, true, true); + emit ReadPrecompile.ReadRequested(transaction, 0, bytes32(0)); + readPrecompile.handlePayload(address(0x1), payloadParams); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyRequestHandlerAllowed.selector)); + readPrecompile.handlePayload(address(0x1), payloadParams); + } + + function testReadPrecompileResolvePayload() public { + PayloadParams memory payloadParams = PayloadParams({ + payloadPointer: 0, + callType: bytes4(0), + asyncPromise: address(0), + appGateway: address(0), + payloadId: bytes32(0), + precompileData: "", + deadline: 0, + resolvedAt: 0 + }); + + hoax(address(requestHandler)); + readPrecompile.resolvePayload(payloadParams); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyRequestHandlerAllowed.selector)); + readPrecompile.resolvePayload(payloadParams); + } + + // ============ WRITE PRECOMPILE ACCESS CONTROL TESTS ============ + + function testWritePrecompileSetFees() public { + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit WritePrecompile.FeesSet(1000); + writePrecompile.setFees(1000); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + writePrecompile.setFees(1000); + } + + function testWritePrecompileSetExpiryTime() public { + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit WritePrecompile.ExpiryTimeSet(3600); + writePrecompile.setExpiryTime(3600); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + writePrecompile.setExpiryTime(3600); + } + + function testWritePrecompileRescueFunds() public { + address rescueTo = address(0x2); + uint256 initialBalance = rescueTo.balance; + + vm.deal(address(writePrecompile), 100); + hoax(watcherAddress); + writePrecompile.rescueFunds(ETH_ADDRESS, rescueTo, 100); + assertEq(rescueTo.balance, initialBalance + 100); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + writePrecompile.rescueFunds(ETH_ADDRESS, rescueTo, 100); + } + + function testWritePrecompileUploadProof() public { + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit WritePrecompile.WriteProofUploaded(bytes32(uint256(1)), "proof"); + writePrecompile.uploadProof(bytes32(uint256(1)), "proof"); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + writePrecompile.uploadProof(bytes32(uint256(1)), "proof"); + } + + function testWritePrecompileUpdateChainMaxMsgValueLimits() public { + hoax(watcherEOA); + vm.expectEmit(true, true, true, true); + emit WritePrecompile.ChainMaxMsgValueLimitsUpdated(1, 1000); + writePrecompile.updateChainMaxMsgValueLimits(1, 1000); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(Ownable.Unauthorized.selector)); + writePrecompile.updateChainMaxMsgValueLimits(1, 1000); + } + + function testWritePrecompileSetContractFactoryPlugs() public { + hoax(watcherEOA); + vm.expectEmit(true, true, true, true); + emit WritePrecompile.ContractFactoryPlugSet(1, bytes32(uint256(1))); + writePrecompile.setContractFactoryPlugs(1, bytes32(uint256(1))); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(Ownable.Unauthorized.selector)); + writePrecompile.setContractFactoryPlugs(1, bytes32(uint256(1))); + } + + function testWritePrecompileHandlePayload() public { + Transaction memory transaction = Transaction({ + chainSlug: arbConfig.chainSlug, + target: bytes32(uint256(0x1)), + payload: abi.encode(vm.addr(c++)) + }); + PayloadParams memory payloadParams = PayloadParams({ + payloadPointer: 0, + callType: bytes4(0), + asyncPromise: address(0), + appGateway: address(appGateway), + payloadId: bytes32(0), + precompileData: abi.encode(appGateway, transaction, WriteFinality.LOW, 0, 0, 0), + deadline: 0, + resolvedAt: 0 + }); + + hoax(address(requestHandler)); + writePrecompile.handlePayload(address(transmitterEOA), payloadParams); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyRequestHandlerAllowed.selector)); + writePrecompile.handlePayload(address(transmitterEOA), payloadParams); + } + + function testWritePrecompileResolvePayload() public { + PayloadParams memory payloadParams = PayloadParams({ + payloadPointer: 0, + callType: bytes4(0), + asyncPromise: address(0), + appGateway: address(0), + payloadId: bytes32(0), + precompileData: "", + deadline: 0, + resolvedAt: 0 + }); + + hoax(address(requestHandler)); + writePrecompile.resolvePayload(payloadParams); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyRequestHandlerAllowed.selector)); + writePrecompile.resolvePayload(payloadParams); + } + + // ============ SCHEDULE PRECOMPILE ACCESS CONTROL TESTS ============ + + function testSchedulePrecompileSetMaxScheduleDelayInSeconds() public { + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit SchedulePrecompile.MaxScheduleDelayInSecondsSet(7200); + schedulePrecompile.setMaxScheduleDelayInSeconds(7200); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + schedulePrecompile.setMaxScheduleDelayInSeconds(7200); + } + + function testSchedulePrecompileSetScheduleFeesPerSecond() public { + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit SchedulePrecompile.ScheduleFeesPerSecondSet(100); + schedulePrecompile.setScheduleFeesPerSecond(100); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + schedulePrecompile.setScheduleFeesPerSecond(100); + } + + function testSchedulePrecompileSetScheduleCallbackFees() public { + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit SchedulePrecompile.ScheduleCallbackFeesSet(500); + schedulePrecompile.setScheduleCallbackFees(500); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + schedulePrecompile.setScheduleCallbackFees(500); + } + + function testSchedulePrecompileSetExpiryTime() public { + uint256 expiryTime = expiryTime + 100; + hoax(watcherAddress); + vm.expectEmit(true, true, true, true); + emit SchedulePrecompile.ExpiryTimeSet(expiryTime); + schedulePrecompile.setExpiryTime(expiryTime); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + schedulePrecompile.setExpiryTime(expiryTime); + } + + function testSchedulePrecompileRescueFunds() public { + address rescueTo = address(0x2); + uint256 initialBalance = rescueTo.balance; + + vm.deal(address(schedulePrecompile), 100); + hoax(watcherAddress); + schedulePrecompile.rescueFunds(ETH_ADDRESS, rescueTo, 100); + + assertEq(rescueTo.balance, initialBalance + 100); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyWatcherAllowed.selector)); + schedulePrecompile.rescueFunds(ETH_ADDRESS, rescueTo, 100); + } + + function testSchedulePrecompileHandlePayload() public { + appGateway.deployContracts(arbConfig.chainSlug); + uint40 requestCount = 0; + uint40[] memory batches = requestHandler.getRequestBatchIds(requestCount); + bytes32[] memory payloadIds = requestHandler.getBatchPayloadIds(batches[0]); + bytes32 payloadId = payloadIds[0]; + PayloadParams memory payloadParams = watcher.getPayloadParams(payloadId); + + hoax(address(requestHandler)); + schedulePrecompile.handlePayload(address(transmitterEOA), payloadParams); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyRequestHandlerAllowed.selector)); + schedulePrecompile.handlePayload(address(transmitterEOA), payloadParams); + } + + function testSchedulePrecompileResolvePayload() public { + PayloadParams memory payloadParams = PayloadParams({ + payloadPointer: 0, + callType: bytes4(0), + asyncPromise: address(0), + appGateway: address(0), + payloadId: bytes32(0), + precompileData: abi.encode(0, 0), + deadline: 0, + resolvedAt: 0 + }); + + hoax(address(requestHandler)); + vm.expectEmit(true, true, true, true); + emit SchedulePrecompile.ScheduleResolved(bytes32(0)); + schedulePrecompile.resolvePayload(payloadParams); + + hoax(nonOwner); + vm.expectRevert(abi.encodeWithSelector(OnlyRequestHandlerAllowed.selector)); + schedulePrecompile.resolvePayload(payloadParams); + } + + // ============ INVALID PLUG CONNECTION TESTS ============ + + function testInvalidPlugConnection() public { + uint32 chainSlug = 1; + bytes32 target = bytes32(uint256(0x123)); + address validAppGateway = address(0x456); + bytes32 switchboardType = bytes32(uint256(0x789)); + uint64 switchboardId = 123; + + AppGatewayConfig[] memory configs = new AppGatewayConfig[](1); + configs[0] = AppGatewayConfig({ + chainSlug: chainSlug, + plug: target, + plugConfig: PlugConfigGeneric({ + appGatewayId: toBytes32Format(validAppGateway), + switchboardId: switchboardId + }) + }); + + hoax(watcherAddress); + configurations.setAppGatewayConfigs(configs); + + hoax(watcherEOA); + configurations.setSwitchboard(chainSlug, switchboardType, switchboardId); + + address invalidAppGateway = address(0x999); + vm.expectRevert(InvalidGateway.selector); + configurations.verifyConnections(chainSlug, target, invalidAppGateway, switchboardType); + + bytes32 invalidSwitchboardType = bytes32(uint256(0x999)); + vm.expectRevert(InvalidSwitchboard.selector); + configurations.verifyConnections( + chainSlug, + target, + validAppGateway, + invalidSwitchboardType + ); + + bytes32 invalidTarget = bytes32(uint256(0x999)); + vm.expectRevert(InvalidGateway.selector); + configurations.verifyConnections( + chainSlug, + invalidTarget, + validAppGateway, + switchboardType + ); + + configurations.verifyConnections(chainSlug, target, validAppGateway, switchboardType); + } + + function testInvalidPlugConnectionWithUnconfiguredChain() public { + uint32 unconfiguredChainSlug = 999; + bytes32 target = bytes32(uint256(0x123)); + bytes32 switchboardType = bytes32(uint256(0x789)); + + vm.expectRevert(InvalidGateway.selector); + configurations.verifyConnections( + unconfiguredChainSlug, + target, + address(appGateway), + switchboardType + ); + } + + function testInvalidPlugConnectionWithZeroAddresses() public { + uint32 chainSlug = 1; + bytes32 target = bytes32(uint256(0x123)); + address zeroAppGateway = address(0); + bytes32 switchboardType = bytes32(uint256(0x789)); + + AppGatewayConfig[] memory configs = new AppGatewayConfig[](1); + configs[0] = AppGatewayConfig({ + chainSlug: chainSlug, + plug: target, + plugConfig: PlugConfigGeneric({ + appGatewayId: toBytes32Format(address(0x456)), + switchboardId: 123 + }) + }); + + hoax(watcherAddress); + configurations.setAppGatewayConfigs(configs); + + hoax(watcherEOA); + configurations.setSwitchboard(chainSlug, switchboardType, 123); - vm.expectRevert(abi.encodeWithSelector(SocketAlreadyInitialized.selector)); - arbConfig.feesPlug.initSocket(bytes32(0), address(hackerEOA), sbId); + vm.expectRevert(InvalidGateway.selector); + configurations.verifyConnections(chainSlug, target, zeroAppGateway, switchboardType); } } diff --git a/test/protocol/TriggerTest.t.sol b/test/protocol/TriggerTest.t.sol index 24f475e7..d581814d 100644 --- a/test/protocol/TriggerTest.t.sol +++ b/test/protocol/TriggerTest.t.sol @@ -92,4 +92,6 @@ contract TriggerTest is AppGatewayBaseSetup { // Check counter was incremented assertEq(gateway.counterVal(), incrementValue, "Gateway counter should be incremented"); } + + } From 059e2b2ba7a40f466dcb0c8ec57ab3a1dbc64337 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 14 Aug 2025 13:20:13 +0530 Subject: [PATCH 081/139] feat: receiver interface --- contracts/evmx/interfaces/IReceiver.sol | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 contracts/evmx/interfaces/IReceiver.sol diff --git a/contracts/evmx/interfaces/IReceiver.sol b/contracts/evmx/interfaces/IReceiver.sol new file mode 100644 index 00000000..398ab04b --- /dev/null +++ b/contracts/evmx/interfaces/IReceiver.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +/// @title IReceiver +/// @notice Interface for receiving transfers +interface IReceiver { + function onTransfer( + uint32 chainSlug_, + address token_, + uint256 creditAmount_, + uint256 nativeAmount_, + bytes memory data_ + ) external; +} From 096a288ddb09cf35ea7848ad228050879da66866 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 14 Aug 2025 13:20:35 +0530 Subject: [PATCH 082/139] feat: post deposit hook for receiver --- contracts/evmx/fees/Credit.sol | 29 +++++++++++++++++++--- contracts/evmx/interfaces/IFeesManager.sol | 3 ++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index fd001d24..cd4b9980 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -9,6 +9,7 @@ import "solady/auth/Ownable.sol"; import "../interfaces/IFeesManager.sol"; import "../interfaces/IFeesPlug.sol"; import "../interfaces/IFeesPool.sol"; +import "../interfaces/IReceiver.sol"; import {AddressResolverUtil} from "../helpers/AddressResolverUtil.sol"; import {NonceUsed, InvalidAmount, InsufficientCreditsAvailable, InsufficientBalance, InvalidChainSlug, NotRequestHandler} from "../../utils/common/Errors.sol"; @@ -61,8 +62,20 @@ abstract contract FeesManagerStorage is IFeesManager { /// @dev chainSlug => fees plug address mapping(uint32 => bytes32) public feesPlugs; - // slots [58-107] reserved for gap - uint256[50] _gap_after; + // slot 58 + /// @notice The name of the token + string public name = "Socket USDC"; + + // slot 59 + /// @notice The symbol of the token + string public symbol = "sUSDC"; + + // slot 60 + /// @notice The number of decimals for the token + uint8 public decimals = 18; + + // slots [61-107] reserved for gap + uint256[47] _gap_after; // slots [108-157] 50 slots reserved for address resolver util // 9 slots for app gateway base @@ -124,7 +137,8 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew address token_, address depositTo_, uint256 nativeAmount_, - uint256 creditAmount_ + uint256 creditAmount_, + bytes memory data_ ) external override onlyWatcher { tokenOnChainBalances[chainSlug_][token_] += creditAmount_ + nativeAmount_; @@ -142,6 +156,15 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew } } + if (data_.length > 0) + IReceiver(depositTo_).onTransfer( + chainSlug_, + token_, + creditAmount_, + nativeAmount_, + data_ + ); + emit Deposited(chainSlug_, token_, depositTo_, creditAmount_, nativeAmount_); } diff --git a/contracts/evmx/interfaces/IFeesManager.sol b/contracts/evmx/interfaces/IFeesManager.sol index ea81aad6..38f8e412 100644 --- a/contracts/evmx/interfaces/IFeesManager.sol +++ b/contracts/evmx/interfaces/IFeesManager.sol @@ -8,7 +8,8 @@ interface IFeesManager { address token_, address depositTo_, uint256 nativeAmount_, - uint256 creditAmount_ + uint256 creditAmount_, + bytes memory data_ ) external; function wrap(address receiver_) external payable; From 84a7e9650abe00b1ea2ae5e5619f55beeb3d33c1 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 14 Aug 2025 13:20:46 +0530 Subject: [PATCH 083/139] fix: tests --- test/SetupTest.t.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index c83c8c55..57e73017 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -601,7 +601,8 @@ contract FeesSetup is DeploySetup { address(token), user_, native_, - credits_ + credits_, + bytes("") ) ); From f4966518a1fe9a4732aede9808c699853f7cdad6 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 15 Aug 2025 03:07:06 +0530 Subject: [PATCH 084/139] feat: susdc --- contracts/evmx/interfaces/ISUSDC.sol | 10 ++ contracts/evmx/plugs/SUSDC.sol | 138 +++++++++++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 contracts/evmx/interfaces/ISUSDC.sol create mode 100644 contracts/evmx/plugs/SUSDC.sol diff --git a/contracts/evmx/interfaces/ISUSDC.sol b/contracts/evmx/interfaces/ISUSDC.sol new file mode 100644 index 00000000..37754c57 --- /dev/null +++ b/contracts/evmx/interfaces/ISUSDC.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +interface ISUSDC { + function burn(address user_, uint256 amount_) external; + + function mint(address receiver_, uint256 amount_) external; + + function balanceOf(address account_) external; +} diff --git a/contracts/evmx/plugs/SUSDC.sol b/contracts/evmx/plugs/SUSDC.sol new file mode 100644 index 00000000..5ef99cf1 --- /dev/null +++ b/contracts/evmx/plugs/SUSDC.sol @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.19; + +import "solady/tokens/ERC20.sol"; +import "../../utils/AccessControl.sol"; + +import "../../protocol/base/PlugBase.sol"; +import "../../utils/RescueFundsLib.sol"; +import {RESCUE_ROLE} from "../../utils/common/AccessRoles.sol"; + +import "../interfaces/ISUSDC.sol"; + +/// @title AdvancedToken +/// @notice An advanced ERC20 token with minting, burning, and pausing capabilities +/// @author Your Name +contract SUSDC is ERC20, AccessControl, PlugBase { + /// @notice The name of the token + string private _name; + + /// @notice The symbol of the token + string private _symbol; + + /// @notice The number of decimals for the token + uint8 private _decimals; + + /// @notice Emitted when tokens are minted + event TokensMinted(address indexed to, uint256 amount); + + /// @notice Emitted when tokens are burned + event TokensBurned(address indexed from, uint256 amount); + + /// @notice Constructor that sets token metadata and mints initial supply + /// @param initialOwner The address to receive the initial supply and ownership + /// @param tokenName The name of the token + /// @param tokenSymbol The symbol of the token + /// @param tokenDecimals The number of decimals for the token + constructor( + uint8 tokenDecimals, + address initialOwner, + address socket, + string memory tokenName, + string memory tokenSymbol + ) { + isSocketInitialized = 1; + _decimals = tokenDecimals; + _name = tokenName; + _symbol = tokenSymbol; + + _setSocket(socket); + _initializeOwner(initialOwner); + } + + /// @notice Returns the name of the token + /// @return The name of the token + function name() public view override returns (string memory) { + return _name; + } + + /// @notice Returns the symbol of the token + /// @return The symbol of the token + function symbol() public view override returns (string memory) { + return _symbol; + } + + /// @notice Returns the number of decimals used to get its user representation + /// @return The number of decimals + function decimals() public view override returns (uint8) { + return _decimals; + } + + /// @notice Mints new tokens (only owner) + /// @param to The address to mint tokens to + /// @param amount The amount of tokens to mint + function mint(address to, uint256 amount) external onlySocket { + require(to != address(0), "Cannot mint to zero address"); + require(amount > 0, "Amount must be greater than 0"); + + _mint(to, amount); + emit TokensMinted(to, amount); + } + + /// @notice Burns tokens from the caller's balance + /// @param amount The amount of tokens to burn + function burn(uint256 amount) external { + require(amount > 0, "Amount must be greater than 0"); + require(balanceOf(msg.sender) >= amount, "Insufficient balance"); + + _burn(msg.sender, amount); + + // todo: eoa to account mapping, read from msg.sender + ISUSDC(address(socket__)).mint(msg.sender, amount); + emit TokensBurned(msg.sender, amount); + } + + /// @notice Override transfer function to check for paused state + /// @param to The address to transfer tokens to + /// @param amount The amount of tokens to transfer + /// @return True if the transfer was successful + function transfer(address to, uint256 amount) public override returns (bool) { + return super.transfer(to, amount); + } + + /// @notice Override transferFrom function to check for paused state + /// @param from The address to transfer tokens from + /// @param to The address to transfer tokens to + /// @param amount The amount of tokens to transfer + /// @return True if the transfer was successful + function transferFrom(address from, address to, uint256 amount) public override returns (bool) { + return super.transferFrom(from, to, amount); + } + + function connectSocket( + bytes32 appGatewayId_, + address socket_, + uint64 switchboardId_ + ) external onlyOwner { + _connectSocket(appGatewayId_, socket_, switchboardId_); + } + + function disconnectSocket() external onlyOwner { + socket__.disconnect(); + } + + /** + * @notice Rescues funds from the contract if they are locked by mistake. This contract does not + * theoretically need this function but it is added for safety. + * @param token_ The address of the token contract. + * @param rescueTo_ The address where rescued tokens need to be sent. + * @param amount_ The amount of tokens to be rescued. + */ + function rescueFunds( + address token_, + address rescueTo_, + uint256 amount_ + ) external onlyRole(RESCUE_ROLE) { + RescueFundsLib._rescueFunds(token_, rescueTo_, amount_); + } +} From a88849767f0ec1489ff82e980f65c6eb93ab0358 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 15 Aug 2025 03:19:27 +0530 Subject: [PATCH 085/139] feat: data with deposits --- contracts/evmx/interfaces/IFeesPlug.sol | 9 ++++--- contracts/evmx/plugs/FeesPlug.sol | 28 +++++++++++++++------ script/helpers/DepositCredit.s.sol | 2 +- script/helpers/DepositCreditAndNative.s.sol | 2 +- script/helpers/DepositCreditMainnet.s.sol | 2 +- test/SetupTest.t.sol | 5 ++-- 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/contracts/evmx/interfaces/IFeesPlug.sol b/contracts/evmx/interfaces/IFeesPlug.sol index 24cc719a..ba9a7809 100644 --- a/contracts/evmx/interfaces/IFeesPlug.sol +++ b/contracts/evmx/interfaces/IFeesPlug.sol @@ -7,7 +7,8 @@ interface IFeesPlug { address token, address receiver, uint256 creditAmount, - uint256 nativeAmount + uint256 nativeAmount, + bytes data ); /// @notice Event emitted when fees are withdrawn event FeesWithdrawn(address token, address receiver, uint256 amount); @@ -16,11 +17,11 @@ interface IFeesPlug { /// @notice Event emitted when a token is removed from whitelist event TokenRemovedFromWhitelist(address token); - function depositCredit(address token_, address receiver_, uint256 amount_) external; + function depositCredit(address token_, address receiver_, uint256 amount_, bytes memory data_) external; - function depositCreditAndNative(address token_, address receiver_, uint256 amount_) external; + function depositCreditAndNative(address token_, address receiver_, uint256 amount_, bytes memory data_) external; - function depositToNative(address token_, address receiver_, uint256 amount_) external; + function depositToNative(address token_, address receiver_, uint256 amount_, bytes memory data_) external; function withdrawFees(address token_, address receiver_, uint256 amount_) external; } diff --git a/contracts/evmx/plugs/FeesPlug.sol b/contracts/evmx/plugs/FeesPlug.sol index b07942c8..2e4a5392 100644 --- a/contracts/evmx/plugs/FeesPlug.sol +++ b/contracts/evmx/plugs/FeesPlug.sol @@ -43,21 +43,32 @@ contract FeesPlug is IFeesPlug, PlugBase, AccessControl { } /////////////////////// DEPOSIT AND WITHDRAWAL /////////////////////// - function depositCredit(address token_, address receiver_, uint256 amount_) external override { - _deposit(token_, receiver_, amount_, 0); + function depositCredit( + address token_, + address receiver_, + uint256 amount_, + bytes memory data_ + ) external override { + _deposit(token_, receiver_, amount_, 0, data_); } function depositCreditAndNative( address token_, address receiver_, - uint256 amount_ + uint256 amount_, + bytes memory data_ ) external override { uint256 nativeAmount_ = amount_ / 10; - _deposit(token_, receiver_, amount_ - nativeAmount_, nativeAmount_); + _deposit(token_, receiver_, amount_ - nativeAmount_, nativeAmount_, data_); } - function depositToNative(address token_, address receiver_, uint256 amount_) external override { - _deposit(token_, receiver_, 0, amount_); + function depositToNative( + address token_, + address receiver_, + uint256 amount_, + bytes memory data_ + ) external override { + _deposit(token_, receiver_, 0, amount_, data_); } /// @notice Deposits funds @@ -69,11 +80,12 @@ contract FeesPlug is IFeesPlug, PlugBase, AccessControl { address token_, address receiver_, uint256 creditAmount_, - uint256 nativeAmount_ + uint256 nativeAmount_, + bytes memory data_ ) internal { if (!whitelistedTokens[token_]) revert TokenNotWhitelisted(token_); token_.safeTransferFrom(msg.sender, address(this), creditAmount_ + nativeAmount_); - emit FeesDeposited(token_, receiver_, creditAmount_, nativeAmount_); + emit FeesDeposited(token_, receiver_, creditAmount_, nativeAmount_, data_); } /// @notice Withdraws fees diff --git a/script/helpers/DepositCredit.s.sol b/script/helpers/DepositCredit.s.sol index b8d432f8..49e94fe0 100644 --- a/script/helpers/DepositCredit.s.sol +++ b/script/helpers/DepositCredit.s.sol @@ -30,6 +30,6 @@ contract DepositCredit is Script { console.log("App Gateway:", appGateway); console.log("Fees Plug:", address(feesPlug)); console.log("Fees Amount:", feesAmount); - feesPlug.depositCredit(address(testUSDCContract), appGateway, feesAmount); + feesPlug.depositCredit(address(testUSDCContract), appGateway, feesAmount, bytes("")); } } diff --git a/script/helpers/DepositCreditAndNative.s.sol b/script/helpers/DepositCreditAndNative.s.sol index 629a3998..3d1f4a17 100644 --- a/script/helpers/DepositCreditAndNative.s.sol +++ b/script/helpers/DepositCreditAndNative.s.sol @@ -30,6 +30,6 @@ contract DepositCreditAndNative is Script { console.log("App Gateway:", appGateway); console.log("Fees Plug:", address(feesPlug)); console.log("Fees Amount:", feesAmount); - feesPlug.depositCreditAndNative(address(testUSDCContract), appGateway, feesAmount); + feesPlug.depositCreditAndNative(address(testUSDCContract), appGateway, feesAmount, bytes("")); } } diff --git a/script/helpers/DepositCreditMainnet.s.sol b/script/helpers/DepositCreditMainnet.s.sol index 4e1a8e33..06b58eab 100644 --- a/script/helpers/DepositCreditMainnet.s.sol +++ b/script/helpers/DepositCreditMainnet.s.sol @@ -31,6 +31,6 @@ contract DepositCredit is Script { console.log("App Gateway:", appGateway); console.log("Fees Plug:", address(feesPlug)); console.log("Fees Amount:", feesAmount); - feesPlug.depositCredit(address(USDCContract), appGateway, feesAmount); + feesPlug.depositCredit(address(USDCContract), appGateway, feesAmount, bytes("")); } } diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 57e73017..df445fe5 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -195,7 +195,8 @@ contract DeploySetup is SetupStore { arbConfig.feesPlug.depositCreditAndNative( address(arbConfig.testUSDC), address(transmitterEOA), - 100 ether + 100 ether, + bytes("") ); feesManager.approveAppGateway(address(auctionManager), true); @@ -578,7 +579,7 @@ contract FeesSetup is DeploySetup { vm.startPrank(user_); token.approve(address(socketConfig.feesPlug), 100 ether); - socketConfig.feesPlug.depositCreditAndNative(address(token), address(user_), 100 ether); + socketConfig.feesPlug.depositCreditAndNative(address(token), address(user_), 100 ether, bytes("")); vm.stopPrank(); assertEq( From f2add44fdb65ed8c7ef28b7e068d27932de09d6d Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 15 Aug 2025 04:08:29 +0530 Subject: [PATCH 086/139] feat: erc20 credit system --- contracts/evmx/fees/Credit.sol | 157 ++++++++++++++------- contracts/evmx/fees/FeesManager.sol | 24 ++-- contracts/evmx/interfaces/IERC20.sol | 22 +++ contracts/evmx/interfaces/IFeesManager.sol | 14 +- contracts/evmx/plugs/FeesPlug.sol | 7 +- 5 files changed, 144 insertions(+), 80 deletions(-) create mode 100644 contracts/evmx/interfaces/IERC20.sol diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index cd4b9980..d44e842f 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -5,6 +5,7 @@ import "solady/utils/Initializable.sol"; import "solady/utils/ECDSA.sol"; import "solady/utils/SafeTransferLib.sol"; import "solady/auth/Ownable.sol"; +import "solady/tokens/ERC20.sol"; import "../interfaces/IFeesManager.sol"; import "../interfaces/IFeesPlug.sol"; @@ -33,8 +34,9 @@ abstract contract FeesManagerStorage is IFeesManager { bytes32 public deprecatedSbType; // slot 52 - /// @notice user credits => stores fees for user, app gateway, transmitters and watcher precompile - mapping(address => UserCredits) public userCredits; + /// @notice Mapping to track blocked credits for each user + /// @dev address => userBlockedCredits + mapping(address => uint256) public userBlockedCredits; // slot 53 /// @notice Mapping to track request credits details for each request count @@ -42,9 +44,7 @@ abstract contract FeesManagerStorage is IFeesManager { mapping(uint40 => uint256) public requestBlockedCredits; // slot 54 - // user approved app gateways - // userAddress => appGateway => isApproved - mapping(address => mapping(address => bool)) public isApproved; + mapping(address => mapping(address => bool)) public deprecated2; // slot 55 // token pool balances @@ -62,28 +62,16 @@ abstract contract FeesManagerStorage is IFeesManager { /// @dev chainSlug => fees plug address mapping(uint32 => bytes32) public feesPlugs; - // slot 58 - /// @notice The name of the token - string public name = "Socket USDC"; - - // slot 59 - /// @notice The symbol of the token - string public symbol = "sUSDC"; - - // slot 60 - /// @notice The number of decimals for the token - uint8 public decimals = 18; - - // slots [61-107] reserved for gap - uint256[47] _gap_after; + // slots [58-107] reserved for gap + uint256[50] _gap_after; // slots [108-157] 50 slots reserved for address resolver util // 9 slots for app gateway base } -/// @title UserUtils -/// @notice Contract for managing user utils -abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatewayBase { +/// @title SocketUSDC +/// @notice ERC20 token for managing credits with blocking/unblocking functionality +abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatewayBase, ERC20 { /// @notice Emitted when fees deposited are updated /// @param chainSlug The chain identifier /// @param token The token address @@ -104,9 +92,6 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew /// @notice Emitted when credits are unwrapped event CreditsUnwrapped(address indexed consumeFrom, uint256 amount); - /// @notice Emitted when credits are transferred - event CreditsTransferred(address indexed from, address indexed to, uint256 amount); - /// @notice Emitted when fees plug is set event FeesPlugSet(uint32 indexed chainSlug, bytes32 indexed feesPlug); @@ -116,6 +101,12 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew /// @notice Emitted when withdraw fails event WithdrawFailed(bytes32 indexed payloadId); + /// @notice Emitted when credits are blocked + event CreditsBlocked(address indexed user, uint256 amount); + + /// @notice Emitted when credits are unblocked + event CreditsUnblocked(address indexed user, uint256 amount); + function setFeesPlug(uint32 chainSlug_, bytes32 feesPlug_) external onlyOwner { feesPlugs[chainSlug_] = feesPlug_; emit FeesPlugSet(chainSlug_, feesPlug_); @@ -126,6 +117,10 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew emit FeesPoolSet(feesPool_); } + function isApproved(address user_, address appGateway_) public view returns (bool) { + return allowance(user_, appGateway_) > 0; + } + /// @notice Deposits credits and native tokens to a user /// @param depositTo_ The address to deposit the credits to /// @param chainSlug_ The chain slug @@ -142,15 +137,15 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew ) external override onlyWatcher { tokenOnChainBalances[chainSlug_][token_] += creditAmount_ + nativeAmount_; - UserCredits storage userCredit = userCredits[depositTo_]; - userCredit.totalCredits += creditAmount_; + // Mint tokens to the user + _mint(depositTo_, creditAmount_); if (nativeAmount_ > 0) { // if native transfer fails, add to credit bool success = feesPool.withdraw(depositTo_, nativeAmount_); if (!success) { - userCredit.totalCredits += nativeAmount_; + _mint(depositTo_, creditAmount_); nativeAmount_ = 0; creditAmount_ += nativeAmount_; } @@ -169,11 +164,11 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew } function wrap(address receiver_) external payable override { - UserCredits storage userCredit = userCredits[receiver_]; - uint256 amount = msg.value; if (amount == 0) revert InvalidAmount(); - userCredit.totalCredits += amount; + + // Mint tokens to receiver + _mint(receiver_, amount); // reverts if transfer fails SafeTransferLib.safeTransferETH(address(feesPool), amount); @@ -181,9 +176,10 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew } function unwrap(uint256 amount_, address receiver_) external { - UserCredits storage userCredit = userCredits[msg.sender]; - if (userCredit.totalCredits < amount_) revert InsufficientCreditsAvailable(); - userCredit.totalCredits -= amount_; + if (balanceOf(msg.sender) < amount_) revert InsufficientCreditsAvailable(); + + // Burn tokens from sender + _burn(msg.sender, amount_); bool success = feesPool.withdraw(receiver_, amount_); if (!success) revert InsufficientBalance(); @@ -191,12 +187,19 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew emit CreditsUnwrapped(receiver_, amount_); } - /// @notice Returns available (unblocked) credits for a gateway - /// @param consumeFrom_ The app gateway address - /// @return The available credit amount - function getAvailableCredits(address consumeFrom_) public view override returns (uint256) { - UserCredits memory userCredit = userCredits[consumeFrom_]; - return userCredit.totalCredits - userCredit.blockedCredits; + /// @notice Override balanceOf to return available (unblocked) credits + function balanceOf(address account) public view override returns (uint256) { + return super.balanceOf(account) - userBlockedCredits[account]; + } + + /// @notice Get total balance including blocked credits + function totalBalanceOf(address account) public view returns (uint256) { + return super.balanceOf(account); + } + + /// @notice Get blocked credits for an account + function getBlockedCredits(address account) public view returns (uint256) { + return userBlockedCredits[account]; } /// @notice Checks if the user has enough credits @@ -211,32 +214,52 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew ) public view override returns (bool) { // If consumeFrom_ is not same as spender_ or spender_ is not watcher, check if it is approved if (!_isWatcher(spender_) && consumeFrom_ != spender_) { - if (!isApproved[consumeFrom_][spender_]) return false; + if (allowance(consumeFrom_, spender_) == 0) return false; } - return getAvailableCredits(consumeFrom_) >= amount_; + return balanceOf(consumeFrom_) >= amount_; } - function transferCredits(address from_, address to_, uint256 amount_) external override { + // ERC20 Overrides to handle blocked credits + + /// @notice Override transfer to check for blocked credits + function transfer(address to, uint256 amount) public override returns (bool) { + if (balanceOf(msg.sender) < amount) revert InsufficientCreditsAvailable(); + return super.transfer(to, amount); + } + + /// @notice Override transferFrom to check for blocked credits + function transferFrom( + address from_, + address to_, + uint256 amount_ + ) public override returns (bool) { if (!isCreditSpendable(from_, msg.sender, amount_)) revert InsufficientCreditsAvailable(); - userCredits[from_].totalCredits -= amount_; - userCredits[to_].totalCredits += amount_; - emit CreditsTransferred(from_, to_, amount_); + if (_isWatcher(msg.sender)) _approve(from_, msg.sender, amount_); + return super.transferFrom(from_, to_, amount_); } /// @notice Approves app gateway for the caller /// @param appGateway_ app gateway address /// @param approval_ approval - function approveAppGateway(address appGateway_, bool approval_) external override { - isApproved[msg.sender][appGateway_] = approval_; + function approve(address appGateway_, bool approval_) external override { + _approve(msg.sender, appGateway_, approval_ ? type(uint256).max : 0); + } + + function approve(address spender, uint256 amount) public override returns (bool) { + return super.approve(spender, amount > 0 ? type(uint256).max : 0); } /// @notice Approves multiple app gateways for the caller /// @param params_ Array of app gateway addresses to approve - function approveAppGateways(AppGatewayApprovals[] calldata params_) external override { + function batchApprove(AppGatewayApprovals[] calldata params_) external override { for (uint256 i = 0; i < params_.length; i++) { - isApproved[msg.sender][params_[i].appGateway] = params_[i].approval; + _approve( + msg.sender, + params_[i].appGateway, + params_[i].approval ? type(uint256).max : 0 + ); } } @@ -246,7 +269,7 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew /// @return consumeFrom The consume from address /// @return spender The app gateway address /// @return approval The approval status - function approveAppGatewayWithSignature( + function approveWithSignature( bytes memory feeApprovalData_ ) external returns (address consumeFrom, address spender, bool approval) { uint256 nonce; @@ -260,7 +283,7 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew if (isNonceUsed[consumeFrom][nonce]) revert NonceUsed(); isNonceUsed[consumeFrom][nonce] = true; - isApproved[consumeFrom][spender] = approval; + _approve(consumeFrom, spender, approval ? type(uint256).max : 0); return (consumeFrom, spender, approval); } @@ -282,10 +305,11 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew address consumeFrom = msg.sender; // Check if amount is available in fees plug - uint256 availableCredits = getAvailableCredits(consumeFrom); + uint256 availableCredits = balanceOf(consumeFrom); if (availableCredits < credits_ + maxFees_) revert InsufficientCreditsAvailable(); - userCredits[consumeFrom].totalCredits -= credits_; + // Burn tokens from sender + _burn(consumeFrom, credits_); tokenOnChainBalances[chainSlug_][token_] -= credits_; // Add it to the queue and submit request @@ -341,4 +365,29 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew if (watcher__().getPayloadParams(payloadId_).asyncPromise != msg.sender) return; emit WithdrawFailed(payloadId_); } + + // ERC20 metadata + function name() public pure override returns (string memory) { + return "Socket USDC"; + } + + function symbol() public pure override returns (string memory) { + return "sUSDC"; + } + + function decimals() public pure override returns (uint8) { + return 18; + } + + function permit( + address owner, + address spender, + uint256 value, + uint256 deadline, + uint8 v, + bytes32 r, + bytes32 s + ) public override { + // todo: implement permit + } } diff --git a/contracts/evmx/fees/FeesManager.sol b/contracts/evmx/fees/FeesManager.sol index da3b29b9..5aa1b3a0 100644 --- a/contracts/evmx/fees/FeesManager.sol +++ b/contracts/evmx/fees/FeesManager.sol @@ -69,10 +69,9 @@ contract FeesManager is Credit { address consumeFrom_, uint256 credits_ ) external override onlyRequestHandler { - if (getAvailableCredits(consumeFrom_) < credits_) revert InsufficientCreditsAvailable(); + if (balanceOf(consumeFrom_) < credits_) revert InsufficientCreditsAvailable(); - UserCredits storage userCredit = userCredits[consumeFrom_]; - userCredit.blockedCredits += credits_; + userBlockedCredits[consumeFrom_] += credits_; requestBlockedCredits[requestCount_] = credits_; emit CreditsBlocked(requestCount_, consumeFrom_, credits_); } @@ -88,13 +87,15 @@ contract FeesManager is Credit { if (blockedCredits == 0) return; address consumeFrom = _getRequestParams(requestCount_).requestFeesDetails.consumeFrom; - // Unblock fees from deposit - UserCredits storage userCredit = userCredits[consumeFrom]; - userCredit.blockedCredits -= blockedCredits; - userCredit.totalCredits -= blockedCredits; - // Assign fees to transmitter - userCredits[assignTo_].totalCredits += blockedCredits; + // Unblock credits from the original user + userBlockedCredits[consumeFrom] -= blockedCredits; + + // Burn tokens from the original user + _burn(consumeFrom, blockedCredits); + + // Mint tokens to the transmitter + _mint(assignTo_, blockedCredits); // Clean up storage delete requestBlockedCredits[requestCount_]; @@ -105,10 +106,9 @@ contract FeesManager is Credit { uint256 blockedCredits = requestBlockedCredits[requestCount_]; if (blockedCredits == 0) return; - // Unblock fees from deposit + // Unblock credits from the original user address consumeFrom = _getRequestParams(requestCount_).requestFeesDetails.consumeFrom; - UserCredits storage userCredit = userCredits[consumeFrom]; - userCredit.blockedCredits -= blockedCredits; + userBlockedCredits[consumeFrom] -= blockedCredits; delete requestBlockedCredits[requestCount_]; emit CreditsUnblocked(requestCount_, consumeFrom); diff --git a/contracts/evmx/interfaces/IERC20.sol b/contracts/evmx/interfaces/IERC20.sol new file mode 100644 index 00000000..3efe10b2 --- /dev/null +++ b/contracts/evmx/interfaces/IERC20.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity ^0.8.21; + +interface IERC20 { + function totalSupply() external view returns (uint256); + + function balanceOf(address account) external view returns (uint256); + + function transfer(address to, uint256 amount) external returns (bool); + + function allowance(address owner, address spender) external view returns (uint256); + + function approve(address spender, uint256 amount) external returns (bool); + + function transferFrom(address from, address to, uint256 amount) external returns (bool); + + function decimals() external view returns (uint8); + + event Transfer(address indexed from, address indexed to, uint256 value); + + event Approval(address indexed owner, address indexed spender, uint256 value); +} diff --git a/contracts/evmx/interfaces/IFeesManager.sol b/contracts/evmx/interfaces/IFeesManager.sol index 38f8e412..305c15cc 100644 --- a/contracts/evmx/interfaces/IFeesManager.sol +++ b/contracts/evmx/interfaces/IFeesManager.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; -import {WriteFinality, UserCredits, AppGatewayApprovals, OverrideParams, Transaction, QueueParams, RequestParams} from "../../utils/common/Structs.sol"; +import {WriteFinality, AppGatewayApprovals, OverrideParams, Transaction, QueueParams, RequestParams} from "../../utils/common/Structs.sol"; interface IFeesManager { function deposit( @@ -16,21 +16,17 @@ interface IFeesManager { function unwrap(uint256 amount_, address receiver_) external; - function getAvailableCredits(address consumeFrom_) external view returns (uint256); - function isCreditSpendable( address consumeFrom_, address spender_, uint256 amount_ ) external view returns (bool); - function transferCredits(address from_, address to_, uint256 amount_) external; - - function approveAppGateway(address appGateway_, bool approval_) external; + function approve(address appGateway_, bool approval_) external; - function approveAppGateways(AppGatewayApprovals[] calldata params_) external; + function batchApprove(AppGatewayApprovals[] calldata params_) external; - function approveAppGatewayWithSignature( + function approveWithSignature( bytes memory feeApprovalData_ ) external returns (address consumeFrom, address spender, bool approval); @@ -47,4 +43,6 @@ interface IFeesManager { function unblockAndAssignCredits(uint40 requestCount_, address assignTo_) external; function unblockCredits(uint40 requestCount_) external; + + function isApproved(address appGateway_, address user_) external view returns (bool); } diff --git a/contracts/evmx/plugs/FeesPlug.sol b/contracts/evmx/plugs/FeesPlug.sol index 2e4a5392..b46baab1 100644 --- a/contracts/evmx/plugs/FeesPlug.sol +++ b/contracts/evmx/plugs/FeesPlug.sol @@ -8,12 +8,7 @@ import {RESCUE_ROLE} from "../../utils/common/AccessRoles.sol"; import {IFeesPlug} from "../interfaces/IFeesPlug.sol"; import "../../utils/RescueFundsLib.sol"; import {InvalidTokenAddress} from "../../utils/common/Errors.sol"; - -interface IERC20 { - function balanceOf(address account) external view returns (uint256); - - function decimals() external view returns (uint8); -} +import "../interfaces/IERC20.sol"; /// @title FeesPlug /// @notice Contract for managing fees on a network From 580fa0a2fc6b3336c5df5a0acd24d3d410bd8908 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 15 Aug 2025 04:08:39 +0530 Subject: [PATCH 087/139] fix: build and tests --- FunctionSignatures.md | 8 +++--- contracts/evmx/AuctionManager.sol | 4 +-- contracts/evmx/base/AppGatewayBase.sol | 7 +++-- contracts/evmx/watcher/RequestHandler.sol | 3 ++- contracts/evmx/watcher/Trigger.sol | 3 ++- hardhat-scripts/deploy/9.setupTransmitter.ts | 12 ++------- .../WithdrawFeesArbitrumFeesPlug.s.sol | 2 +- script/helpers/CheckDepositedCredits.s.sol | 5 ++-- script/helpers/TransferRemainingCredits.s.sol | 11 +++----- script/helpers/WithdrawRemainingCredits.s.sol | 7 ++--- test/SetupTest.t.sol | 26 ++++++++++--------- test/evmx/AuctionManager.t.sol | 2 +- test/evmx/FeesTest.t.sol | 8 +++--- 13 files changed, 46 insertions(+), 52 deletions(-) diff --git a/FunctionSignatures.md b/FunctionSignatures.md index e86293ef..84880d33 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -116,8 +116,8 @@ | Function | Signature | | -------------------------------- | ------------ | | `addressResolver__` | `0x6a750469` | -| `approveAppGateway` | `0xa3b53d8b` | -| `approveAppGatewayWithSignature` | `0x94b649ec` | +| `approve` | `0xa3b53d8b` | +| `approveWithSignature` | `0x94b649ec` | | `approveAppGateways` | `0x86d23ab2` | | `asyncDeployer__` | `0x2a39e801` | | `auctionManager` | `0xb0192f9a` | @@ -134,7 +134,7 @@ | `feesPlugs` | `0x23f5ee8a` | | `feesPool` | `0x6b259690` | | `forwarderAddresses` | `0x5390fdcb` | -| `getAvailableCredits` | `0xb065a8e5` | +| `balanceOf` | `0xb065a8e5` | | `getOnChainAddress` | `0xb6abffd7` | | `getOverrideParams` | `0x54f0a866` | | `handleRevert` | `0x44792f25` | @@ -160,7 +160,7 @@ | `setFeesPlug` | `0xd6a9a8b7` | | `setFeesPool` | `0xd6684588` | | `tokenOnChainBalances` | `0x3b27866d` | -| `transferCredits` | `0xf1686c89` | +| `transferFrom` | `0xf1686c89` | | `transferOwnership` | `0xf2fde38b` | | `unblockAndAssignCredits` | `0x01958181` | | `unblockCredits` | `0xa0b32314` | diff --git a/contracts/evmx/AuctionManager.sol b/contracts/evmx/AuctionManager.sol index ff593e94..2694b821 100644 --- a/contracts/evmx/AuctionManager.sol +++ b/contracts/evmx/AuctionManager.sol @@ -5,7 +5,6 @@ import {ECDSA} from "solady/utils/ECDSA.sol"; import "solady/utils/Initializable.sol"; import "./interfaces/IPromise.sol"; import "./interfaces/IAuctionManager.sol"; - import "../utils/AccessControl.sol"; import "../utils/RescueFundsLib.sol"; import {AuctionNotOpen, AuctionClosed, BidExceedsMaxFees, LowerBidAlreadyExists, InvalidTransmitter, MaxReAuctionCountReached, InvalidBid} from "../utils/common/Errors.sol"; @@ -13,6 +12,7 @@ import {SCHEDULE} from "../utils/common/Constants.sol"; import {TRANSMITTER_ROLE} from "../utils/common/AccessRoles.sol"; import {AppGatewayBase} from "./base/AppGatewayBase.sol"; +import "./interfaces/IERC20.sol"; /// @title AuctionManagerStorage /// @notice Storage for the AuctionManager contract @@ -263,7 +263,7 @@ contract AuctionManager is AuctionManagerStorage, Initializable, AppGatewayBase, uint256 delayInSeconds_ ) internal returns (uint256 watcherFees) { watcherFees = watcher__().getPrecompileFees(SCHEDULE, abi.encode(delayInSeconds_)); - feesManager__().transferCredits(from_, to_, watcherFees); + IERC20(address(feesManager__())).transferFrom(from_, to_, watcherFees); } /// @notice Recovers the signer of a message diff --git a/contracts/evmx/base/AppGatewayBase.sol b/contracts/evmx/base/AppGatewayBase.sol index 58c78652..b2cafeef 100644 --- a/contracts/evmx/base/AppGatewayBase.sol +++ b/contracts/evmx/base/AppGatewayBase.sol @@ -172,8 +172,7 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { return bytes32(0); } - onChainAddress = IForwarder(forwarderAddresses[contractId_][chainSlug_]) - .getOnChainAddress(); + onChainAddress = IForwarder(forwarderAddresses[contractId_][chainSlug_]).getOnChainAddress(); } //////////////////////////////////////////////////////////////////////////////////////////////// @@ -228,7 +227,7 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { function _approveFeesWithSignature(bytes memory feesApprovalData_) internal { if (feesApprovalData_.length == 0) return; - (consumeFrom, , ) = feesManager__().approveAppGatewayWithSignature(feesApprovalData_); + (consumeFrom, , ) = feesManager__().approveWithSignature(feesApprovalData_); } /// @notice Withdraws fee tokens @@ -242,7 +241,7 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { uint256 amount_, address receiver_ ) internal { - feesManager__().approveAppGateway(address(feesManager__()), true); + feesManager__().approve(address(feesManager__()), true); feesManager__().withdrawCredits(chainSlug_, token_, amount_, maxFees, receiver_); } diff --git a/contracts/evmx/watcher/RequestHandler.sol b/contracts/evmx/watcher/RequestHandler.sol index c3836d40..02aec79e 100644 --- a/contracts/evmx/watcher/RequestHandler.sol +++ b/contracts/evmx/watcher/RequestHandler.sol @@ -12,6 +12,7 @@ import "../interfaces/IPromise.sol"; import "../interfaces/IRequestHandler.sol"; import "../../utils/RescueFundsLib.sol"; import "solady/utils/LibCall.sol"; +import "../interfaces/IERC20.sol"; abstract contract RequestHandlerStorage is IRequestHandler { // slots [0-49] reserved for gap @@ -320,7 +321,7 @@ contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, Addres address watcherFeesPayer = r.requestFeesDetails.winningBid.transmitter == address(0) ? r.requestFeesDetails.consumeFrom : r.requestFeesDetails.winningBid.transmitter; - feesManager__().transferCredits(watcherFeesPayer, address(this), totalFees); + IERC20(address(feesManager__())).transferFrom(watcherFeesPayer, address(this), totalFees); } /// @notice Increases the fees for a request if no bid is placed diff --git a/contracts/evmx/watcher/Trigger.sol b/contracts/evmx/watcher/Trigger.sol index 72e7dfcd..dedfd51d 100644 --- a/contracts/evmx/watcher/Trigger.sol +++ b/contracts/evmx/watcher/Trigger.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.21; import {LibCall} from "solady/utils/LibCall.sol"; import "./WatcherStorage.sol"; import {fromBytes32Format} from "../../utils/common/Converters.sol"; +import "../interfaces/IERC20.sol"; /// @title Trigger /// @notice Contract that handles trigger validation and execution logic @@ -33,7 +34,7 @@ abstract contract Trigger is WatcherStorage, AddressResolverUtil { if (!configurations__.isValidPlug(appGateway, params_.chainSlug, params_.plug)) revert InvalidCallerTriggered(); - feesManager__().transferCredits(appGateway, address(this), triggerFees); + IERC20(address(feesManager__())).transferFrom(appGateway, address(this), triggerFees); triggerFromChainSlug = params_.chainSlug; triggerFromPlug = params_.plug; diff --git a/hardhat-scripts/deploy/9.setupTransmitter.ts b/hardhat-scripts/deploy/9.setupTransmitter.ts index a0d68336..7083221f 100644 --- a/hardhat-scripts/deploy/9.setupTransmitter.ts +++ b/hardhat-scripts/deploy/9.setupTransmitter.ts @@ -48,15 +48,7 @@ export const approveAuctionManager = async () => { console.log("Approving auction manager"); const tx = await feesManagerContract .connect(transmitterSigner) - .approveAppGateways( - [ - { - appGateway: auctionManagerAddress, - approval: true, - }, - ], - await overrides(EVMX_CHAIN_ID as ChainSlug) - ); + .approveAppGateway(auctionManagerAddress, true, await overrides(EVMX_CHAIN_ID as ChainSlug)); console.log("Auction manager approval tx hash:", tx.hash); await tx.wait(); console.log("Auction manager approved"); @@ -69,7 +61,7 @@ export const checkAndDepositCredits = async () => { console.log("Checking and depositing credits"); const credits = await feesManagerContract .connect(transmitterSigner) - .getAvailableCredits(transmitterAddress); + .balanceOf(transmitterAddress); if (credits.lt(TRANSMITTER_CREDIT_THRESHOLD)) { console.log("Depositing credits for transmitter..."); diff --git a/script/counter/WithdrawFeesArbitrumFeesPlug.s.sol b/script/counter/WithdrawFeesArbitrumFeesPlug.s.sol index 2d329a2f..3783000b 100644 --- a/script/counter/WithdrawFeesArbitrumFeesPlug.s.sol +++ b/script/counter/WithdrawFeesArbitrumFeesPlug.s.sol @@ -17,7 +17,7 @@ contract WithdrawFees is Script { address token = vm.envAddress("USDC"); CounterAppGateway appGateway = CounterAppGateway(appGatewayAddress); - uint256 availableFees = feesManager.getAvailableCredits(appGatewayAddress); + uint256 availableFees = feesManager.balanceOf(appGatewayAddress); console.log("Available fees:", availableFees); if (availableFees > 0) { diff --git a/script/helpers/CheckDepositedCredits.s.sol b/script/helpers/CheckDepositedCredits.s.sol index ad9bca71..80418fe7 100644 --- a/script/helpers/CheckDepositedCredits.s.sol +++ b/script/helpers/CheckDepositedCredits.s.sol @@ -11,13 +11,14 @@ contract CheckDepositedCredits is Script { FeesManager feesManager = FeesManager(payable(vm.envAddress("FEES_MANAGER"))); address appGateway = vm.envAddress("APP_GATEWAY"); - (uint256 totalCredits, uint256 blockedCredits) = feesManager.userCredits(appGateway); + uint256 totalCredits = feesManager.totalBalanceOf(appGateway); + uint256 blockedCredits = feesManager.getBlockedCredits(appGateway); console.log("App Gateway:", appGateway); console.log("Fees Manager:", address(feesManager)); console.log("totalCredits fees:", totalCredits); console.log("blockedCredits fees:", blockedCredits); - uint256 availableFees = feesManager.getAvailableCredits(appGateway); + uint256 availableFees = feesManager.balanceOf(appGateway); console.log("Available fees:", availableFees); } } diff --git a/script/helpers/TransferRemainingCredits.s.sol b/script/helpers/TransferRemainingCredits.s.sol index e0ae8cea..7691ae25 100644 --- a/script/helpers/TransferRemainingCredits.s.sol +++ b/script/helpers/TransferRemainingCredits.s.sol @@ -17,20 +17,17 @@ contract TransferRemainingCredits is Script { address appGateway = vm.envAddress("APP_GATEWAY"); address newAppGateway = vm.envAddress("NEW_APP_GATEWAY"); - (uint256 totalCredits, uint256 blockedCredits) = feesManager.userCredits(appGateway); + uint256 totalCredits = feesManager.totalBalanceOf(appGateway); + uint256 blockedCredits = feesManager.getBlockedCredits(appGateway); console.log("App Gateway:", appGateway); console.log("New App Gateway:", newAppGateway); console.log("Fees Manager:", address(feesManager)); console.log("totalCredits fees:", totalCredits); console.log("blockedCredits fees:", blockedCredits); - uint256 availableFees = feesManager.getAvailableCredits(appGateway); + uint256 availableFees = feesManager.balanceOf(appGateway); console.log("Available fees:", availableFees); - bytes memory data = abi.encodeWithSignature( - "transferCredits(address,uint256)", - newAppGateway, - availableFees - ); + bytes memory data = abi.encodeWithSignature("transferFrom(address,address,uint256)", appGateway, newAppGateway, availableFees); (bool success, ) = appGateway.call(data); require(success, "Transfer failed"); vm.stopBroadcast(); diff --git a/script/helpers/WithdrawRemainingCredits.s.sol b/script/helpers/WithdrawRemainingCredits.s.sol index c0b8bd31..c53cf1ee 100644 --- a/script/helpers/WithdrawRemainingCredits.s.sol +++ b/script/helpers/WithdrawRemainingCredits.s.sol @@ -15,15 +15,16 @@ contract WithdrawRemainingCredits is Script { FeesManager feesManager = FeesManager(payable(vm.envAddress("FEES_MANAGER"))); address appGateway = vm.envAddress("APP_GATEWAY"); - (uint256 totalCredits, uint256 blockedCredits) = feesManager.userCredits(appGateway); + uint256 totalCredits = feesManager.totalBalanceOf(appGateway); + uint256 blockedCredits = feesManager.getBlockedCredits(appGateway); console.log("App Gateway:", appGateway); console.log("Fees Manager:", address(feesManager)); console.log("totalCredits fees:", totalCredits); console.log("blockedCredits fees:", blockedCredits); - uint256 availableFees = feesManager.getAvailableCredits(appGateway); + uint256 availableFees = feesManager.balanceOf(appGateway); console.log("Available fees:", availableFees); - feesManager.transferCredits(appGateway, vm.addr(deployerPrivateKey), availableFees); + feesManager.transferFrom(appGateway, vm.addr(deployerPrivateKey), availableFees); vm.stopBroadcast(); } diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index df445fe5..5d04dedb 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -199,7 +199,7 @@ contract DeploySetup is SetupStore { bytes("") ); - feesManager.approveAppGateway(address(auctionManager), true); + feesManager.approve(address(auctionManager), true); vm.stopPrank(); } @@ -554,7 +554,7 @@ contract FeesSetup is DeploySetup { _deploy(); depositNativeAndCredits(arbChainSlug, 100 ether, 100 ether, address(transmitterEOA)); - approveAppGateway(address(auctionManager), address(transmitterEOA)); + approve(address(auctionManager), address(transmitterEOA)); } // mints test token and deposits the given native and credits to given `user_` @@ -579,7 +579,12 @@ contract FeesSetup is DeploySetup { vm.startPrank(user_); token.approve(address(socketConfig.feesPlug), 100 ether); - socketConfig.feesPlug.depositCreditAndNative(address(token), address(user_), 100 ether, bytes("")); + socketConfig.feesPlug.depositCreditAndNative( + address(token), + address(user_), + 100 ether, + bytes("") + ); vm.stopPrank(); assertEq( @@ -588,7 +593,7 @@ contract FeesSetup is DeploySetup { "Fees plug should have 100 more test tokens" ); - uint256 currentCredits = feesManager.getAvailableCredits(user_); + uint256 currentCredits = feesManager.balanceOf(user_); uint256 currentNative = address(user_).balance; vm.expectEmit(true, true, true, false); @@ -608,22 +613,19 @@ contract FeesSetup is DeploySetup { ); assertEq( - feesManager.getAvailableCredits(user_), + feesManager.balanceOf(user_), currentCredits + credits_, "User should have more credits" ); assertEq(address(user_).balance, currentNative + native_, "User should have more native"); } - function approveAppGateway(address appGateway_, address user_) internal { + function approve(address appGateway_, address user_) internal { bool approval = feesManager.isApproved(user_, appGateway_); if (approval) return; - AppGatewayApprovals[] memory approvals = new AppGatewayApprovals[](1); - approvals[0] = AppGatewayApprovals({appGateway: appGateway_, approval: true}); - hoax(user_); - feesManager.approveAppGateways(approvals); + feesManager.approve(appGateway_, true); assertEq( feesManager.isApproved(user_, appGateway_), @@ -632,7 +634,7 @@ contract FeesSetup is DeploySetup { ); } - function approveAppGatewayWithSignature( + function approveWithSignature( address appGateway_, address user_, uint256 userPrivateKey_ @@ -652,7 +654,7 @@ contract FeesSetup is DeploySetup { bytes memory feeApprovalData = abi.encode(appGateway_, true, block.timestamp, signature); // Call whitelistAppGatewayWithSignature with approval data - feesManager.approveAppGatewayWithSignature(feeApprovalData); + feesManager.approveWithSignature(feeApprovalData); assertEq( feesManager.isApproved(user_, appGateway_), true, diff --git a/test/evmx/AuctionManager.t.sol b/test/evmx/AuctionManager.t.sol index 665b6ba8..c508431c 100644 --- a/test/evmx/AuctionManager.t.sol +++ b/test/evmx/AuctionManager.t.sol @@ -32,7 +32,7 @@ contract AuctionManagerTest is AppGatewayBaseSetup { function testExpireBid() public { depositNativeAndCredits(feesChainSlug, 1 ether, 0, user); - approveAppGateway(address(feesManager), user); + approve(address(feesManager), user); uint256 withdrawAmount = 0.5 ether; uint40 requestCount = watcher.getCurrentRequestCount(); diff --git a/test/evmx/FeesTest.t.sol b/test/evmx/FeesTest.t.sol index 457d2ede..7b258711 100644 --- a/test/evmx/FeesTest.t.sol +++ b/test/evmx/FeesTest.t.sol @@ -33,7 +33,7 @@ contract FeesTest is AppGatewayBaseSetup { } function withdrawCredits(address from, uint256 withdrawAmount) public { - approveAppGateway(address(feesManager), from); + approve(address(feesManager), from); hoax(from); feesManager.withdrawCredits( @@ -48,7 +48,7 @@ contract FeesTest is AppGatewayBaseSetup { function testWithdrawTransmitterFees() public { uint256 transmitterReceiverBalanceBefore = feesConfig.testUSDC.balanceOf(receiver); - uint256 withdrawAmount = feesManager.getAvailableCredits(transmitterEOA); + uint256 withdrawAmount = feesManager.balanceOf(transmitterEOA); withdrawAmount = withdrawAmount - feesAmount; withdrawCredits(transmitterEOA, withdrawAmount); @@ -111,7 +111,7 @@ contract FeesTest is AppGatewayBaseSetup { abi.encodeWithSelector(Configurations.setAppGatewayConfigs.selector, configs) ); - approveAppGateway(address(feesManager), address(counterGateway)); + approve(address(feesManager), address(counterGateway)); uint256 withdrawAmount = 0.5 ether; vm.expectRevert(abi.encodeWithSelector(InvalidChainSlug.selector)); @@ -166,7 +166,7 @@ contract FeesTest is AppGatewayBaseSetup { uint256 withdrawAmount = 0.5 ether; uint256 withdrawAmountInTokens = withdrawAmount / 10 ** (18 - 6); - approveAppGateway(address(feesManager), address(counterGateway)); + approve(address(feesManager), address(counterGateway)); uint256 receiverBalanceBefore = arbConfig.testUSDC.balanceOf(receiver); From 71b796a6e49f263fd98dcbed41abed198d458b71 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 15 Aug 2025 04:35:03 +0530 Subject: [PATCH 088/139] feat: burn and mint susdc --- contracts/evmx/fees/Credit.sol | 35 +++++++++++++++++++++++++++-- contracts/evmx/fees/FeesManager.sol | 1 + 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index d44e842f..9e20fb10 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -62,8 +62,13 @@ abstract contract FeesManagerStorage is IFeesManager { /// @dev chainSlug => fees plug address mapping(uint32 => bytes32) public feesPlugs; - // slots [58-107] reserved for gap - uint256[50] _gap_after; + // slot 58 + /// @notice Mapping to track token for each chain slug + /// @dev chainSlug => token address + bytes32 public susdcToken; + + // slots [59-107] reserved for gap + uint256[49] _gap_after; // slots [108-157] 50 slots reserved for address resolver util // 9 slots for app gateway base @@ -107,6 +112,9 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew /// @notice Emitted when credits are unblocked event CreditsUnblocked(address indexed user, uint256 amount); + /// @notice Emitted when susdc token is set + event SusdcTokenSet(uint32 indexed chainSlug, bytes32 indexed susdcToken); + function setFeesPlug(uint32 chainSlug_, bytes32 feesPlug_) external onlyOwner { feesPlugs[chainSlug_] = feesPlug_; emit FeesPlugSet(chainSlug_, feesPlug_); @@ -117,6 +125,15 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew emit FeesPoolSet(feesPool_); } + function setSusdcToken(uint32 chainSlug_, bytes32 susdcToken_) external onlyOwner { + forwarderAddresses[susdcToken][chainSlug_] = asyncDeployer__().getOrDeployForwarderContract( + susdcToken_, + chainSlug_ + ); + _setValidPlug(true, chainSlug_, susdcToken); + emit SusdcTokenSet(chainSlug_, susdcToken_); + } + function isApproved(address user_, address appGateway_) public view returns (bool) { return allowance(user_, appGateway_) > 0; } @@ -187,6 +204,16 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew emit CreditsUnwrapped(receiver_, amount_); } + function mint(address to, uint256 amount, bytes memory data_) external onlyWatcher { + _mint(to, amount); + if (data_.length > 0) to.call(data_); + } + + function burn(address receiver_, uint256 amount_, bytes memory data_) external { + _burn(msg.sender, amount_); + if (data_.length > 0) receiver_.call(data_); + } + /// @notice Override balanceOf to return available (unblocked) credits function balanceOf(address account) public view override returns (uint256) { return super.balanceOf(account) - userBlockedCredits[account]; @@ -341,6 +368,10 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew watcher__().queue(queueParams, address(this)); } + function increaseFees(uint40 requestCount_, uint256 newMaxFees_) public { + _increaseFees(requestCount_, newMaxFees_); + } + function _getFeesPlugAddress(uint32 chainSlug_) internal view returns (bytes32) { if (feesPlugs[chainSlug_] == bytes32(0)) revert InvalidChainSlug(); return feesPlugs[chainSlug_]; diff --git a/contracts/evmx/fees/FeesManager.sol b/contracts/evmx/fees/FeesManager.sol index 5aa1b3a0..e8b46401 100644 --- a/contracts/evmx/fees/FeesManager.sol +++ b/contracts/evmx/fees/FeesManager.sol @@ -52,6 +52,7 @@ contract FeesManager is Credit { evmxSlug = evmxSlug_; sbType = sbType_; feesPool = IFeesPool(feesPool_); + susdcToken = _createContractId("susdc token"); _initializeOwner(owner_); _initializeAppGateway(addressResolver_); From c1cb25afd4f2b3d40ae150b6ef1074dc68c0fada Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 15 Aug 2025 11:23:52 +0530 Subject: [PATCH 089/139] fix: mint burn --- contracts/evmx/fees/Credit.sol | 22 +++++++++++++++++++--- contracts/evmx/interfaces/ISUSDC.sol | 6 +----- contracts/evmx/plugs/SUSDC.sol | 10 ++++------ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 9e20fb10..56659e59 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -19,6 +19,10 @@ import "../../utils/RescueFundsLib.sol"; import "../base/AppGatewayBase.sol"; import {toBytes32Format} from "../../utils/common/Converters.sol"; +interface ISUSDCPlug { + function mint(address receiver_, uint256 amount_) external; +} + abstract contract FeesManagerStorage is IFeesManager { // slots [0-49] reserved for gap uint256[50] _gap_before; @@ -206,12 +210,24 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew function mint(address to, uint256 amount, bytes memory data_) external onlyWatcher { _mint(to, amount); - if (data_.length > 0) to.call(data_); + if (data_.length > 0) { + (bool success, ) = to.call(data_); + if (!success) revert InvalidData(); + } } - function burn(address receiver_, uint256 amount_, bytes memory data_) external { + function burn( + uint32 chainSlug_, + address receiver_, + uint256 amount_, + bytes memory data_ + ) external { _burn(msg.sender, amount_); - if (data_.length > 0) receiver_.call(data_); + ISUSDCPlug(forwarderAddresses[susdcToken][chainSlug_]).mint(receiver_, amount_); + if (data_.length > 0) { + (bool success, ) = receiver_.call(data_); + if (!success) revert InvalidData(); + } } /// @notice Override balanceOf to return available (unblocked) credits diff --git a/contracts/evmx/interfaces/ISUSDC.sol b/contracts/evmx/interfaces/ISUSDC.sol index 37754c57..8acf621c 100644 --- a/contracts/evmx/interfaces/ISUSDC.sol +++ b/contracts/evmx/interfaces/ISUSDC.sol @@ -2,9 +2,5 @@ pragma solidity ^0.8.21; interface ISUSDC { - function burn(address user_, uint256 amount_) external; - - function mint(address receiver_, uint256 amount_) external; - - function balanceOf(address account_) external; + function mint(address receiver_, uint256 amount_, bytes memory data_) external; } diff --git a/contracts/evmx/plugs/SUSDC.sol b/contracts/evmx/plugs/SUSDC.sol index 5ef99cf1..d89e24b4 100644 --- a/contracts/evmx/plugs/SUSDC.sol +++ b/contracts/evmx/plugs/SUSDC.sol @@ -27,7 +27,7 @@ contract SUSDC is ERC20, AccessControl, PlugBase { event TokensMinted(address indexed to, uint256 amount); /// @notice Emitted when tokens are burned - event TokensBurned(address indexed from, uint256 amount); + event TokensBurned(address indexed from, address indexed to, uint256 amount, bytes data); /// @notice Constructor that sets token metadata and mints initial supply /// @param initialOwner The address to receive the initial supply and ownership @@ -81,15 +81,13 @@ contract SUSDC is ERC20, AccessControl, PlugBase { /// @notice Burns tokens from the caller's balance /// @param amount The amount of tokens to burn - function burn(uint256 amount) external { + function burn(address receiver_, uint256 amount, bytes memory data_) external { require(amount > 0, "Amount must be greater than 0"); require(balanceOf(msg.sender) >= amount, "Insufficient balance"); _burn(msg.sender, amount); - - // todo: eoa to account mapping, read from msg.sender - ISUSDC(address(socket__)).mint(msg.sender, amount); - emit TokensBurned(msg.sender, amount); + ISUSDC(address(socket__)).mint(receiver_, amount, data_); + emit TokensBurned(msg.sender, receiver_, amount, data_); } /// @notice Override transfer function to check for paused state From cb6eede0e2d21e68524ca309e353b2861a42ad2b Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 18 Aug 2025 18:01:02 +0800 Subject: [PATCH 090/139] test: susdc mint and burn --- contracts/evmx/fees/Credit.sol | 2 +- contracts/evmx/fees/FeesManager.sol | 2 + contracts/evmx/plugs/SUSDC.sol | 2 +- test/SetupTest.t.sol | 63 ++++++------ test/evmx/FeesTest.t.sol | 144 +++++++++++++++++++++++++++- 5 files changed, 178 insertions(+), 35 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 56659e59..df898151 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -221,7 +221,7 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew address receiver_, uint256 amount_, bytes memory data_ - ) external { + ) external async { _burn(msg.sender, amount_); ISUSDCPlug(forwarderAddresses[susdcToken][chainSlug_]).mint(receiver_, amount_); if (data_.length > 0) { diff --git a/contracts/evmx/fees/FeesManager.sol b/contracts/evmx/fees/FeesManager.sol index e8b46401..6e70a455 100644 --- a/contracts/evmx/fees/FeesManager.sol +++ b/contracts/evmx/fees/FeesManager.sol @@ -47,12 +47,14 @@ contract FeesManager is Credit { address addressResolver_, address feesPool_, address owner_, + uint256 fees_, bytes32 sbType_ ) public reinitializer(2) { evmxSlug = evmxSlug_; sbType = sbType_; feesPool = IFeesPool(feesPool_); susdcToken = _createContractId("susdc token"); + _setMaxFees(fees_); _initializeOwner(owner_); _initializeAppGateway(addressResolver_); diff --git a/contracts/evmx/plugs/SUSDC.sol b/contracts/evmx/plugs/SUSDC.sol index d89e24b4..a8bef7eb 100644 --- a/contracts/evmx/plugs/SUSDC.sol +++ b/contracts/evmx/plugs/SUSDC.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.19; import "solady/tokens/ERC20.sol"; import "../../utils/AccessControl.sol"; +import "../../utils/RescueFundsLib.sol"; import "../../protocol/base/PlugBase.sol"; -import "../../utils/RescueFundsLib.sol"; import {RESCUE_ROLE} from "../../utils/common/AccessRoles.sol"; import "../interfaces/ISUSDC.sol"; diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 5d04dedb..025a4eef 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -365,6 +365,7 @@ contract DeploySetup is SetupStore { address(addressResolver), address(feesPool), watcherEOA, + writeFees, FAST ) ); @@ -557,44 +558,50 @@ contract FeesSetup is DeploySetup { approve(address(auctionManager), address(transmitterEOA)); } - // mints test token and deposits the given native and credits to given `user_` function depositNativeAndCredits( uint32 chainSlug_, uint256 credits_, uint256 native_, address user_ + ) internal { + depositNativeAndCreditsWithData(chainSlug_, credits_, native_, user_, user_, bytes("")); + } + + // mints test token and deposits the given native and credits to given `user_` + function depositNativeAndCreditsWithData( + uint32 chainSlug_, + uint256 credits_, + uint256 native_, + address user_, + address receiver_, + bytes memory data_ ) internal { SocketContracts memory socketConfig = getSocketConfig(chainSlug_); TestUSDC token = socketConfig.testUSDC; - uint256 userBalance = token.balanceOf(user_); - uint256 feesPlugBalance = token.balanceOf(address(socketConfig.feesPlug)); + // uint256 userBalance = token.balanceOf(user_); + // uint256 feesPlugBalance = token.balanceOf(address(socketConfig.feesPlug)); token.mint(address(user_), 100 ether); - assertEq( - token.balanceOf(user_), - userBalance + 100 ether, - "User should have 100 more test tokens" - ); + // assertEq( + // token.balanceOf(user_), + // userBalance + 100 ether, + // "User should have 100 more test tokens" + // ); vm.startPrank(user_); token.approve(address(socketConfig.feesPlug), 100 ether); - socketConfig.feesPlug.depositCreditAndNative( - address(token), - address(user_), - 100 ether, - bytes("") - ); + socketConfig.feesPlug.depositCreditAndNative(address(token), user_, 100 ether, data_); vm.stopPrank(); - assertEq( - token.balanceOf(address(socketConfig.feesPlug)), - feesPlugBalance + 100 ether, - "Fees plug should have 100 more test tokens" - ); + // assertEq( + // token.balanceOf(address(socketConfig.feesPlug)), + // feesPlugBalance + 100 ether, + // "Fees plug should have 100 more test tokens" + // ); - uint256 currentCredits = feesManager.balanceOf(user_); - uint256 currentNative = address(user_).balance; + // uint256 currentCredits = feesManager.balanceOf(user_); + // uint256 currentNative = address(user_).balance; vm.expectEmit(true, true, true, false); emit Deposited(chainSlug_, address(token), user_, credits_, native_); @@ -608,16 +615,16 @@ contract FeesSetup is DeploySetup { user_, native_, credits_, - bytes("") + data_ ) ); - assertEq( - feesManager.balanceOf(user_), - currentCredits + credits_, - "User should have more credits" - ); - assertEq(address(user_).balance, currentNative + native_, "User should have more native"); + // assertEq( + // feesManager.balanceOf(user_), + // currentCredits + credits_, + // "User should have more credits" + // ); + // assertEq(address(user_).balance, currentNative + native_, "User should have more native"); } function approve(address appGateway_, address user_) internal { diff --git a/test/evmx/FeesTest.t.sol b/test/evmx/FeesTest.t.sol index 7b258711..4604b80e 100644 --- a/test/evmx/FeesTest.t.sol +++ b/test/evmx/FeesTest.t.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; +import "../../contracts/evmx/plugs/SUSDC.sol"; import "../apps/Counter.t.sol"; import "../SetupTest.t.sol"; @@ -14,13 +15,49 @@ contract FeesTest is AppGatewayBaseSetup { SocketContracts feesConfig; CounterAppGateway counterGateway; + SUSDC susdcPlug; event WithdrawFailed(bytes32 indexed payloadId); function setUp() public { deploy(); - feesConfig = getSocketConfig(feesChainSlug); + + // deploy susdc and connect to fees manager + susdcPlug = new SUSDC( + 18, + address(socketOwner), + address(feesConfig.socket), + "susdc", + "SUSDC" + ); + + uint64 sbId = arbConfig.switchboard.switchboardId(); + hoax(socketOwner); + susdcPlug.connectSocket( + toBytes32Format(address(feesManager)), + address(feesConfig.socket), + sbId + ); + + hoax(watcherEOA); + feesManager.setSusdcToken(feesChainSlug, toBytes32Format(address(susdcPlug))); + + AppGatewayConfig[] memory configs = new AppGatewayConfig[](1); + configs[0] = AppGatewayConfig({ + chainSlug: feesChainSlug, + plug: toBytes32Format(address(susdcPlug)), + plugConfig: PlugConfigGeneric({ + appGatewayId: toBytes32Format(address(feesManager)), + switchboardId: sbId + }) + }); + watcherMultiCall( + address(configurations), + abi.encodeWithSelector(Configurations.setAppGatewayConfigs.selector, configs) + ); + depositNativeAndCredits(feesChainSlug, 100 ether, 0, address(feesManager)); + counterGateway = new CounterAppGateway(address(addressResolver), feesAmount); depositNativeAndCredits(feesChainSlug, 100 ether, 0, address(counterGateway)); @@ -32,6 +69,105 @@ contract FeesTest is AppGatewayBaseSetup { executeDeploy(IAppGateway(counterGateway), feesChainSlug, contractIds); } + function testDepositAndMintSusdc() public { + // deposit usdc on fees plug and mint susdc on evmx with data execution + uint256 susdcBalanceBefore = feesManager.balanceOf(user); + depositNativeAndCreditsWithData( + feesChainSlug, + 100 ether, + 0, + user, + user, + bytes("") + // abi.encodeWithSelector(CounterAppGateway.increment.selector) + ); + + assertEq( + feesManager.balanceOf(user), + susdcBalanceBefore + 100 ether, + "Susdc balance should be correct" + ); + + // burn susdc on evmx and mint susdc on chain + uint256 susdcChainBalanceBefore = susdcPlug.balanceOf(user); + + hoax(user); + feesManager.burn(feesChainSlug, user, 5 ether, bytes("")); + executeRequest(); + + assertEq( + feesManager.balanceOf(user), + susdcBalanceBefore + 95 ether, + "Susdc balance should be correct" + ); + assertEq( + susdcPlug.balanceOf(user), + susdcChainBalanceBefore + 5 ether, + "Susdc balance should be correct" + ); + + // burn susdc from chain and mint on evmx + uint256 burnAmount = 2 ether; + bytes32 triggerId = _encodeTriggerId(address(feesConfig.socket), feesChainSlug); + bytes memory payload = abi.encodeWithSelector( + Credit.mint.selector, + user, + burnAmount, + bytes("") + ); + + hoax(user); + susdcPlug.burn(user, burnAmount, bytes("")); + + TriggerParams[] memory params = new TriggerParams[](1); + params[0] = TriggerParams({ + triggerId: triggerId, + chainSlug: feesChainSlug, + appGatewayId: toBytes32Format(address(feesManager)), + plug: toBytes32Format(address(susdcPlug)), + payload: payload, + overrides: bytes("") + }); + bytes memory data = abi.encode(params); + + WatcherMultiCallParams memory watcherParams = WatcherMultiCallParams({ + contractAddress: address(watcher), + data: data, + nonce: watcherNonce, + signature: _createWatcherSignature(address(watcher), data) + }); + watcherNonce++; + watcher.callAppGateways(watcherParams); + + assertEq( + feesManager.balanceOf(user), + susdcBalanceBefore + 95 ether + burnAmount, + "Susdc balance should be correct" + ); + assertEq( + susdcPlug.balanceOf(user), + susdcChainBalanceBefore + 5 ether - burnAmount, + "Susdc balance should be correct" + ); + + // burn susdc on evmx and withdraw usdc + uint256 withdrawAmount = 1 ether; + uint256 receiverBalanceBefore = feesConfig.testUSDC.balanceOf(receiver); + withdrawCredits(user, withdrawAmount); + + uint256 withdrawAmountInTokens = withdrawAmount / 10 ** (18 - 6); + assertEq( + receiverBalanceBefore + withdrawAmountInTokens, + feesConfig.testUSDC.balanceOf(receiver), + "Receiver Balance should be correct after burn" + ); + assertEq( + susdcPlug.balanceOf(user), + susdcChainBalanceBefore + 5 ether - burnAmount, + "Susdc balance should be correct after burn" + ); + } + function withdrawCredits(address from, uint256 withdrawAmount) public { approve(address(feesManager), from); @@ -117,8 +253,8 @@ contract FeesTest is AppGatewayBaseSetup { vm.expectRevert(abi.encodeWithSelector(InvalidChainSlug.selector)); hoax(address(counterGateway)); feesManager.withdrawCredits( - arbChainSlug, - address(arbConfig.testUSDC), + feesChainSlug, + address(feesConfig.testUSDC), withdrawAmount, feesAmount, address(receiver) @@ -127,8 +263,6 @@ contract FeesTest is AppGatewayBaseSetup { function testMigrateFeesPlug() public { FeesPlug oldFeesPlug = arbConfig.feesPlug; - uint64 sbId = arbConfig.switchboard.switchboardId(); - // disconnect old fees plug hoax(socketOwner); oldFeesPlug.disconnectSocket(); From 18f2f293d98530175c5488ab20a3dd674bdd6940 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 18 Aug 2025 16:45:26 +0530 Subject: [PATCH 091/139] fix: interfaces --- contracts/evmx/interfaces/IFeesManager.sol | 9 +++++++++ contracts/evmx/interfaces/ISUSDC.sol | 4 +++- contracts/evmx/plugs/SUSDC.sol | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/contracts/evmx/interfaces/IFeesManager.sol b/contracts/evmx/interfaces/IFeesManager.sol index 305c15cc..12fe55fa 100644 --- a/contracts/evmx/interfaces/IFeesManager.sol +++ b/contracts/evmx/interfaces/IFeesManager.sol @@ -45,4 +45,13 @@ interface IFeesManager { function unblockCredits(uint40 requestCount_) external; function isApproved(address appGateway_, address user_) external view returns (bool); + + function burn( + uint32 chainSlug_, + address receiver_, + uint256 amount_, + bytes memory data_ + ) external; + + function mint(address to, uint256 amount, bytes memory data_) external; } diff --git a/contracts/evmx/interfaces/ISUSDC.sol b/contracts/evmx/interfaces/ISUSDC.sol index 8acf621c..985dedbc 100644 --- a/contracts/evmx/interfaces/ISUSDC.sol +++ b/contracts/evmx/interfaces/ISUSDC.sol @@ -2,5 +2,7 @@ pragma solidity ^0.8.21; interface ISUSDC { - function mint(address receiver_, uint256 amount_, bytes memory data_) external; + function mint(address to, uint256 amount) external; + + function burn(address receiver_, uint256 amount, bytes memory data_) external; } diff --git a/contracts/evmx/plugs/SUSDC.sol b/contracts/evmx/plugs/SUSDC.sol index a8bef7eb..7272d775 100644 --- a/contracts/evmx/plugs/SUSDC.sol +++ b/contracts/evmx/plugs/SUSDC.sol @@ -8,7 +8,7 @@ import "../../utils/RescueFundsLib.sol"; import "../../protocol/base/PlugBase.sol"; import {RESCUE_ROLE} from "../../utils/common/AccessRoles.sol"; -import "../interfaces/ISUSDC.sol"; +import "../interfaces/IFeesManager.sol"; /// @title AdvancedToken /// @notice An advanced ERC20 token with minting, burning, and pausing capabilities @@ -86,7 +86,7 @@ contract SUSDC is ERC20, AccessControl, PlugBase { require(balanceOf(msg.sender) >= amount, "Insufficient balance"); _burn(msg.sender, amount); - ISUSDC(address(socket__)).mint(receiver_, amount, data_); + IFeesManager(address(socket__)).mint(receiver_, amount, data_); emit TokensBurned(msg.sender, receiver_, amount, data_); } From 8405080136977c851bc172bddee992a6d856a65a Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 18 Aug 2025 22:35:59 +0530 Subject: [PATCH 092/139] fix: rearrange test --- test/SetupTest.t.sol | 77 ++++++++++++++++++++++++++++------------ test/evmx/FeesTest.t.sol | 48 ++++--------------------- 2 files changed, 60 insertions(+), 65 deletions(-) diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 025a4eef..e6a6467f 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -35,6 +35,8 @@ import "../contracts/evmx/fees/FeesPool.sol"; import "../contracts/evmx/plugs/FeesPlug.sol"; import "../contracts/evmx/AuctionManager.sol"; import "../contracts/evmx/mocks/TestUSDC.sol"; +import "../contracts/evmx/plugs/SUSDC.sol"; + import "./mock/CCTPMessageTransmitter.sol"; import "solady/utils/ERC1967Factory.sol"; @@ -87,6 +89,7 @@ contract SetupStore is Test { SocketBatcher socketBatcher; ContractFactoryPlug contractFactoryPlug; FeesPlug feesPlug; + SUSDC susdcPlug; TestUSDC testUSDC; } SocketContracts public arbConfig; @@ -132,6 +135,31 @@ contract DeploySetup is SetupStore { optConfig = _deploySocket(optChainSlug); _configureChain(optChainSlug); + vm.startPrank(watcherEOA); + auctionManager.grantRole(TRANSMITTER_ROLE, transmitterEOA); + feesPool.grantRole(FEE_MANAGER_ROLE, address(feesManager)); + + // setup address resolver + addressResolver.setWatcher(address(watcher)); + addressResolver.setAsyncDeployer(address(asyncDeployer)); + addressResolver.setDefaultAuctionManager(address(auctionManager)); + addressResolver.setFeesManager(address(feesManager)); + addressResolver.setDeployForwarder(address(deployForwarder)); + + requestHandler.setPrecompile(WRITE, writePrecompile); + requestHandler.setPrecompile(READ, readPrecompile); + requestHandler.setPrecompile(SCHEDULE, schedulePrecompile); + + watcher.setCoreContracts( + address(requestHandler), + address(configurations), + address(promiseResolver) + ); + feesManager.setSusdcToken(arbChainSlug, toBytes32Format(address(arbConfig.susdcPlug))); + feesManager.setSusdcToken(optChainSlug, toBytes32Format(address(optConfig.susdcPlug))); + + vm.stopPrank(); + vm.startPrank(socketOwner); arbConfig.cctpSwitchboard.addRemoteEndpoint( optChainSlug, @@ -161,28 +189,6 @@ contract DeploySetup is SetupStore { // transfer eth to fees pool for native fee payouts vm.deal(address(feesPool), 100000 ether); - vm.startPrank(watcherEOA); - auctionManager.grantRole(TRANSMITTER_ROLE, transmitterEOA); - feesPool.grantRole(FEE_MANAGER_ROLE, address(feesManager)); - - // setup address resolver - addressResolver.setWatcher(address(watcher)); - addressResolver.setAsyncDeployer(address(asyncDeployer)); - addressResolver.setDefaultAuctionManager(address(auctionManager)); - addressResolver.setFeesManager(address(feesManager)); - addressResolver.setDeployForwarder(address(deployForwarder)); - - requestHandler.setPrecompile(WRITE, writePrecompile); - requestHandler.setPrecompile(READ, readPrecompile); - requestHandler.setPrecompile(SCHEDULE, schedulePrecompile); - - watcher.setCoreContracts( - address(requestHandler), - address(configurations), - address(promiseResolver) - ); - vm.stopPrank(); - _connectCorePlugs(); _setupTransmitter(); } @@ -204,7 +210,7 @@ contract DeploySetup is SetupStore { } function _connectCorePlugs() internal { - AppGatewayConfig[] memory configs = new AppGatewayConfig[](4); + AppGatewayConfig[] memory configs = new AppGatewayConfig[](6); configs[0] = AppGatewayConfig({ chainSlug: arbChainSlug, plug: toBytes32Format(address(arbConfig.feesPlug)), @@ -237,6 +243,22 @@ contract DeploySetup is SetupStore { switchboardId: optConfig.switchboard.switchboardId() }) }); + configs[4] = AppGatewayConfig({ + chainSlug: optChainSlug, + plug: toBytes32Format(address(optConfig.susdcPlug)), + plugConfig: PlugConfigGeneric({ + appGatewayId: toBytes32Format(address(feesManager)), + switchboardId: optConfig.switchboard.switchboardId() + }) + }); + configs[5] = AppGatewayConfig({ + chainSlug: arbChainSlug, + plug: toBytes32Format(address(arbConfig.susdcPlug)), + plugConfig: PlugConfigGeneric({ + appGatewayId: toBytes32Format(address(feesManager)), + switchboardId: arbConfig.switchboard.switchboardId() + }) + }); watcherMultiCall( address(configurations), @@ -270,6 +292,7 @@ contract DeploySetup is SetupStore { socketBatcher: new SocketBatcher(socketOwner, socket), contractFactoryPlug: new ContractFactoryPlug(address(socket), socketOwner), feesPlug: new FeesPlug(address(socket), socketOwner), + susdcPlug: new SUSDC(18, address(socketOwner), address(socket), "susdc", "SUSDC"), testUSDC: new TestUSDC("USDC", "USDC", 6, socketOwner, 1000000000000000000000000) }); } @@ -331,6 +354,14 @@ contract DeploySetup is SetupStore { toBytes32Format(address(contractFactoryPlug)) ); vm.stopPrank(); + + uint64 sbId = socketConfig.switchboard.switchboardId(); + hoax(socketOwner); + socketConfig.susdcPlug.connectSocket( + toBytes32Format(address(feesManager)), + address(socketConfig.socket), + sbId + ); } function _deployEVMxCore() internal { diff --git a/test/evmx/FeesTest.t.sol b/test/evmx/FeesTest.t.sol index 4604b80e..1e472526 100644 --- a/test/evmx/FeesTest.t.sol +++ b/test/evmx/FeesTest.t.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.8.21; -import "../../contracts/evmx/plugs/SUSDC.sol"; import "../apps/Counter.t.sol"; import "../SetupTest.t.sol"; @@ -15,47 +14,12 @@ contract FeesTest is AppGatewayBaseSetup { SocketContracts feesConfig; CounterAppGateway counterGateway; - SUSDC susdcPlug; event WithdrawFailed(bytes32 indexed payloadId); function setUp() public { deploy(); feesConfig = getSocketConfig(feesChainSlug); - - // deploy susdc and connect to fees manager - susdcPlug = new SUSDC( - 18, - address(socketOwner), - address(feesConfig.socket), - "susdc", - "SUSDC" - ); - - uint64 sbId = arbConfig.switchboard.switchboardId(); - hoax(socketOwner); - susdcPlug.connectSocket( - toBytes32Format(address(feesManager)), - address(feesConfig.socket), - sbId - ); - - hoax(watcherEOA); - feesManager.setSusdcToken(feesChainSlug, toBytes32Format(address(susdcPlug))); - - AppGatewayConfig[] memory configs = new AppGatewayConfig[](1); - configs[0] = AppGatewayConfig({ - chainSlug: feesChainSlug, - plug: toBytes32Format(address(susdcPlug)), - plugConfig: PlugConfigGeneric({ - appGatewayId: toBytes32Format(address(feesManager)), - switchboardId: sbId - }) - }); - watcherMultiCall( - address(configurations), - abi.encodeWithSelector(Configurations.setAppGatewayConfigs.selector, configs) - ); depositNativeAndCredits(feesChainSlug, 100 ether, 0, address(feesManager)); counterGateway = new CounterAppGateway(address(addressResolver), feesAmount); @@ -89,7 +53,7 @@ contract FeesTest is AppGatewayBaseSetup { ); // burn susdc on evmx and mint susdc on chain - uint256 susdcChainBalanceBefore = susdcPlug.balanceOf(user); + uint256 susdcChainBalanceBefore = feesConfig.susdcPlug.balanceOf(user); hoax(user); feesManager.burn(feesChainSlug, user, 5 ether, bytes("")); @@ -101,7 +65,7 @@ contract FeesTest is AppGatewayBaseSetup { "Susdc balance should be correct" ); assertEq( - susdcPlug.balanceOf(user), + feesConfig.susdcPlug.balanceOf(user), susdcChainBalanceBefore + 5 ether, "Susdc balance should be correct" ); @@ -117,14 +81,14 @@ contract FeesTest is AppGatewayBaseSetup { ); hoax(user); - susdcPlug.burn(user, burnAmount, bytes("")); + feesConfig.susdcPlug.burn(user, burnAmount, bytes("")); TriggerParams[] memory params = new TriggerParams[](1); params[0] = TriggerParams({ triggerId: triggerId, chainSlug: feesChainSlug, appGatewayId: toBytes32Format(address(feesManager)), - plug: toBytes32Format(address(susdcPlug)), + plug: toBytes32Format(address(feesConfig.susdcPlug)), payload: payload, overrides: bytes("") }); @@ -145,7 +109,7 @@ contract FeesTest is AppGatewayBaseSetup { "Susdc balance should be correct" ); assertEq( - susdcPlug.balanceOf(user), + feesConfig.susdcPlug.balanceOf(user), susdcChainBalanceBefore + 5 ether - burnAmount, "Susdc balance should be correct" ); @@ -162,7 +126,7 @@ contract FeesTest is AppGatewayBaseSetup { "Receiver Balance should be correct after burn" ); assertEq( - susdcPlug.balanceOf(user), + feesConfig.susdcPlug.balanceOf(user), susdcChainBalanceBefore + 5 ether - burnAmount, "Susdc balance should be correct after burn" ); From e62260086fd8cfbc664e789a77ff5c4b37e46ac7 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 19 Aug 2025 21:49:45 +0530 Subject: [PATCH 093/139] fix: data tests --- contracts/evmx/fees/Credit.sol | 14 +----- contracts/evmx/interfaces/IFeesManager.sol | 7 +-- test/SetupTest.t.sol | 4 +- .../counter/CounterAppGateway.sol | 9 +++- test/evmx/FeesTest.t.sol | 44 +++++++++++-------- 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index df898151..2fe19db0 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -211,23 +211,13 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew function mint(address to, uint256 amount, bytes memory data_) external onlyWatcher { _mint(to, amount); if (data_.length > 0) { - (bool success, ) = to.call(data_); - if (!success) revert InvalidData(); + IReceiver(to).onTransfer(evmxSlug, address(this), amount, 0, data_); } } - function burn( - uint32 chainSlug_, - address receiver_, - uint256 amount_, - bytes memory data_ - ) external async { + function burn(uint32 chainSlug_, address receiver_, uint256 amount_) external async { _burn(msg.sender, amount_); ISUSDCPlug(forwarderAddresses[susdcToken][chainSlug_]).mint(receiver_, amount_); - if (data_.length > 0) { - (bool success, ) = receiver_.call(data_); - if (!success) revert InvalidData(); - } } /// @notice Override balanceOf to return available (unblocked) credits diff --git a/contracts/evmx/interfaces/IFeesManager.sol b/contracts/evmx/interfaces/IFeesManager.sol index 12fe55fa..0bd3a561 100644 --- a/contracts/evmx/interfaces/IFeesManager.sol +++ b/contracts/evmx/interfaces/IFeesManager.sol @@ -46,12 +46,7 @@ interface IFeesManager { function isApproved(address appGateway_, address user_) external view returns (bool); - function burn( - uint32 chainSlug_, - address receiver_, - uint256 amount_, - bytes memory data_ - ) external; + function burn(uint32 chainSlug_, address receiver_, uint256 amount_) external; function mint(address to, uint256 amount, bytes memory data_) external; } diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index e6a6467f..5bf2d423 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -635,7 +635,7 @@ contract FeesSetup is DeploySetup { // uint256 currentNative = address(user_).balance; vm.expectEmit(true, true, true, false); - emit Deposited(chainSlug_, address(token), user_, credits_, native_); + emit Deposited(chainSlug_, address(token), receiver_, credits_, native_); watcherMultiCall( address(feesManager), @@ -643,7 +643,7 @@ contract FeesSetup is DeploySetup { Credit.deposit.selector, chainSlug_, address(token), - user_, + receiver_, native_, credits_, data_ diff --git a/test/apps/app-gateways/counter/CounterAppGateway.sol b/test/apps/app-gateways/counter/CounterAppGateway.sol index ac887076..68ff3024 100644 --- a/test/apps/app-gateways/counter/CounterAppGateway.sol +++ b/test/apps/app-gateways/counter/CounterAppGateway.sol @@ -4,8 +4,9 @@ pragma solidity ^0.8.21; import "../../../../contracts/evmx/base/AppGatewayBase.sol"; import "./Counter.sol"; import "./ICounter.sol"; +import "../../../../contracts/evmx/interfaces/IReceiver.sol"; -contract CounterAppGateway is AppGatewayBase, Ownable { +contract CounterAppGateway is AppGatewayBase, Ownable, IReceiver { bytes32 public counter = _createContractId("counter"); bytes32 public counter1 = _createContractId("counter1"); @@ -14,6 +15,7 @@ contract CounterAppGateway is AppGatewayBase, Ownable { uint256 public optCounter; bool public incremented; + bool public feesManagerSwitch; event CounterScheduleResolved(uint256 creationTimestamp, uint256 executionTimestamp); @@ -156,4 +158,9 @@ contract CounterAppGateway is AppGatewayBase, Ownable { function increaseFees(uint40 requestCount_, uint256 newMaxFees_) public { _increaseFees(requestCount_, newMaxFees_); } + + function onTransfer(uint32, address, uint256, uint256, bytes memory data_) public { + if (msg.sender != address(feesManager__())) revert("Only fees manager"); + feesManagerSwitch = abi.decode(data_, (bool)); + } } diff --git a/test/evmx/FeesTest.t.sol b/test/evmx/FeesTest.t.sol index 1e472526..9a2da3d3 100644 --- a/test/evmx/FeesTest.t.sol +++ b/test/evmx/FeesTest.t.sol @@ -11,6 +11,7 @@ contract FeesTest is AppGatewayBaseSetup { address receiver = address(uint160(c++)); address user = address(uint160(c++)); + address counterPlug; SocketContracts feesConfig; CounterAppGateway counterGateway; @@ -31,41 +32,45 @@ contract FeesTest is AppGatewayBaseSetup { // deploy counter app gateway counterGateway.deployContracts(feesChainSlug); executeDeploy(IAppGateway(counterGateway), feesChainSlug, contractIds); + + counterPlug = counterGateway.forwarderAddresses(contractIds[0], feesChainSlug); } function testDepositAndMintSusdc() public { + address counterGatewayAddress = address(counterGateway); // deposit usdc on fees plug and mint susdc on evmx with data execution - uint256 susdcBalanceBefore = feesManager.balanceOf(user); + uint256 susdcBalanceBefore = feesManager.balanceOf(counterGatewayAddress); + assertFalse(counterGateway.feesManagerSwitch(), "should be false"); depositNativeAndCreditsWithData( feesChainSlug, 100 ether, 0, user, - user, - bytes("") - // abi.encodeWithSelector(CounterAppGateway.increment.selector) + counterGatewayAddress, + abi.encode(true) ); + assertTrue(counterGateway.feesManagerSwitch(), "Fees manager should be called"); assertEq( - feesManager.balanceOf(user), + feesManager.balanceOf(counterGatewayAddress), susdcBalanceBefore + 100 ether, "Susdc balance should be correct" ); // burn susdc on evmx and mint susdc on chain - uint256 susdcChainBalanceBefore = feesConfig.susdcPlug.balanceOf(user); + uint256 susdcChainBalanceBefore = feesConfig.susdcPlug.balanceOf(counterPlug); - hoax(user); - feesManager.burn(feesChainSlug, user, 5 ether, bytes("")); + hoax(counterGatewayAddress); + feesManager.burn(feesChainSlug, address(counterPlug), 5 ether); executeRequest(); assertEq( - feesManager.balanceOf(user), + feesManager.balanceOf(counterGatewayAddress), susdcBalanceBefore + 95 ether, "Susdc balance should be correct" ); assertEq( - feesConfig.susdcPlug.balanceOf(user), + feesConfig.susdcPlug.balanceOf(counterPlug), susdcChainBalanceBefore + 5 ether, "Susdc balance should be correct" ); @@ -75,13 +80,15 @@ contract FeesTest is AppGatewayBaseSetup { bytes32 triggerId = _encodeTriggerId(address(feesConfig.socket), feesChainSlug); bytes memory payload = abi.encodeWithSelector( Credit.mint.selector, - user, + counterGatewayAddress, burnAmount, - bytes("") + abi.encode(false) ); - hoax(user); - feesConfig.susdcPlug.burn(user, burnAmount, bytes("")); + assertTrue(counterGateway.feesManagerSwitch(), "switch should be true"); + + hoax(counterPlug); + feesConfig.susdcPlug.burn(counterGatewayAddress, burnAmount, abi.encode(false)); TriggerParams[] memory params = new TriggerParams[](1); params[0] = TriggerParams({ @@ -103,13 +110,14 @@ contract FeesTest is AppGatewayBaseSetup { watcherNonce++; watcher.callAppGateways(watcherParams); + assertFalse(counterGateway.feesManagerSwitch(), "switch should be false"); assertEq( - feesManager.balanceOf(user), + feesManager.balanceOf(counterGatewayAddress), susdcBalanceBefore + 95 ether + burnAmount, "Susdc balance should be correct" ); assertEq( - feesConfig.susdcPlug.balanceOf(user), + feesConfig.susdcPlug.balanceOf(counterPlug), susdcChainBalanceBefore + 5 ether - burnAmount, "Susdc balance should be correct" ); @@ -117,7 +125,7 @@ contract FeesTest is AppGatewayBaseSetup { // burn susdc on evmx and withdraw usdc uint256 withdrawAmount = 1 ether; uint256 receiverBalanceBefore = feesConfig.testUSDC.balanceOf(receiver); - withdrawCredits(user, withdrawAmount); + withdrawCredits(counterGatewayAddress, withdrawAmount); uint256 withdrawAmountInTokens = withdrawAmount / 10 ** (18 - 6); assertEq( @@ -126,7 +134,7 @@ contract FeesTest is AppGatewayBaseSetup { "Receiver Balance should be correct after burn" ); assertEq( - feesConfig.susdcPlug.balanceOf(user), + feesConfig.susdcPlug.balanceOf(counterPlug), susdcChainBalanceBefore + 5 ether - burnAmount, "Susdc balance should be correct after burn" ); From 9053929081174217ff668185563057989d36ad0f Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 19 Aug 2025 22:31:05 +0530 Subject: [PATCH 094/139] fix: lint --- contracts/evmx/base/AppGatewayBase.sol | 3 ++- contracts/evmx/interfaces/IERC20.sol | 14 +++++++------- contracts/evmx/interfaces/IFeesPlug.sol | 21 ++++++++++++++++++--- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/contracts/evmx/base/AppGatewayBase.sol b/contracts/evmx/base/AppGatewayBase.sol index b2cafeef..2a931237 100644 --- a/contracts/evmx/base/AppGatewayBase.sol +++ b/contracts/evmx/base/AppGatewayBase.sol @@ -172,7 +172,8 @@ abstract contract AppGatewayBase is AddressResolverUtil, IAppGateway { return bytes32(0); } - onChainAddress = IForwarder(forwarderAddresses[contractId_][chainSlug_]).getOnChainAddress(); + onChainAddress = IForwarder(forwarderAddresses[contractId_][chainSlug_]) + .getOnChainAddress(); } //////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/contracts/evmx/interfaces/IERC20.sol b/contracts/evmx/interfaces/IERC20.sol index 3efe10b2..a77315e8 100644 --- a/contracts/evmx/interfaces/IERC20.sol +++ b/contracts/evmx/interfaces/IERC20.sol @@ -3,20 +3,20 @@ pragma solidity ^0.8.21; interface IERC20 { function totalSupply() external view returns (uint256); - + function balanceOf(address account) external view returns (uint256); - + function transfer(address to, uint256 amount) external returns (bool); - + function allowance(address owner, address spender) external view returns (uint256); - + function approve(address spender, uint256 amount) external returns (bool); - + function transferFrom(address from, address to, uint256 amount) external returns (bool); function decimals() external view returns (uint8); - + event Transfer(address indexed from, address indexed to, uint256 value); - + event Approval(address indexed owner, address indexed spender, uint256 value); } diff --git a/contracts/evmx/interfaces/IFeesPlug.sol b/contracts/evmx/interfaces/IFeesPlug.sol index ba9a7809..85cf0c25 100644 --- a/contracts/evmx/interfaces/IFeesPlug.sol +++ b/contracts/evmx/interfaces/IFeesPlug.sol @@ -17,11 +17,26 @@ interface IFeesPlug { /// @notice Event emitted when a token is removed from whitelist event TokenRemovedFromWhitelist(address token); - function depositCredit(address token_, address receiver_, uint256 amount_, bytes memory data_) external; + function depositCredit( + address token_, + address receiver_, + uint256 amount_, + bytes memory data_ + ) external; - function depositCreditAndNative(address token_, address receiver_, uint256 amount_, bytes memory data_) external; + function depositCreditAndNative( + address token_, + address receiver_, + uint256 amount_, + bytes memory data_ + ) external; - function depositToNative(address token_, address receiver_, uint256 amount_, bytes memory data_) external; + function depositToNative( + address token_, + address receiver_, + uint256 amount_, + bytes memory data_ + ) external; function withdrawFees(address token_, address receiver_, uint256 amount_) external; } From 3b3705c7150fb3248dac4ac4b3386dc788bdb04e Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 19 Aug 2025 22:31:15 +0530 Subject: [PATCH 095/139] fix: scripts --- FunctionSignatures.md | 112 +++++++++--------- hardhat-scripts/config/config.ts | 4 +- hardhat-scripts/constants/constants.ts | 2 + hardhat-scripts/deploy/1.deploy.ts | 12 ++ hardhat-scripts/deploy/3.configureChains.ts | 38 ++++++ hardhat-scripts/deploy/6.connect.ts | 6 +- hardhat-scripts/deploy/9.setupTransmitter.ts | 25 ++-- hardhat-scripts/utils/gatewayId.ts | 1 + script/helpers/DepositCreditAndNative.s.sol | 7 +- script/helpers/TransferRemainingCredits.s.sol | 7 +- src/enums.ts | 1 + src/types.ts | 1 + test/protocol/TriggerTest.t.sol | 2 - 13 files changed, 146 insertions(+), 72 deletions(-) diff --git a/FunctionSignatures.md b/FunctionSignatures.md index 84880d33..be7db21c 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -113,62 +113,62 @@ ## FeesManager -| Function | Signature | -| -------------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `approve` | `0xa3b53d8b` | -| `approveWithSignature` | `0x94b649ec` | -| `approveAppGateways` | `0x86d23ab2` | -| `asyncDeployer__` | `0x2a39e801` | -| `auctionManager` | `0xb0192f9a` | -| `blockCredits` | `0x9e434307` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `consumeFrom` | `0x40dd78be` | -| `creationCodeWithArgs` | `0xc126dcc4` | -| `deployForwarder__` | `0xd4e3b034` | -| `deposit` | `0x5671d329` | -| `deprecatedSbType` | `0x5a783900` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `feesPlugs` | `0x23f5ee8a` | -| `feesPool` | `0x6b259690` | -| `forwarderAddresses` | `0x5390fdcb` | -| `balanceOf` | `0xb065a8e5` | -| `getOnChainAddress` | `0xb6abffd7` | -| `getOverrideParams` | `0x54f0a866` | -| `handleRevert` | `0x44792f25` | -| `initialize` | `0xbf2c8539` | -| `initializeOnChain` | `0x86f01739` | -| `isApproved` | `0xa389783e` | -| `isAsyncModifierSet` | `0xb69e0c4a` | -| `isCreditSpendable` | `0x4f8990fd` | -| `isNonceUsed` | `0xcab7e8eb` | -| `isValidPromise` | `0xb690b962` | -| `maxFees` | `0xe83e34b1` | -| `onCompleteData` | `0xb52fa926` | -| `onDeployComplete` | `0xfa3dbd1e` | -| `overrideParams` | `0xec5490fe` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestBlockedCredits` | `0xb62d25ac` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `sbType` | `0x745de344` | -| `setAddress` | `0x85bf312c` | -| `setFeesPlug` | `0xd6a9a8b7` | -| `setFeesPool` | `0xd6684588` | -| `tokenOnChainBalances` | `0x3b27866d` | -| `transferFrom` | `0xf1686c89` | -| `transferOwnership` | `0xf2fde38b` | -| `unblockAndAssignCredits` | `0x01958181` | -| `unblockCredits` | `0xa0b32314` | -| `unwrap` | `0x7647691d` | -| `userCredits` | `0x20babb92` | -| `watcher__` | `0x300bb063` | -| `withdrawCredits` | `0xcfc6dbd9` | -| `wrap` | `0x023276f0` | +| Function | Signature | +| ---------------------------- | ------------ | +| `addressResolver__` | `0x6a750469` | +| `approve` | `0xa3b53d8b` | +| `approveWithSignature` | `0x94b649ec` | +| `approveAppGateways` | `0x86d23ab2` | +| `asyncDeployer__` | `0x2a39e801` | +| `auctionManager` | `0xb0192f9a` | +| `blockCredits` | `0x9e434307` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `consumeFrom` | `0x40dd78be` | +| `creationCodeWithArgs` | `0xc126dcc4` | +| `deployForwarder__` | `0xd4e3b034` | +| `deposit` | `0x5671d329` | +| `deprecatedSbType` | `0x5a783900` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `feesPlugs` | `0x23f5ee8a` | +| `feesPool` | `0x6b259690` | +| `forwarderAddresses` | `0x5390fdcb` | +| `balanceOf` | `0xb065a8e5` | +| `getOnChainAddress` | `0xb6abffd7` | +| `getOverrideParams` | `0x54f0a866` | +| `handleRevert` | `0x44792f25` | +| `initialize` | `0xbf2c8539` | +| `initializeOnChain` | `0x86f01739` | +| `isApproved` | `0xa389783e` | +| `isAsyncModifierSet` | `0xb69e0c4a` | +| `isCreditSpendable` | `0x4f8990fd` | +| `isNonceUsed` | `0xcab7e8eb` | +| `isValidPromise` | `0xb690b962` | +| `maxFees` | `0xe83e34b1` | +| `onCompleteData` | `0xb52fa926` | +| `onDeployComplete` | `0xfa3dbd1e` | +| `overrideParams` | `0xec5490fe` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestBlockedCredits` | `0xb62d25ac` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `sbType` | `0x745de344` | +| `setAddress` | `0x85bf312c` | +| `setFeesPlug` | `0xd6a9a8b7` | +| `setFeesPool` | `0xd6684588` | +| `tokenOnChainBalances` | `0x3b27866d` | +| `transferFrom` | `0xf1686c89` | +| `transferOwnership` | `0xf2fde38b` | +| `unblockAndAssignCredits` | `0x01958181` | +| `unblockCredits` | `0xa0b32314` | +| `unwrap` | `0x7647691d` | +| `userCredits` | `0x20babb92` | +| `watcher__` | `0x300bb063` | +| `withdrawCredits` | `0xcfc6dbd9` | +| `wrap` | `0x023276f0` | ## FeesPool diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 097f811f..e74334e6 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -34,8 +34,8 @@ export const getChains = () => { case DeploymentMode.DEV: return [ ChainSlug.ARBITRUM_SEPOLIA, - ChainSlug.OPTIMISM_SEPOLIA, - ChainSlug.BASE_SEPOLIA, + // ChainSlug.OPTIMISM_SEPOLIA, + // ChainSlug.BASE_SEPOLIA, ]; case DeploymentMode.STAGE: return [ diff --git a/hardhat-scripts/constants/constants.ts b/hardhat-scripts/constants/constants.ts index a7719397..a9467b10 100644 --- a/hardhat-scripts/constants/constants.ts +++ b/hardhat-scripts/constants/constants.ts @@ -12,3 +12,5 @@ export const CCTP_SWITCHBOARD_TYPE = id("CCTP"); export const BYTES32_ZERO = ethers.utils.hexZeroPad(constants.AddressZero, 32); export const MSG_SB_FEES = "100000000"; + +export const WRITE_MAX_FEES = ethers.utils.parseEther("0.000001"); diff --git a/hardhat-scripts/deploy/1.deploy.ts b/hardhat-scripts/deploy/1.deploy.ts index 0bbf2b65..f3b1fe34 100644 --- a/hardhat-scripts/deploy/1.deploy.ts +++ b/hardhat-scripts/deploy/1.deploy.ts @@ -30,6 +30,7 @@ import { FAST_SWITCHBOARD_TYPE, getFeePool, IMPLEMENTATION_SLOT, + WRITE_MAX_FEES, } from "../constants"; import { DeployParams, @@ -145,6 +146,7 @@ const deployEVMxContracts = async () => { addressResolver.address, deployUtils.addresses[Contracts.FeesPool], EVMxOwner, + WRITE_MAX_FEES, FAST_SWITCHBOARD_TYPE, ], proxyFactory, @@ -362,6 +364,16 @@ const deploySocketContracts = async () => { deployUtils ); deployUtils.addresses[contractName] = feesPlug.address; + + contractName = Contracts.SUSDC; + const susdcPlug: Contract = await getOrDeploy( + contractName, + contractName, + `contracts/evmx/plugs/${contractName}.sol`, + [18, socketOwner, socket.address, "SUSDC", "SUSDC"], + deployUtils + ); + deployUtils.addresses[contractName] = susdcPlug.address; } contractName = Contracts.ContractFactoryPlug; diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 0b106fa5..c54a6b30 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -121,6 +121,10 @@ export const configureChains = async (addresses: DeploymentAddresses) => { ); await setSiblingConfig(chain, addresses, signer); + + if (chainAddresses[Contracts.SUSDC]) + await setSUSDCToken(chain, chainAddresses, signer); + await storeAddresses(deployUtils.addresses, chain, mode); } }; @@ -204,6 +208,7 @@ async function setOnchainContracts( signer ); } + await updateContractSettings( EVMX_CHAIN_ID, Contracts.WritePrecompile, @@ -421,6 +426,39 @@ export const whitelistToken = async ( } }; +export const setSUSDCToken = async ( + chain: number, + addresses: ChainAddressesObj, + signer: Wallet +) => { + let contractInstance = await getInstance( + Contracts.FeesManager, + addresses[Contracts.FeesManager] + ); + contractInstance = await contractInstance.connect(signer); + + const susdcToken = contractInstance.susdcToken(); + const forwarderAddress = await contractInstance.forwarderAddresses( + susdcToken, + chain + ); + + if ( + forwarderAddress.toLowerCase() != addresses[Contracts.SUSDC]?.toLowerCase() + ) { + const tx = await contractInstance.setSusdcToken( + chain, + addresses[Contracts.SUSDC] + ); + console.log( + `Setting SUSDC token to ${addresses[Contracts.SUSDC]}: ${tx.hash}` + ); + await tx.wait(); + } else { + console.log(`SUSDC token is already set to ${addresses[Contracts.SUSDC]}`); + } +}; + main() .then(() => process.exit(0)) .catch((error: Error) => { diff --git a/hardhat-scripts/deploy/6.connect.ts b/hardhat-scripts/deploy/6.connect.ts index 031e12b9..df75b796 100644 --- a/hardhat-scripts/deploy/6.connect.ts +++ b/hardhat-scripts/deploy/6.connect.ts @@ -14,7 +14,11 @@ import { import { getWatcherSigner, sendWatcherMultiCallWithNonce } from "../utils/sign"; import { isConfigSetOnEVMx, isConfigSetOnSocket } from "../utils"; -const plugs = [Contracts.ContractFactoryPlug, Contracts.FeesPlug]; +const plugs = [ + Contracts.ContractFactoryPlug, + Contracts.FeesPlug, + Contracts.SUSDC, +]; // Main function to connect plugs on all chains export const main = async () => { diff --git a/hardhat-scripts/deploy/9.setupTransmitter.ts b/hardhat-scripts/deploy/9.setupTransmitter.ts index 7083221f..cae54826 100644 --- a/hardhat-scripts/deploy/9.setupTransmitter.ts +++ b/hardhat-scripts/deploy/9.setupTransmitter.ts @@ -20,8 +20,11 @@ let transmitterAddress: string; export const main = async () => { console.log("Setting up transmitter..."); await init(); - await checkAndDepositCredits(); - await checkAndDepositNative(); + await checkAndDepositCredits(transmitterAddress); + await checkAndDepositNative(transmitterAddress); + + await checkAndDepositCredits(evmxAddresses[Contracts.FeesManager]); + await checkAndDepositNative(evmxAddresses[Contracts.FeesManager]); await approveAuctionManager(); console.log("Transmitter setup complete!"); @@ -48,7 +51,11 @@ export const approveAuctionManager = async () => { console.log("Approving auction manager"); const tx = await feesManagerContract .connect(transmitterSigner) - .approveAppGateway(auctionManagerAddress, true, await overrides(EVMX_CHAIN_ID as ChainSlug)); + .approve( + auctionManagerAddress, + true, + await overrides(EVMX_CHAIN_ID as ChainSlug) + ); console.log("Auction manager approval tx hash:", tx.hash); await tx.wait(); console.log("Auction manager approved"); @@ -57,17 +64,17 @@ export const approveAuctionManager = async () => { } }; -export const checkAndDepositCredits = async () => { +export const checkAndDepositCredits = async (transmitter: string) => { console.log("Checking and depositing credits"); const credits = await feesManagerContract .connect(transmitterSigner) - .balanceOf(transmitterAddress); + .balanceOf(transmitter); if (credits.lt(TRANSMITTER_CREDIT_THRESHOLD)) { console.log("Depositing credits for transmitter..."); const tx = await feesManagerContract .connect(getWatcherSigner()) - .wrap(transmitterAddress, { + .wrap(transmitter, { ...(await overrides(EVMX_CHAIN_ID as ChainSlug)), value: TRANSMITTER_CREDIT_THRESHOLD, }); @@ -77,16 +84,16 @@ export const checkAndDepositCredits = async () => { } }; -export const checkAndDepositNative = async () => { +export const checkAndDepositNative = async (transmitter: string) => { console.log("Checking and depositing native"); const nativeBalance = await transmitterSigner.provider!.getBalance( - transmitterAddress + transmitter ); if (nativeBalance.lt(TRANSMITTER_NATIVE_THRESHOLD)) { console.log("Depositing native for transmitter..."); const tx = await getWatcherSigner().sendTransaction({ - to: transmitterAddress, + to: transmitter, value: TRANSMITTER_NATIVE_THRESHOLD, ...(await overrides(EVMX_CHAIN_ID as ChainSlug)), }); diff --git a/hardhat-scripts/utils/gatewayId.ts b/hardhat-scripts/utils/gatewayId.ts index a24fc02d..fcc4c3d7 100644 --- a/hardhat-scripts/utils/gatewayId.ts +++ b/hardhat-scripts/utils/gatewayId.ts @@ -14,6 +14,7 @@ export const getAppGatewayId = ( if (!address) throw new Error(`WritePrecompile not found on EVMX`); return ethers.utils.hexZeroPad(address, 32); case Contracts.FeesPlug: + case Contracts.SUSDC: address = addresses?.[EVMX_CHAIN_ID]?.[Contracts.FeesManager]; if (!address) throw new Error(`FeesManager not found on EVMX`); return ethers.utils.hexZeroPad(address, 32); diff --git a/script/helpers/DepositCreditAndNative.s.sol b/script/helpers/DepositCreditAndNative.s.sol index 3d1f4a17..47a0cf0d 100644 --- a/script/helpers/DepositCreditAndNative.s.sol +++ b/script/helpers/DepositCreditAndNative.s.sol @@ -30,6 +30,11 @@ contract DepositCreditAndNative is Script { console.log("App Gateway:", appGateway); console.log("Fees Plug:", address(feesPlug)); console.log("Fees Amount:", feesAmount); - feesPlug.depositCreditAndNative(address(testUSDCContract), appGateway, feesAmount, bytes("")); + feesPlug.depositCreditAndNative( + address(testUSDCContract), + appGateway, + feesAmount, + bytes("") + ); } } diff --git a/script/helpers/TransferRemainingCredits.s.sol b/script/helpers/TransferRemainingCredits.s.sol index 7691ae25..6ebec144 100644 --- a/script/helpers/TransferRemainingCredits.s.sol +++ b/script/helpers/TransferRemainingCredits.s.sol @@ -27,7 +27,12 @@ contract TransferRemainingCredits is Script { uint256 availableFees = feesManager.balanceOf(appGateway); console.log("Available fees:", availableFees); - bytes memory data = abi.encodeWithSignature("transferFrom(address,address,uint256)", appGateway, newAppGateway, availableFees); + bytes memory data = abi.encodeWithSignature( + "transferFrom(address,address,uint256)", + appGateway, + newAppGateway, + availableFees + ); (bool success, ) = appGateway.call(data); require(success, "Transfer failed"); vm.stopBroadcast(); diff --git a/src/enums.ts b/src/enums.ts index e9b3f49b..4c556eb0 100644 --- a/src/enums.ts +++ b/src/enums.ts @@ -53,6 +53,7 @@ export enum Events { export enum Contracts { Socket = "Socket", FeesPlug = "FeesPlug", + SUSDC = "SUSDC", ContractFactoryPlug = "ContractFactoryPlug", FastSwitchboard = "FastSwitchboard", FastSwitchboardId = "FastSwitchboardId", diff --git a/src/types.ts b/src/types.ts index a603b158..014b1539 100644 --- a/src/types.ts +++ b/src/types.ts @@ -27,6 +27,7 @@ export type ChainAddressesObj = { ContractFactoryPlug: string; SocketFeesManager?: string; FeesPlug?: string; + SUSDC?: string; startBlock: number; SwitchboardIdToAddressMap: { [switchboardId: string]: string }; }; diff --git a/test/protocol/TriggerTest.t.sol b/test/protocol/TriggerTest.t.sol index d581814d..24f475e7 100644 --- a/test/protocol/TriggerTest.t.sol +++ b/test/protocol/TriggerTest.t.sol @@ -92,6 +92,4 @@ contract TriggerTest is AppGatewayBaseSetup { // Check counter was incremented assertEq(gateway.counterVal(), incrementValue, "Gateway counter should be incremented"); } - - } From 0d309bef57755c173410c23eb84be1a0358caa16 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 20 Aug 2025 01:37:24 +0800 Subject: [PATCH 096/139] fix: script errors --- Errors.md | 2 + contracts/evmx/fees/Credit.sol | 3 - deployments/dev_addresses.json | 103 ++++++------------- foundry.toml | 42 ++++---- hardhat-scripts/deploy/3.configureChains.ts | 24 +++-- hardhat-scripts/deploy/9.setupTransmitter.ts | 5 +- 6 files changed, 71 insertions(+), 108 deletions(-) diff --git a/Errors.md b/Errors.md index ae06096c..c5757e5f 100644 --- a/Errors.md +++ b/Errors.md @@ -173,3 +173,5 @@ | `InvalidData()` | `0x5cb045db` | | `InvalidSignature()` | `0x8baa579f` | | `DeadlinePassed()` | `0x70f65caa` | +| `OnlyRequestHandlerAllowed()` | `0x5c1aa683` | +| `OnlyPromiseResolverAllowed()` | `0x2392c25e` | diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 2fe19db0..dc4af589 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -110,9 +110,6 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew /// @notice Emitted when withdraw fails event WithdrawFailed(bytes32 indexed payloadId); - /// @notice Emitted when credits are blocked - event CreditsBlocked(address indexed user, uint256 amount); - /// @notice Emitted when credits are unblocked event CreditsUnblocked(address indexed user, uint256 amount); diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index a540d6af..f3a1d9c0 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -1,82 +1,47 @@ { "14323": { - "AddressResolver": "0x774f608eD8fc03B05a9da51588F8571ced4c2eb2", - "AddressResolverImpl": "0x9c58dAABeBE7D6DfD8F70097c6f9c87FEC9b83DE", - "AsyncDeployer": "0xF1D3ebDF91Cf4b1bc7C9A1D78413CD1Ed2d3123d", - "AsyncDeployerImpl": "0x8daf174Be9Bb708c04b708A92b88Cc89bd223498", - "AuctionManager": "0xE4243383566fcA32aA6815dE83e8EA86b2027b8b", - "AuctionManagerImpl": "0x8EB4402AFAa335b05Bb37f80377F77eeC678b734", - "Configurations": "0x6a6697A2AD51DB9a41BaEE78e194335c1aD7369d", - "ConfigurationsImpl": "0x8A9256F31b0bb85863c253F8CAE800A32Cb2d595", - "DeployForwarder": "0xE986bCd19b8725ea3417C2A7728158ecABA6C8bE", - "DeployForwarderImpl": "0xfBe803842B50d8A2a91DA3dD88B67E92D5C0bd97", + "AddressResolver": "0xcA99D298B5290558660b4D5C1019Be145FaB6020", + "AddressResolverImpl": "0x39b5D3FBBa1BC28438e25955aaB412C7576eCd61", + "AsyncDeployer": "0xd608e1345281dE0675e2Cc1E8D0B31aD167618Ad", + "AsyncDeployerImpl": "0x2F0E83Fcd03A191D280598c33d278AF8A7e9076a", + "AuctionManager": "0xED848E9e0CCA0868484353B529E04861Fd8F04Bd", + "AuctionManagerImpl": "0x2752caa4060bC744216515c247C54Ae5bB873DF2", + "Configurations": "0xf50A9785aef5ADeA0659609e9FF1de8578aF0b4f", + "ConfigurationsImpl": "0xa1780f9F81090737267ccd3A5663E058AfE73A49", + "DeployForwarder": "0xffF606007317cb7a1CC4C701d62C38c7734dfb15", + "DeployForwarderImpl": "0x69e3Dc5667f7413039fE3bFd335660A99DA869A9", "ERC1967Factory": "0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79", - "FeesManager": "0xa6D93e7B2cde3C8d318f45890dE3dB0a2E54058B", - "FeesManagerImpl": "0x38A7558D2C3b4097c2098444a46D625D51E7336F", + "FeesManager": "0xbCFf8224d89f0b4e9B14c4356720439111BAC2bC", + "FeesManagerImpl": "0x56671a257b8492A6E62D32B670F29A76e58F59F6", "FeesPool": "0x13A3018920c7b56B20dd34E29C298121025E6de4", - "PromiseResolver": "0x40834274ee715B1748e450A67cFf2B52b0388eC3", - "ReadPrecompile": "0xE693bEc40e39223749AC351156E713b7256541B0", - "RequestHandler": "0xE785Fdbd049D0647e8B2Bd28C75a679dEBaD9D6f", - "RequestHandlerImpl": "0x5332d341cd7B423C2f75AF7Ca295455e5F08fAcb", - "SchedulePrecompile": "0x1099338aB85627640bB7A0D55c683921EA766C75", - "startBlock": 10904, - "Watcher": "0x96ACe2d4a36a1Fd6e3eeE1cD3FeDA36eA62E3064", - "WatcherImpl": "0xE5542FAB56B652A95aBD05a08E920687d1ef3849", - "WritePrecompile": "0x27794dd1166ED0c6A70c655C297BB79bF06bf44A", - "WritePrecompileImpl": "0xc2Ca571f4d4C2008Da4Bd750BaD3d50A5705ffF8" - }, - "84532": { - "CCTPSwitchboard": "0xBD6770182fB47DD77924aDf3F200246Ab851f9c2", - "CCTPSwitchboardId": "2", - "ContractFactoryPlug": "0x6320Ff773a4E01Cb8EB849EA906F17Cf6c48Ff9c", - "FastSwitchboard": "0x2420B85D7e126d1948a4602f0c78a685655292Bd", - "FastSwitchboardId": "1", - "FeesPlug": "0x89634ecFea933aFaD5d3D6557b13cb8D466313d2", - "MessageSwitchboard": "0xd94741a4654953817faEe228739a6d10C0683839", - "MessageSwitchboardId": "3", - "Socket": "0xA90f2aB2804e8575D021882aAB74399fa282A8A3", - "SocketBatcher": "0x138C1B6e301C7d1B59920bEe2834f5B481bA39dF", - "startBlock": 29270214, - "SwitchboardIdToAddressMap": { - "1": "0x2420B85D7e126d1948a4602f0c78a685655292Bd", - "2": "0xBD6770182fB47DD77924aDf3F200246Ab851f9c2", - "3": "0xd94741a4654953817faEe228739a6d10C0683839" - } + "PromiseResolver": "0xed318668898303141EA6B9c2a9F97D0622b0a530", + "ReadPrecompile": "0x7C82C3d2aE1bFB4b1D294e5181bCd7489EF554d1", + "RequestHandler": "0xf053AB14323FF52e7e65D6Fb12f86896F0865a36", + "RequestHandlerImpl": "0xe75f36466466D1383AC98ecfC627Ab49440C46c9", + "SchedulePrecompile": "0x4660c5fF2762E688f8D0def828ad161AE4940F57", + "startBlock": 46937, + "Watcher": "0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d", + "WatcherImpl": "0xfbb565A9Be17546628ED2cdCa43000758a7b5dDe", + "WritePrecompile": "0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15", + "WritePrecompileImpl": "0x52BfcB9bD0f1a387f28608C01cE8123310Ce3199" }, "421614": { - "CCTPSwitchboard": "0xaF912b7eaD59f5d8c8179f8606A3fa93459a612C", - "CCTPSwitchboardId": "2", - "ContractFactoryPlug": "0x2784a207d51DD8c1A5323C05Fb868B68a854326C", - "FastSwitchboard": "0xd8DDEA0c49C0bcbFD31272c262a4b31FfB44a8Bc", - "FastSwitchboardId": "1", - "FeesPlug": "0x3CFe3e7eCc62232B3d29454DCABeE4f2B921e3a2", - "MessageSwitchboard": "0x0C049f6Dd92eA5dA05058b9B309755Cb347587C9", - "MessageSwitchboardId": "3", - "Socket": "0x90c5210fcFbFF7DA5753F3ddAEBee4102b8d6A9B", - "SocketBatcher": "0xd726FeF96aD21AAD24443FAE933DDa9c79716a93", - "startBlock": 178158322, - "SwitchboardIdToAddressMap": { - "1": "0xd8DDEA0c49C0bcbFD31272c262a4b31FfB44a8Bc", - "2": "0xaF912b7eaD59f5d8c8179f8606A3fa93459a612C", - "3": "0x0C049f6Dd92eA5dA05058b9B309755Cb347587C9" - } - }, - "11155420": { - "CCTPSwitchboard": "0x1801b7e2E553c7233c2fd7c9e8647f6b91ff7a76", + "CCTPSwitchboard": "0x0355064bBb553A3765af498004749fB2e19284c0", "CCTPSwitchboardId": "2", - "ContractFactoryPlug": "0xC5B314127DFa001f00e5773EA55765A9007320a6", - "FastSwitchboard": "0x9f1DE81ff3274eD6678a5A1644F430b06EF0992D", + "ContractFactoryPlug": "0x106A3205827D94d804CF7823B82E6742ED38D863", + "FastSwitchboard": "0x36620137587b544A8235C080067B3c439ae1c7d7", "FastSwitchboardId": "1", - "FeesPlug": "0x72708A701Fa94B8a1746c2ED1A1dd41C56dA7b33", - "MessageSwitchboard": "0xE3756057aEd63488Acbfa6DC31a3E99bFBcf0d4A", + "FeesPlug": "0x9Fd89116E514142C04aE72824E2A7dC26F311655", + "MessageSwitchboard": "0x060493ac77c630f4d307Df9bb9bF32cE7462eb70", "MessageSwitchboardId": "3", - "Socket": "0xbc47b9BeBBf72Cf5a08c3b0381acFc2c754dA073", - "SocketBatcher": "0x87C9a09e05D0D2A885eb7B2644c3CBB8E70763b6", - "startBlock": 30946234, + "Socket": "0x0da062CDB868A30CbB6314074202d67e4eAaBa51", + "SocketBatcher": "0x18433B14d10Ee05D007e00f897B40696d6fC56f6", + "startBlock": 185630714, + "SUSDC": "0x7F7ad06B15cFe9ebE45b01C694205CdB64e8F56d", "SwitchboardIdToAddressMap": { - "1": "0x9f1DE81ff3274eD6678a5A1644F430b06EF0992D", - "2": "0x1801b7e2E553c7233c2fd7c9e8647f6b91ff7a76", - "3": "0xE3756057aEd63488Acbfa6DC31a3E99bFBcf0d4A" + "1": "0x36620137587b544A8235C080067B3c439ae1c7d7", + "2": "0x0355064bBb553A3765af498004749fB2e19284c0", + "3": "0x060493ac77c630f4d307Df9bb9bF32cE7462eb70" } } } diff --git a/foundry.toml b/foundry.toml index 2499c44b..7ab8ecfd 100644 --- a/foundry.toml +++ b/foundry.toml @@ -10,26 +10,26 @@ evm_version = 'paris' via_ir = false [labels] -0x774f608eD8fc03B05a9da51588F8571ced4c2eb2 = "AddressResolver" -0x9c58dAABeBE7D6DfD8F70097c6f9c87FEC9b83DE = "AddressResolverImpl" -0xF1D3ebDF91Cf4b1bc7C9A1D78413CD1Ed2d3123d = "AsyncDeployer" -0x8daf174Be9Bb708c04b708A92b88Cc89bd223498 = "AsyncDeployerImpl" -0xE4243383566fcA32aA6815dE83e8EA86b2027b8b = "AuctionManager" -0x8EB4402AFAa335b05Bb37f80377F77eeC678b734 = "AuctionManagerImpl" -0x6a6697A2AD51DB9a41BaEE78e194335c1aD7369d = "Configurations" -0x8A9256F31b0bb85863c253F8CAE800A32Cb2d595 = "ConfigurationsImpl" -0xE986bCd19b8725ea3417C2A7728158ecABA6C8bE = "DeployForwarder" -0xfBe803842B50d8A2a91DA3dD88B67E92D5C0bd97 = "DeployForwarderImpl" +0xcA99D298B5290558660b4D5C1019Be145FaB6020 = "AddressResolver" +0x39b5D3FBBa1BC28438e25955aaB412C7576eCd61 = "AddressResolverImpl" +0xd608e1345281dE0675e2Cc1E8D0B31aD167618Ad = "AsyncDeployer" +0x2F0E83Fcd03A191D280598c33d278AF8A7e9076a = "AsyncDeployerImpl" +0xED848E9e0CCA0868484353B529E04861Fd8F04Bd = "AuctionManager" +0x2752caa4060bC744216515c247C54Ae5bB873DF2 = "AuctionManagerImpl" +0xf50A9785aef5ADeA0659609e9FF1de8578aF0b4f = "Configurations" +0xa1780f9F81090737267ccd3A5663E058AfE73A49 = "ConfigurationsImpl" +0xffF606007317cb7a1CC4C701d62C38c7734dfb15 = "DeployForwarder" +0x69e3Dc5667f7413039fE3bFd335660A99DA869A9 = "DeployForwarderImpl" 0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79 = "ERC1967Factory" -0xa6D93e7B2cde3C8d318f45890dE3dB0a2E54058B = "FeesManager" -0x38A7558D2C3b4097c2098444a46D625D51E7336F = "FeesManagerImpl" +0xbCFf8224d89f0b4e9B14c4356720439111BAC2bC = "FeesManager" +0x56671a257b8492A6E62D32B670F29A76e58F59F6 = "FeesManagerImpl" 0x13A3018920c7b56B20dd34E29C298121025E6de4 = "FeesPool" -0x40834274ee715B1748e450A67cFf2B52b0388eC3 = "PromiseResolver" -0xE693bEc40e39223749AC351156E713b7256541B0 = "ReadPrecompile" -0xE785Fdbd049D0647e8B2Bd28C75a679dEBaD9D6f = "RequestHandler" -0x5332d341cd7B423C2f75AF7Ca295455e5F08fAcb = "RequestHandlerImpl" -0x1099338aB85627640bB7A0D55c683921EA766C75 = "SchedulePrecompile" -0x96ACe2d4a36a1Fd6e3eeE1cD3FeDA36eA62E3064 = "Watcher" -0xE5542FAB56B652A95aBD05a08E920687d1ef3849 = "WatcherImpl" -0x27794dd1166ED0c6A70c655C297BB79bF06bf44A = "WritePrecompile" -0xc2Ca571f4d4C2008Da4Bd750BaD3d50A5705ffF8 = "WritePrecompileImpl" +0xed318668898303141EA6B9c2a9F97D0622b0a530 = "PromiseResolver" +0x7C82C3d2aE1bFB4b1D294e5181bCd7489EF554d1 = "ReadPrecompile" +0xf053AB14323FF52e7e65D6Fb12f86896F0865a36 = "RequestHandler" +0xe75f36466466D1383AC98ecfC627Ab49440C46c9 = "RequestHandlerImpl" +0x4660c5fF2762E688f8D0def828ad161AE4940F57 = "SchedulePrecompile" +0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d = "Watcher" +0xfbb565A9Be17546628ED2cdCa43000758a7b5dDe = "WatcherImpl" +0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15 = "WritePrecompile" +0x52BfcB9bD0f1a387f28608C01cE8123310Ce3199 = "WritePrecompileImpl" diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index c54a6b30..0f68e7d9 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -123,7 +123,11 @@ export const configureChains = async (addresses: DeploymentAddresses) => { await setSiblingConfig(chain, addresses, signer); if (chainAddresses[Contracts.SUSDC]) - await setSUSDCToken(chain, chainAddresses, signer); + await setSUSDCToken( + chain, + addresses[EVMX_CHAIN_ID]?.[Contracts.FeesManager]!, + chainAddresses[Contracts.SUSDC] + ); await storeAddresses(deployUtils.addresses, chain, mode); } @@ -428,14 +432,14 @@ export const whitelistToken = async ( export const setSUSDCToken = async ( chain: number, - addresses: ChainAddressesObj, - signer: Wallet + feesManagerAddress: string, + susdcAddress: string ) => { let contractInstance = await getInstance( Contracts.FeesManager, - addresses[Contracts.FeesManager] + feesManagerAddress ); - contractInstance = await contractInstance.connect(signer); + contractInstance = await contractInstance.connect(getWatcherSigner()); const susdcToken = contractInstance.susdcToken(); const forwarderAddress = await contractInstance.forwarderAddresses( @@ -444,18 +448,16 @@ export const setSUSDCToken = async ( ); if ( - forwarderAddress.toLowerCase() != addresses[Contracts.SUSDC]?.toLowerCase() + forwarderAddress.toLowerCase() != toBytes32FormatHexString(susdcAddress) ) { const tx = await contractInstance.setSusdcToken( chain, - addresses[Contracts.SUSDC] - ); - console.log( - `Setting SUSDC token to ${addresses[Contracts.SUSDC]}: ${tx.hash}` + toBytes32FormatHexString(susdcAddress) ); + console.log(`Setting SUSDC token to ${susdcAddress}: ${tx.hash}`); await tx.wait(); } else { - console.log(`SUSDC token is already set to ${addresses[Contracts.SUSDC]}`); + console.log(`SUSDC token is already set to ${susdcAddress}`); } }; diff --git a/hardhat-scripts/deploy/9.setupTransmitter.ts b/hardhat-scripts/deploy/9.setupTransmitter.ts index cae54826..4bbe3431 100644 --- a/hardhat-scripts/deploy/9.setupTransmitter.ts +++ b/hardhat-scripts/deploy/9.setupTransmitter.ts @@ -22,9 +22,6 @@ export const main = async () => { await init(); await checkAndDepositCredits(transmitterAddress); await checkAndDepositNative(transmitterAddress); - - await checkAndDepositCredits(evmxAddresses[Contracts.FeesManager]); - await checkAndDepositNative(evmxAddresses[Contracts.FeesManager]); await approveAuctionManager(); console.log("Transmitter setup complete!"); @@ -51,7 +48,7 @@ export const approveAuctionManager = async () => { console.log("Approving auction manager"); const tx = await feesManagerContract .connect(transmitterSigner) - .approve( + ["approve(address,bool)"]( auctionManagerAddress, true, await overrides(EVMX_CHAIN_ID as ChainSlug) From 8f96adf0e372a36e98da1e47934fb34e4e5e63ab Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 20 Aug 2025 19:41:17 +0800 Subject: [PATCH 097/139] fix: test setup --- test/SetupTest.t.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 5bf2d423..83464bba 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -813,6 +813,10 @@ contract WatcherSetup is AuctionSetup { requestCount = watcher.getCurrentRequestCount(); requestCount = requestCount == 0 ? 0 : requestCount - 1; + executeRequest(requestCount); + } + + function executeRequest(uint40 requestCount) internal { RequestParams memory requestParams = requestHandler.getRequest(requestCount); uint40[] memory batches = requestHandler.getRequestBatchIds(requestCount); From e855a4e2293d353cdcd9d4002267b1e07c8c5c7b Mon Sep 17 00:00:00 2001 From: Akash Date: Wed, 20 Aug 2025 19:27:01 +0530 Subject: [PATCH 098/139] fix: signer nonce --- src/signer.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/signer.ts b/src/signer.ts index 78a6d8a1..18658fbb 100644 --- a/src/signer.ts +++ b/src/signer.ts @@ -1,5 +1,5 @@ import { ethers } from "ethers"; - +import { v4 as uuidv4 } from "uuid"; export const signWatcherMultiCallMessage = async ( watcherContractAddress: string, evmxChainId: number, @@ -25,8 +25,7 @@ export const signWatcherMultiCallMessage = async ( }; export const getNonce = () => { - const timestamp = Date.now(); - const random = Math.floor(Math.random() * 1000); - const nonce = Number(String(timestamp) + String(random)); - return nonce; + const randomId = uuidv4(); + const nonceHex = randomId.replace(/-/g, ""); + return "0x" + nonceHex; }; From 5f569b551060fcfabccf7992e30ace9637cac136 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 20 Aug 2025 22:16:20 +0800 Subject: [PATCH 099/139] chore: bump package --- package.json | 2 +- script/counter/DeployEVMxCounterApp.s.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e284de83..c7e0ff85 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.1.37", + "version": "1.1.41", "description": "socket protocol", "scripts": { "build": "yarn abi && tsc --project lib.tsconfig.json", diff --git a/script/counter/DeployEVMxCounterApp.s.sol b/script/counter/DeployEVMxCounterApp.s.sol index 50a81c25..5bf183ca 100644 --- a/script/counter/DeployEVMxCounterApp.s.sol +++ b/script/counter/DeployEVMxCounterApp.s.sol @@ -5,7 +5,7 @@ import {Script} from "forge-std/Script.sol"; import {console} from "forge-std/console.sol"; import {CounterAppGateway} from "../../test/apps/app-gateways/counter/CounterAppGateway.sol"; -// source .env && forge script script/counter/deployEVMxCounterApp.s.sol --broadcast --skip-simulation --legacy --gas-price 0 +// source .env && forge script script/counter/deployEVMxCounterApp.s.sol --broadcast --skip-simulation contract CounterDeploy is Script { function run() external { address addressResolver = vm.envAddress("ADDRESS_RESOLVER"); From 3428dc76e9461aef83912afb66049c7a92d25ed3 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 21 Aug 2025 01:41:44 +0800 Subject: [PATCH 100/139] fix: add set max fee --- contracts/evmx/fees/FeesManager.sol | 4 ++++ contracts/evmx/interfaces/IFeesManager.sol | 2 ++ deployments/dev_addresses.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/contracts/evmx/fees/FeesManager.sol b/contracts/evmx/fees/FeesManager.sol index 6e70a455..3636f8ed 100644 --- a/contracts/evmx/fees/FeesManager.sol +++ b/contracts/evmx/fees/FeesManager.sol @@ -60,6 +60,10 @@ contract FeesManager is Credit { _initializeAppGateway(addressResolver_); } + function setMaxFees(uint256 fees_) external onlyOwner { + _setMaxFees(fees_); + } + /////////////////////// FEES MANAGEMENT /////////////////////// /// @notice Blocks fees for a request count diff --git a/contracts/evmx/interfaces/IFeesManager.sol b/contracts/evmx/interfaces/IFeesManager.sol index 0bd3a561..01555b26 100644 --- a/contracts/evmx/interfaces/IFeesManager.sol +++ b/contracts/evmx/interfaces/IFeesManager.sol @@ -49,4 +49,6 @@ interface IFeesManager { function burn(uint32 chainSlug_, address receiver_, uint256 amount_) external; function mint(address to, uint256 amount, bytes memory data_) external; + + function setMaxFees(uint256 fees_) external; } diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index f3a1d9c0..de6e9129 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -12,7 +12,7 @@ "DeployForwarderImpl": "0x69e3Dc5667f7413039fE3bFd335660A99DA869A9", "ERC1967Factory": "0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79", "FeesManager": "0xbCFf8224d89f0b4e9B14c4356720439111BAC2bC", - "FeesManagerImpl": "0x56671a257b8492A6E62D32B670F29A76e58F59F6", + "FeesManagerImpl": "0xeC85e4B8181CD77557CF61fC48dfC4cbab1F82a5", "FeesPool": "0x13A3018920c7b56B20dd34E29C298121025E6de4", "PromiseResolver": "0xed318668898303141EA6B9c2a9F97D0622b0a530", "ReadPrecompile": "0x7C82C3d2aE1bFB4b1D294e5181bCd7489EF554d1", From baaf1fae719842d48bf40354ba2833ba4e3654fd Mon Sep 17 00:00:00 2001 From: Gregory The Dev Date: Wed, 27 Aug 2025 11:11:17 +0200 Subject: [PATCH 101/139] minor changes --- Errors.md | 190 ++-- EventTopics.md | 2 + FunctionSignatures.md | 933 +++++++++--------- contracts/protocol/SocketConfig.sol | 6 + foundry.toml | 50 +- hardhat-scripts/deploy/3.configureChains.ts | 2 +- .../DeployEVMSolanaApps.s.sol | 2 +- 7 files changed, 597 insertions(+), 588 deletions(-) diff --git a/Errors.md b/Errors.md index 9f8047f5..b5c59429 100644 --- a/Errors.md +++ b/Errors.md @@ -1,20 +1,21 @@ # Custom Error Codes + ## evmx/fees/FeesPool.sol -| Error | Signature | -| ------------------ | ------------ | +| Error | Signature | +|-------|-----------| | `TransferFailed()` | `0x90b8ec18` | ## evmx/helpers/AsyncPromise.sol -| Error | Signature | -| -------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `PromiseAlreadyResolved()` | `0x56b63537` | -| `OnlyInvoker()` | `0x74ed21f5` | -| `PromiseAlreadySetUp()` | `0x927c53d5` | -| `PromiseRevertFailed()` | `0x0175b9de` | -| `NotLatestPromise()` | `0x39ca95d3` | +| `OnlyInvoker()` | `0x74ed21f5` | +| `PromiseAlreadySetUp()` | `0x927c53d5` | +| `PromiseRevertFailed()` | `0x0175b9de` | +| `NotLatestPromise()` | `0x39ca95d3` | ## evmx/helpers/ForwarderSolana.sol @@ -25,132 +26,131 @@ ## evmx/plugs/ContractFactoryPlug.sol -| Error | Signature | -| -------------------------------- | ------------ | -| `DeploymentFailed()` | `0x30116425` | +| Error | Signature | +|-------|-----------| +| `DeploymentFailed()` | `0x30116425` | | `ExecutionFailed(bytes32,bytes)` | `0xd255d8a3` | -| `information(bool,,bytes)` | `0x3a82a1f3` | +| `information(bool,,bytes)` | `0x3a82a1f3` | ## evmx/plugs/FeesPlug.sol -| Error | Signature | -| --------------------------------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientTokenBalance(address,uint256,uint256)` | `0xebd6ced9` | -| `InvalidDepositAmount()` | `0xfe9ba5cd` | -| `TokenNotWhitelisted(address)` | `0xea3bff2e` | - +| `InvalidDepositAmount()` | `0xfe9ba5cd` | +| `TokenNotWhitelisted(address)` | `0xea3bff2e` | ## evmx/watcher/RequestHandler.sol -| Error | Signature | -| ----------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientMaxFees()` | `0x0e5bc492` | ## protocol/Socket.sol -| Error | Signature | -| ----------------------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `PayloadAlreadyExecuted(ExecutionStatus)` | `0xf4c54edd` | -| `VerificationFailed()` | `0x439cc0cd` | -| `LowGasLimit()` | `0xd38edae0` | -| `InsufficientMsgValue()` | `0x78f38f76` | +| `VerificationFailed()` | `0x439cc0cd` | +| `LowGasLimit()` | `0xd38edae0` | +| `InsufficientMsgValue()` | `0x78f38f76` | ## protocol/SocketConfig.sol -| Error | Signature | -| ------------------------------- | ------------ | -| `SwitchboardExists()` | `0x2dff8555` | +| Error | Signature | +|-------|-----------| +| `SwitchboardExists()` | `0x2dff8555` | | `SwitchboardExistsOrDisabled()` | `0x1c7d2487` | ## protocol/SocketFeeManager.sol -| Error | Signature | -| -------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `InsufficientFees()` | `0x8d53e553` | -| `FeeTooLow()` | `0x732f9413` | +| `FeeTooLow()` | `0x732f9413` | ## protocol/SocketUtils.sol -| Error | Signature | -| -------------------- | ------------ | -| `OnlyOffChain()` | `0x9cbfe066` | +| Error | Signature | +|-------|-----------| +| `OnlyOffChain()` | `0x9cbfe066` | | `SimulationFailed()` | `0x2fbab3ac` | ## protocol/switchboard/FastSwitchboard.sol -| Error | Signature | -| ------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `AlreadyAttested()` | `0x35d90805` | | `WatcherNotFound()` | `0xa278e4ad` | ## utils/AccessControl.sol -| Error | Signature | -| ------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `NoPermit(bytes32)` | `0x962f6333` | ## utils/common/Converters.sol -| Error | Signature | -| -------------------------- | ------------ | +| Error | Signature | +|-------|-----------| | `NotAnEvmAddress(bytes32)` | `0x33b960d0` | ## utils/common/Errors.sol -| Error | Signature | -| --------------------------------------------- | ------------ | -| `ZeroAddress()` | `0xd92e233d` | -| `InvalidTransmitter()` | `0x58a70a0a` | -| `InvalidTokenAddress()` | `0x1eb00b06` | -| `InvalidSwitchboard()` | `0xf63c9e4d` | -| `SocketAlreadyInitialized()` | `0xc9500b00` | -| `NotSocket()` | `0xc59f8f7c` | -| `PlugNotFound()` | `0x5f1ac76a` | -| `ResolvingScheduleTooEarly()` | `0x207e8731` | -| `CallFailed()` | `0x3204506f` | -| `InvalidAppGateway()` | `0x82ded261` | -| `AppGatewayAlreadyCalled()` | `0xb224683f` | -| `InvalidCallerTriggered()` | `0x3292d247` | -| `InvalidPromise()` | `0x45f2d176` | -| `InvalidWatcherSignature()` | `0x5029f14f` | -| `NonceUsed()` | `0x1f6d5aef` | -| `AsyncModifierNotSet()` | `0xcae106f9` | -| `WatcherNotSet()` | `0x42d473a7` | -| `InvalidTarget()` | `0x82d5d76a` | -| `InvalidIndex()` | `0x63df8171` | -| `InvalidChainSlug()` | `0xbff6b106` | -| `InvalidPayloadSize()` | `0xfbdf7954` | -| `InvalidOnChainAddress()` | `0xb758c606` | -| `InvalidScheduleDelay()` | `0x9a993219` | -| `AuctionClosed()` | `0x36b6b46d` | -| `AuctionNotOpen()` | `0xf0460077` | -| `BidExceedsMaxFees()` | `0x4c923f3c` | -| `LowerBidAlreadyExists()` | `0xaaa1f709` | -| `RequestCountMismatch()` | `0x98bbcbff` | -| `InvalidAmount()` | `0x2c5211c6` | -| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | -| `InsufficientBalance()` | `0xf4d678b8` | -| `InvalidCaller()` | `0x48f5c3ed` | -| `InvalidGateway()` | `0xfc9dfe85` | -| `RequestAlreadyCancelled()` | `0xc70f47d8` | -| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | -| `InvalidBid()` | `0xc6388ef7` | -| `MaxReAuctionCountReached()` | `0xf2b4388c` | -| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | -| `OnlyWatcherAllowed()` | `0xdf7d227c` | -| `InvalidPrecompileData()` | `0x320062c0` | -| `InvalidCallType()` | `0x39d2eb55` | -| `NotRequestHandler()` | `0x8f8cba5b` | -| `NotInvoker()` | `0x8a6353d1` | -| `NotPromiseResolver()` | `0x86d876b2` | -| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | -| `InsufficientFees()` | `0x8d53e553` | -| `RequestAlreadySettled()` | `0x66fad465` | -| `NoWriteRequest()` | `0x9dcd3065` | -| `AlreadyAssigned()` | `0x9688dc51` | -| `OnlyAppGateway()` | `0xfec944ea` | +| Error | Signature | +|-------|-----------| +| `ZeroAddress()` | `0xd92e233d` | +| `InvalidTransmitter()` | `0x58a70a0a` | +| `InvalidTokenAddress()` | `0x1eb00b06` | +| `InvalidSwitchboard()` | `0xf63c9e4d` | +| `SocketAlreadyInitialized()` | `0xc9500b00` | +| `NotSocket()` | `0xc59f8f7c` | +| `PlugNotFound()` | `0x5f1ac76a` | +| `ResolvingScheduleTooEarly()` | `0x207e8731` | +| `CallFailed()` | `0x3204506f` | +| `InvalidAppGateway()` | `0x82ded261` | +| `AppGatewayAlreadyCalled()` | `0xb224683f` | +| `InvalidCallerTriggered()` | `0x3292d247` | +| `InvalidPromise()` | `0x45f2d176` | +| `InvalidWatcherSignature()` | `0x5029f14f` | +| `NonceUsed()` | `0x1f6d5aef` | +| `AsyncModifierNotSet()` | `0xcae106f9` | +| `WatcherNotSet()` | `0x42d473a7` | +| `InvalidTarget()` | `0x82d5d76a` | +| `InvalidIndex()` | `0x63df8171` | +| `InvalidChainSlug()` | `0xbff6b106` | +| `InvalidPayloadSize()` | `0xfbdf7954` | +| `InvalidOnChainAddress()` | `0xb758c606` | +| `InvalidScheduleDelay()` | `0x9a993219` | +| `AuctionClosed()` | `0x36b6b46d` | +| `AuctionNotOpen()` | `0xf0460077` | +| `BidExceedsMaxFees()` | `0x4c923f3c` | +| `LowerBidAlreadyExists()` | `0xaaa1f709` | +| `RequestCountMismatch()` | `0x98bbcbff` | +| `InvalidAmount()` | `0x2c5211c6` | +| `InsufficientCreditsAvailable()` | `0xe61dc0aa` | +| `InsufficientBalance()` | `0xf4d678b8` | +| `InvalidCaller()` | `0x48f5c3ed` | +| `InvalidGateway()` | `0xfc9dfe85` | +| `RequestAlreadyCancelled()` | `0xc70f47d8` | +| `DeadlineNotPassedForOnChainRevert()` | `0x7006aa10` | +| `InvalidBid()` | `0xc6388ef7` | +| `MaxReAuctionCountReached()` | `0xf2b4388c` | +| `MaxMsgValueLimitExceeded()` | `0x97b4e8ce` | +| `OnlyWatcherAllowed()` | `0xdf7d227c` | +| `InvalidPrecompileData()` | `0x320062c0` | +| `InvalidCallType()` | `0x39d2eb55` | +| `NotRequestHandler()` | `0x8f8cba5b` | +| `NotInvoker()` | `0x8a6353d1` | +| `NotPromiseResolver()` | `0x86d876b2` | +| `RequestPayloadCountLimitExceeded()` | `0xcbef144b` | +| `InsufficientFees()` | `0x8d53e553` | +| `RequestAlreadySettled()` | `0x66fad465` | +| `NoWriteRequest()` | `0x9dcd3065` | +| `AlreadyAssigned()` | `0x9688dc51` | +| `OnlyAppGateway()` | `0xfec944ea` | | `NewMaxFeesLowerThanCurrent(uint256,uint256)` | `0x1345dda1` | -| `InvalidContract()` | `0x6eefed20` | -| `InvalidData()` | `0x5cb045db` | -| `InvalidSignature()` | `0x8baa579f` | -| `DeadlinePassed()` | `0x70f65caa` | +| `InvalidContract()` | `0x6eefed20` | +| `InvalidData()` | `0x5cb045db` | +| `InvalidSignature()` | `0x8baa579f` | +| `DeadlinePassed()` | `0x70f65caa` | diff --git a/EventTopics.md b/EventTopics.md index c860edeb..97781ebe 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -221,6 +221,8 @@ | Event | Arguments | Topic | | ----- | --------- | ----- | +| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | +| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | | `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | | `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | diff --git a/FunctionSignatures.md b/FunctionSignatures.md index 6663b725..7e29232c 100644 --- a/FunctionSignatures.md +++ b/FunctionSignatures.md @@ -2,300 +2,300 @@ ## AuctionManager -| Function | Signature | -| ---------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `auctionEndDelaySeconds` | `0x9087dfdb` | -| `auctionManager` | `0xb0192f9a` | -| `auctionStatus` | `0xd7d5fbf6` | -| `bid` | `0xfcdf49c2` | -| `bidTimeout` | `0x94090d0b` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `consumeFrom` | `0x40dd78be` | -| `creationCodeWithArgs` | `0xc126dcc4` | -| `deployForwarder__` | `0xd4e3b034` | -| `endAuction` | `0x1212e653` | -| `evmxSlug` | `0x8bae77c2` | -| `expireBid` | `0x1dd5022c` | -| `feesManager__` | `0x70568b58` | -| `forwarderAddresses` | `0x5390fdcb` | -| `getOnChainAddress` | `0xb6abffd7` | -| `getOverrideParams` | `0x54f0a866` | -| `grantRole` | `0x2f2ff15d` | -| `handleRevert` | `0x44792f25` | -| `hasRole` | `0x91d14854` | -| `initialize` | `0x86891c9b` | -| `initializeOnChain` | `0x86f01739` | -| `isAsyncModifierSet` | `0xb69e0c4a` | -| `isValidPromise` | `0xb690b962` | -| `maxFees` | `0xe83e34b1` | -| `maxReAuctionCount` | `0xc367b376` | -| `onCompleteData` | `0xb52fa926` | -| `onRequestComplete` | `0x5ed1f959` | -| `overrideParams` | `0xec5490fe` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `auctionEndDelaySeconds` | `0x9087dfdb` | +| `auctionManager` | `0xb0192f9a` | +| `auctionStatus` | `0xd7d5fbf6` | +| `bid` | `0xfcdf49c2` | +| `bidTimeout` | `0x94090d0b` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `consumeFrom` | `0x40dd78be` | +| `creationCodeWithArgs` | `0xc126dcc4` | +| `deployForwarder__` | `0xd4e3b034` | +| `endAuction` | `0x1212e653` | +| `evmxSlug` | `0x8bae77c2` | +| `expireBid` | `0x1dd5022c` | +| `feesManager__` | `0x70568b58` | +| `forwarderAddresses` | `0x5390fdcb` | +| `getOnChainAddress` | `0xb6abffd7` | +| `getOverrideParams` | `0x54f0a866` | +| `grantRole` | `0x2f2ff15d` | +| `handleRevert` | `0x44792f25` | +| `hasRole` | `0x91d14854` | +| `initialize` | `0x86891c9b` | +| `initializeOnChain` | `0x86f01739` | +| `isAsyncModifierSet` | `0xb69e0c4a` | +| `isValidPromise` | `0xb690b962` | +| `maxFees` | `0xe83e34b1` | +| `maxReAuctionCount` | `0xc367b376` | +| `onCompleteData` | `0xb52fa926` | +| `onRequestComplete` | `0x5ed1f959` | +| `overrideParams` | `0xec5490fe` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `reAuctionCount` | `0x9b4b22d3` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `sbType` | `0x745de344` | -| `setAddress` | `0x85bf312c` | -| `setAuctionEndDelaySeconds` | `0x88606b1a` | -| `setMaxReAuctionCount` | `0x64c71403` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | -| `winningBids` | `0x9133f232` | +| `reAuctionCount` | `0x9b4b22d3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `sbType` | `0x745de344` | +| `setAddress` | `0x85bf312c` | +| `setAuctionEndDelaySeconds` | `0x88606b1a` | +| `setMaxReAuctionCount` | `0x64c71403` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | +| `winningBids` | `0x9133f232` | ## Socket -| Function | Signature | -| ---------------------------- | ------------ | -| `OFF_CHAIN_CALLER` | `0xcb2cb4f6` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `connect` | `0xb3bde1aa` | -| `disableSwitchboard` | `0xc4d9a820` | -| `enableSwitchboard` | `0xf97a498a` | -| `execute` | `0xafa8b480` | -| `getPlugConfig` | `0xf9778ee0` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isValidSwitchboard` | `0xb2d67675` | -| `maxCopyBytes` | `0x212249d4` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `OFF_CHAIN_CALLER` | `0xcb2cb4f6` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `connect` | `0xb3bde1aa` | +| `disableSwitchboard` | `0xc4d9a820` | +| `enableSwitchboard` | `0xf97a498a` | +| `execute` | `0xafa8b480` | +| `getPlugConfig` | `0xf9778ee0` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isValidSwitchboard` | `0xb2d67675` | +| `maxCopyBytes` | `0x212249d4` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadExecuted` | `0x3eaeac3d` | -| `payloadIdToDigest` | `0x7c8552b2` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setMaxCopyBytes` | `0x4fc7d6e9` | -| `setSocketFeeManager` | `0x25bd97e5` | -| `simulate` | `0x91bf8275` | -| `socketFeeManager` | `0xde5b8838` | -| `transferOwnership` | `0xf2fde38b` | -| `triggerCounter` | `0x8b0021de` | -| `version` | `0x54fd4d50` | +| `payloadExecuted` | `0x3eaeac3d` | +| `payloadIdToDigest` | `0x7c8552b2` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setMaxCopyBytes` | `0x4fc7d6e9` | +| `setSocketFeeManager` | `0x25bd97e5` | +| `simulate` | `0x91bf8275` | +| `socketFeeManager` | `0xde5b8838` | +| `transferOwnership` | `0xf2fde38b` | +| `triggerCounter` | `0x8b0021de` | +| `version` | `0x54fd4d50` | ## SocketBatcher -| Function | Signature | -| ---------------------------- | ------------ | -| `attestAndExecute` | `0x66c7748a` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `attestAndExecute` | `0x66c7748a` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## SocketFeeManager -| Function | Signature | -| ---------------------------- | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getMinSocketFees` | `0xd383b688` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getMinSocketFees` | `0xd383b688` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payAndCheckFees` | `0xd9d29ae3` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `setSocketFees` | `0x47a406f6` | -| `socketFees` | `0xab1b33a8` | -| `transferOwnership` | `0xf2fde38b` | +| `payAndCheckFees` | `0xd9d29ae3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `setSocketFees` | `0x47a406f6` | +| `socketFees` | `0xab1b33a8` | +| `transferOwnership` | `0xf2fde38b` | ## FeesManager -| Function | Signature | -| -------------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `approveAppGateway` | `0xa3b53d8b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `approveAppGateway` | `0xa3b53d8b` | | `approveAppGatewayWithSignature` | `0x94b649ec` | -| `approveAppGateways` | `0x86d23ab2` | -| `asyncDeployer__` | `0x2a39e801` | -| `blockCredits` | `0x9e434307` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployForwarder__` | `0xd4e3b034` | -| `deposit` | `0x5671d329` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `feesPlugs` | `0x23f5ee8a` | -| `feesPool` | `0x6b259690` | -| `getAvailableCredits` | `0xb065a8e5` | -| `handleRevert` | `0x44792f25` | -| `initialize` | `0xbf2c8539` | -| `isApproved` | `0xa389783e` | -| `isCreditSpendable` | `0x4f8990fd` | -| `isNonceUsed` | `0xcab7e8eb` | -| `onRequestComplete` | `0x5ed1f959` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestBlockedCredits` | `0xb62d25ac` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `sbType` | `0x745de344` | -| `setFeesPlug` | `0xd6a9a8b7` | -| `setFeesPool` | `0xd6684588` | -| `tokenOnChainBalances` | `0x3b27866d` | -| `transferCredits` | `0xf1686c89` | -| `transferOwnership` | `0xf2fde38b` | -| `unblockAndAssignCredits` | `0x01958181` | -| `unblockCredits` | `0xa0b32314` | -| `unwrap` | `0x7647691d` | -| `userCredits` | `0x20babb92` | -| `watcher__` | `0x300bb063` | -| `withdrawCredits` | `0xcfc6dbd9` | -| `wrap` | `0x023276f0` | +| `approveAppGateways` | `0x86d23ab2` | +| `asyncDeployer__` | `0x2a39e801` | +| `blockCredits` | `0x9e434307` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployForwarder__` | `0xd4e3b034` | +| `deposit` | `0x5671d329` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `feesPlugs` | `0x23f5ee8a` | +| `feesPool` | `0x6b259690` | +| `getAvailableCredits` | `0xb065a8e5` | +| `handleRevert` | `0x44792f25` | +| `initialize` | `0xbf2c8539` | +| `isApproved` | `0xa389783e` | +| `isCreditSpendable` | `0x4f8990fd` | +| `isNonceUsed` | `0xcab7e8eb` | +| `onRequestComplete` | `0x5ed1f959` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestBlockedCredits` | `0xb62d25ac` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `sbType` | `0x745de344` | +| `setFeesPlug` | `0xd6a9a8b7` | +| `setFeesPool` | `0xd6684588` | +| `tokenOnChainBalances` | `0x3b27866d` | +| `transferCredits` | `0xf1686c89` | +| `transferOwnership` | `0xf2fde38b` | +| `unblockAndAssignCredits` | `0x01958181` | +| `unblockCredits` | `0xa0b32314` | +| `unwrap` | `0x7647691d` | +| `userCredits` | `0x20babb92` | +| `watcher__` | `0x300bb063` | +| `withdrawCredits` | `0xcfc6dbd9` | +| `wrap` | `0x023276f0` | ## FeesPool -| Function | Signature | -| ---------------------------- | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getBalance` | `0x12065fe0` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getBalance` | `0x12065fe0` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `revokeRole` | `0xd547741f` | -| `transferOwnership` | `0xf2fde38b` | -| `withdraw` | `0xf3fef3a3` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `revokeRole` | `0xd547741f` | +| `transferOwnership` | `0xf2fde38b` | +| `withdraw` | `0xf3fef3a3` | ## AddressResolver -| Function | Signature | -| ---------------------------- | ------------ | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `contractAddresses` | `0xf689e892` | -| `defaultAuctionManager` | `0x8f27cdc6` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0xc4d66de8` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `contractAddresses` | `0xf689e892` | +| `defaultAuctionManager` | `0x8f27cdc6` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0xc4d66de8` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setAsyncDeployer` | `0xcb0ffff8` | -| `setContractAddress` | `0xe001f841` | -| `setDefaultAuctionManager` | `0xede8b4b5` | -| `setDeployForwarder` | `0xaeaee8a6` | -| `setFeesManager` | `0x1c89382a` | -| `setWatcher` | `0x24f48bc5` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setAsyncDeployer` | `0xcb0ffff8` | +| `setContractAddress` | `0xe001f841` | +| `setDefaultAuctionManager` | `0xede8b4b5` | +| `setDeployForwarder` | `0xaeaee8a6` | +| `setFeesManager` | `0x1c89382a` | +| `setWatcher` | `0x24f48bc5` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncDeployer -| Function | Signature | -| ------------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `asyncPromiseBeacon` | `0xc0fbc0ef` | -| `asyncPromiseCounter` | `0x97cdbf4c` | -| `asyncPromiseImplementation` | `0x59531b8d` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployAsyncPromiseContract` | `0x9851be0b` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `forwarderBeacon` | `0x945709ae` | -| `forwarderImplementation` | `0xe38d60a1` | -| `getAsyncPromiseAddress` | `0x104f39b4` | -| `getForwarderAddress` | `0x9c038b01` | -| `getOrDeployForwarderContract` | `0xe9bf1edf` | -| `initialize` | `0x485cc955` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `asyncPromiseBeacon` | `0xc0fbc0ef` | +| `asyncPromiseCounter` | `0x97cdbf4c` | +| `asyncPromiseImplementation` | `0x59531b8d` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployAsyncPromiseContract` | `0x9851be0b` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `forwarderBeacon` | `0x945709ae` | +| `forwarderImplementation` | `0xe38d60a1` | +| `getAsyncPromiseAddress` | `0x104f39b4` | +| `getForwarderAddress` | `0x9c038b01` | +| `getOrDeployForwarderContract` | `0xe9bf1edf` | +| `initialize` | `0x485cc955` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | | `setAsyncPromiseImplementation` | `0xeb506eab` | -| `setForwarderImplementation` | `0x83b1e974` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `setForwarderImplementation` | `0x83b1e974` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## AsyncPromise -| Function | Signature | -| ------------------- | ------------ | +| Function | Signature | +| -------- | --------- | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `callbackData` | `0xef44c272` | -| `callbackSelector` | `0x2764f92f` | +| `asyncDeployer__` | `0x2a39e801` | +| `callbackData` | `0xef44c272` | +| `callbackSelector` | `0x2764f92f` | | `deployForwarder__` | `0xd4e3b034` | -| `exceededMaxCopy` | `0xaf598c7c` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x0ece6089` | -| `localInvoker` | `0x45eb87f4` | +| `exceededMaxCopy` | `0xaf598c7c` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x0ece6089` | +| `localInvoker` | `0x45eb87f4` | | `markOnchainRevert` | `0xd0e7af1b` | -| `markResolved` | `0x822d5d1f` | -| `requestCount` | `0x5badbe4c` | -| `rescueFunds` | `0x6ccae054` | -| `returnData` | `0xebddbaf6` | -| `state` | `0xc19d93fb` | -| `then` | `0x0bf2ba15` | -| `watcher__` | `0x300bb063` | +| `markResolved` | `0x822d5d1f` | +| `requestCount` | `0x5badbe4c` | +| `rescueFunds` | `0x6ccae054` | +| `returnData` | `0xebddbaf6` | +| `state` | `0xc19d93fb` | +| `then` | `0x0bf2ba15` | +| `watcher__` | `0x300bb063` | ## DeployForwarder -| Function | Signature | -| ---------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deploy` | `0x940f11af` | -| `deployForwarder__` | `0xd4e3b034` | -| `deployerSwitchboardType` | `0xaa381f9a` | -| `feesManager__` | `0x70568b58` | -| `initialize` | `0x6133f985` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deploy` | `0x940f11af` | +| `deployForwarder__` | `0xd4e3b034` | +| `deployerSwitchboardType` | `0xaa381f9a` | +| `feesManager__` | `0x70568b58` | +| `initialize` | `0x6133f985` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `saltCounter` | `0xa04c6809` | -| `transferOwnership` | `0xf2fde38b` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `saltCounter` | `0xa04c6809` | +| `transferOwnership` | `0xf2fde38b` | +| `watcher__` | `0x300bb063` | ## Forwarder -| Function | Signature | -| ------------------- | ------------ | +| Function | Signature | +| -------- | --------- | | `addressResolver__` | `0x6a750469` | -| `asyncDeployer__` | `0x2a39e801` | -| `chainSlug` | `0xb349ba65` | +| `asyncDeployer__` | `0x2a39e801` | +| `chainSlug` | `0xb349ba65` | | `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getChainSlug` | `0x0b8c6568` | +| `feesManager__` | `0x70568b58` | +| `getChainSlug` | `0x0b8c6568` | | `getOnChainAddress` | `0x9da48789` | -| `initialize` | `0x148841cb` | -| `onChainAddress` | `0x8bd0b363` | -| `rescueFunds` | `0x6ccae054` | -| `watcher__` | `0x300bb063` | +| `initialize` | `0x148841cb` | +| `onChainAddress` | `0x8bd0b363` | +| `rescueFunds` | `0x6ccae054` | +| `watcher__` | `0x300bb063` | ## ForwarderSolana @@ -315,263 +315,264 @@ ## ProxyFactory -| Function | Signature | -| ----------------------------- | ------------ | -| `adminOf` | `0x2abbef15` | -| `changeAdmin` | `0x1acfd02a` | -| `deploy` | `0x545e7c61` | -| `deployAndCall` | `0x4314f120` | -| `deployDeterministic` | `0x3729f922` | -| `deployDeterministicAndCall` | `0xa97b90d5` | -| `initCodeHash` | `0xdb4c545e` | +| Function | Signature | +| -------- | --------- | +| `adminOf` | `0x2abbef15` | +| `changeAdmin` | `0x1acfd02a` | +| `deploy` | `0x545e7c61` | +| `deployAndCall` | `0x4314f120` | +| `deployDeterministic` | `0x3729f922` | +| `deployDeterministicAndCall` | `0xa97b90d5` | +| `initCodeHash` | `0xdb4c545e` | | `predictDeterministicAddress` | `0x5414dff0` | -| `upgrade` | `0x99a88ec4` | -| `upgradeAndCall` | `0x9623609d` | +| `upgrade` | `0x99a88ec4` | +| `upgradeAndCall` | `0x9623609d` | ## TestUSDC -| Function | Signature | -| ------------------ | ------------ | +| Function | Signature | +| -------- | --------- | | `DOMAIN_SEPARATOR` | `0x3644e515` | -| `allowance` | `0xdd62ed3e` | -| `approve` | `0x095ea7b3` | -| `balanceOf` | `0x70a08231` | -| `decimals` | `0x313ce567` | -| `mint` | `0x40c10f19` | -| `name` | `0x06fdde03` | -| `nonces` | `0x7ecebe00` | -| `owner` | `0x8da5cb5b` | -| `permit` | `0xd505accf` | -| `symbol` | `0x95d89b41` | -| `totalSupply` | `0x18160ddd` | -| `transfer` | `0xa9059cbb` | -| `transferFrom` | `0x23b872dd` | +| `allowance` | `0xdd62ed3e` | +| `approve` | `0x095ea7b3` | +| `balanceOf` | `0x70a08231` | +| `decimals` | `0x313ce567` | +| `mint` | `0x40c10f19` | +| `name` | `0x06fdde03` | +| `nonces` | `0x7ecebe00` | +| `owner` | `0x8da5cb5b` | +| `permit` | `0xd505accf` | +| `symbol` | `0x95d89b41` | +| `totalSupply` | `0x18160ddd` | +| `transfer` | `0xa9059cbb` | +| `transferFrom` | `0x23b872dd` | ## ContractFactoryPlug -| Function | Signature | -| ---------------------------- | ------------ | -| `appGatewayId` | `0x1c335f49` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `connectSocket` | `0x258d19c8` | -| `deployContract` | `0xa0695389` | -| `getAddress` | `0x94ca2cb5` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `initSocket` | `0xa07d8545` | -| `isSocketInitialized` | `0x9a7d9a9b` | -| `overrides` | `0x4a85f041` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `appGatewayId` | `0x1c335f49` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `connectSocket` | `0x258d19c8` | +| `deployContract` | `0xa0695389` | +| `getAddress` | `0x94ca2cb5` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `initSocket` | `0xa07d8545` | +| `isSocketInitialized` | `0x9a7d9a9b` | +| `overrides` | `0x4a85f041` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## Configurations -| Function | Signature | -| ---------------------------- | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `getPlugConfigs` | `0x25945c1a` | -| `initialize` | `0x485cc955` | -| `isValidPlug` | `0x00f9b9f4` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `getPlugConfigs` | `0x25945c1a` | +| `initialize` | `0x485cc955` | +| `isValidPlug` | `0x00f9b9f4` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setAppGatewayConfigs` | `0xebfb22cd` | -| `setIsValidPlug` | `0x4842c37a` | -| `setSocket` | `0x38d4de67` | -| `setSwitchboard` | `0x491eac1f` | -| `sockets` | `0xb44a23ab` | -| `switchboards` | `0xaa539546` | -| `transferOwnership` | `0xf2fde38b` | -| `verifyConnections` | `0x36cb19fb` | -| `watcher__` | `0x300bb063` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setAppGatewayConfigs` | `0xebfb22cd` | +| `setIsValidPlug` | `0x4842c37a` | +| `setSocket` | `0x38d4de67` | +| `setSwitchboard` | `0x491eac1f` | +| `sockets` | `0xb44a23ab` | +| `switchboards` | `0xaa539546` | +| `transferOwnership` | `0xf2fde38b` | +| `verifyConnections` | `0x36cb19fb` | +| `watcher__` | `0x300bb063` | ## PromiseResolver -| Function | Signature | -| ----------------- | ------------ | -| `markRevert` | `0x56501015` | -| `rescueFunds` | `0x6ccae054` | +| Function | Signature | +| -------- | --------- | +| `markRevert` | `0x56501015` | +| `rescueFunds` | `0x6ccae054` | | `resolvePromises` | `0xbf8484b8` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## RequestHandler -| Function | Signature | -| ------------------------------ | ------------ | -| `addressResolver__` | `0x6a750469` | -| `assignTransmitter` | `0xae5e9c48` | -| `asyncDeployer__` | `0x2a39e801` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x3b5fd6fb` | -| `cancelRequestForReverts` | `0x82970278` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `deployForwarder__` | `0xd4e3b034` | -| `feesManager__` | `0x70568b58` | -| `getBatchPayloadIds` | `0xfd83cd1f` | -| `getPayload` | `0xb48fd0fe` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequest` | `0xcf39abf6` | -| `getRequestBatchIds` | `0xe138fadb` | -| `handleRevert` | `0xcc88d3f9` | -| `increaseFees` | `0x10205541` | -| `initialize` | `0x485cc955` | -| `nextBatchCount` | `0x333a3963` | -| `nextRequestCount` | `0xfef72893` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadCounter` | `0x550ce1d5` | -| `precompiles` | `0x9932450b` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `setPrecompile` | `0x122e0042` | -| `setRequestPayloadCountLimit` | `0x8526582b` | -| `submitRequest` | `0xf91ba7cc` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `assignTransmitter` | `0xae5e9c48` | +| `asyncDeployer__` | `0x2a39e801` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x3b5fd6fb` | +| `cancelRequestForReverts` | `0x82970278` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `deployForwarder__` | `0xd4e3b034` | +| `feesManager__` | `0x70568b58` | +| `getBatchPayloadIds` | `0xfd83cd1f` | +| `getPayload` | `0xb48fd0fe` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequest` | `0xcf39abf6` | +| `getRequestBatchIds` | `0xe138fadb` | +| `handleRevert` | `0xcc88d3f9` | +| `increaseFees` | `0x10205541` | +| `initialize` | `0x485cc955` | +| `nextBatchCount` | `0x333a3963` | +| `nextRequestCount` | `0xfef72893` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `payloadCounter` | `0x550ce1d5` | +| `precompiles` | `0x9932450b` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `setPrecompile` | `0x122e0042` | +| `setRequestPayloadCountLimit` | `0x8526582b` | +| `submitRequest` | `0xf91ba7cc` | +| `transferOwnership` | `0xf2fde38b` | | `updateRequestAndProcessBatch` | `0x46464471` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## Watcher -| Function | Signature | -| ---------------------------- | ------------ | -| `addressResolver__` | `0x6a750469` | -| `appGatewayTemp` | `0x1394c029` | -| `asyncDeployer__` | `0x2a39e801` | -| `callAppGateways` | `0x0050bef1` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `cancelRequest` | `0x50ad0779` | -| `clearQueue` | `0xf22cb874` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `configurations__` | `0x52a3bbeb` | -| `deployForwarder__` | `0xd4e3b034` | -| `evmxSlug` | `0x8bae77c2` | -| `feesManager__` | `0x70568b58` | -| `getCurrentRequestCount` | `0x5715abbb` | -| `getPayloadParams` | `0xae5eeb77` | -| `getPrecompileFees` | `0xabac263c` | -| `getRequestParams` | `0x71263d0d` | -| `increaseFees` | `0xe9b304da` | -| `initialize` | `0xaaf7fc1a` | -| `isAppGatewayCalled` | `0xa79da6c7` | -| `isNonceUsed` | `0x5d00bb12` | -| `isWatcher` | `0x84785ecd` | -| `latestAsyncPromise` | `0xb8a8ba52` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `addressResolver__` | `0x6a750469` | +| `appGatewayTemp` | `0x1394c029` | +| `asyncDeployer__` | `0x2a39e801` | +| `callAppGateways` | `0x0050bef1` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `cancelRequest` | `0x50ad0779` | +| `clearQueue` | `0xf22cb874` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `configurations__` | `0x52a3bbeb` | +| `deployForwarder__` | `0xd4e3b034` | +| `evmxSlug` | `0x8bae77c2` | +| `feesManager__` | `0x70568b58` | +| `getCurrentRequestCount` | `0x5715abbb` | +| `getPayloadParams` | `0xae5eeb77` | +| `getPrecompileFees` | `0xabac263c` | +| `getRequestParams` | `0x71263d0d` | +| `increaseFees` | `0xe9b304da` | +| `initialize` | `0xaaf7fc1a` | +| `isAppGatewayCalled` | `0xa79da6c7` | +| `isNonceUsed` | `0x5d00bb12` | +| `isWatcher` | `0x84785ecd` | +| `latestAsyncPromise` | `0xb8a8ba52` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `payloadQueue` | `0x74f00ffb` | -| `promiseResolver__` | `0xdee152be` | -| `queue` | `0x65967f1a` | -| `queueAndSubmit` | `0x9d4c9df7` | -| `renounceOwnership` | `0x715018a6` | -| `requestHandler__` | `0x55184561` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0xa58c6fc5` | -| `setCoreContracts` | `0xefa891c4` | -| `setIsValidPlug` | `0x06c0a40a` | -| `setTriggerFees` | `0xaeb30511` | -| `submitRequest` | `0x4890b5ef` | -| `transferOwnership` | `0xf2fde38b` | -| `triggerFees` | `0x73f76aec` | -| `triggerFromChainSlug` | `0xd12b4f12` | -| `triggerFromPlug` | `0x3b847d12` | -| `watcherMultiCall` | `0x8021e82b` | -| `watcher__` | `0x300bb063` | +| `payloadQueue` | `0x74f00ffb` | +| `promiseResolver__` | `0xdee152be` | +| `queue` | `0x65967f1a` | +| `queueAndSubmit` | `0x9d4c9df7` | +| `renounceOwnership` | `0x715018a6` | +| `requestHandler__` | `0x55184561` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0xa58c6fc5` | +| `setCoreContracts` | `0xefa891c4` | +| `setIsValidPlug` | `0x06c0a40a` | +| `setTriggerFees` | `0xaeb30511` | +| `submitRequest` | `0x4890b5ef` | +| `transferOwnership` | `0xf2fde38b` | +| `triggerFees` | `0x73f76aec` | +| `triggerFromChainSlug` | `0xd12b4f12` | +| `triggerFromPlug` | `0x3b847d12` | +| `watcherMultiCall` | `0x8021e82b` | +| `watcher__` | `0x300bb063` | ## FastSwitchboard -| Function | Signature | -| ---------------------------- | ------------ | -| `allowPayload` | `0x31c23f66` | -| `attest` | `0x63671b60` | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainSlug` | `0xb349ba65` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `grantRole` | `0x2f2ff15d` | -| `hasRole` | `0x91d14854` | -| `isAttested` | `0xc13c2396` | -| `owner` | `0x8da5cb5b` | +| Function | Signature | +| -------- | --------- | +| `allowPayload` | `0x31c23f66` | +| `attest` | `0x63671b60` | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainSlug` | `0xb349ba65` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `grantRole` | `0x2f2ff15d` | +| `hasRole` | `0x91d14854` | +| `isAttested` | `0xc13c2396` | +| `owner` | `0x8da5cb5b` | | `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `registerSwitchboard` | `0x74f5b1fc` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `revokeRole` | `0xd547741f` | -| `socket__` | `0xc6a261d2` | -| `transferOwnership` | `0xf2fde38b` | +| `registerSwitchboard` | `0x74f5b1fc` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `revokeRole` | `0xd547741f` | +| `socket__` | `0xc6a261d2` | +| `transferOwnership` | `0xf2fde38b` | ## ReadPrecompile -| Function | Signature | -| ------------------------------ | ------------ | -| `expiryTime` | `0x99bc0aea` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x1d5e1d98` | -| `readFees` | `0xe06357a2` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0xea92e825` | -| `setExpiryTime` | `0x30fc4cff` | -| `setFees` | `0x3d18678e` | +| Function | Signature | +| -------- | --------- | +| `expiryTime` | `0x99bc0aea` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `handlePayload` | `0x1d5e1d98` | +| `readFees` | `0xe06357a2` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0xea92e825` | +| `setExpiryTime` | `0x30fc4cff` | +| `setFees` | `0x3d18678e` | | `validateAndGetPrecompileData` | `0x997f5bef` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## SchedulePrecompile -| Function | Signature | -| ------------------------------ | ------------ | -| `expiryTime` | `0x99bc0aea` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `handlePayload` | `0x1d5e1d98` | -| `maxScheduleDelayInSeconds` | `0x3ef01cdb` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0xea92e825` | -| `scheduleCallbackFees` | `0x4c5b6007` | -| `scheduleFeesPerSecond` | `0x852a74c1` | -| `setExpiryTime` | `0x30fc4cff` | +| Function | Signature | +| -------- | --------- | +| `expiryTime` | `0x99bc0aea` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `handlePayload` | `0x1d5e1d98` | +| `maxScheduleDelayInSeconds` | `0x3ef01cdb` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0xea92e825` | +| `scheduleCallbackFees` | `0x4c5b6007` | +| `scheduleFeesPerSecond` | `0x852a74c1` | +| `setExpiryTime` | `0x30fc4cff` | | `setMaxScheduleDelayInSeconds` | `0x12953318` | -| `setScheduleCallbackFees` | `0xec8fd71e` | -| `setScheduleFeesPerSecond` | `0x28e59e57` | +| `setScheduleCallbackFees` | `0xec8fd71e` | +| `setScheduleFeesPerSecond` | `0x28e59e57` | | `validateAndGetPrecompileData` | `0x997f5bef` | -| `watcher__` | `0x300bb063` | +| `watcher__` | `0x300bb063` | ## WritePrecompile -| Function | Signature | -| ------------------------------ | ------------ | -| `cancelOwnershipHandover` | `0x54d1f13d` | -| `chainMaxMsgValueLimit` | `0x01d1e126` | -| `completeOwnershipHandover` | `0xf04e283e` | -| `contractFactoryPlugs` | `0x35426631` | -| `digestHashes` | `0xd1a862bf` | -| `expiryTime` | `0x99bc0aea` | -| `getDigest` | `0x91b6288b` | -| `getPrecompileFees` | `0xb7a3d04c` | -| `getPrevBatchDigestHash` | `0x372863a1` | -| `handlePayload` | `0x1d5e1d98` | -| `initialize` | `0xeb990c59` | -| `owner` | `0x8da5cb5b` | -| `ownershipHandoverExpiresAt` | `0xfee81cf4` | -| `renounceOwnership` | `0x715018a6` | -| `requestOwnershipHandover` | `0x25692962` | -| `rescueFunds` | `0x6ccae054` | -| `resolvePayload` | `0xea92e825` | -| `setContractFactoryPlugs` | `0x8b198f5c` | -| `setExpiryTime` | `0x30fc4cff` | -| `setFees` | `0x3d18678e` | -| `transferOwnership` | `0xf2fde38b` | +| Function | Signature | +| -------- | --------- | +| `cancelOwnershipHandover` | `0x54d1f13d` | +| `chainMaxMsgValueLimit` | `0x01d1e126` | +| `completeOwnershipHandover` | `0xf04e283e` | +| `contractFactoryPlugs` | `0x35426631` | +| `digestHashes` | `0xd1a862bf` | +| `expiryTime` | `0x99bc0aea` | +| `getDigest` | `0x91b6288b` | +| `getPrecompileFees` | `0xb7a3d04c` | +| `getPrevBatchDigestHash` | `0x372863a1` | +| `handlePayload` | `0x1d5e1d98` | +| `initialize` | `0xeb990c59` | +| `owner` | `0x8da5cb5b` | +| `ownershipHandoverExpiresAt` | `0xfee81cf4` | +| `renounceOwnership` | `0x715018a6` | +| `requestOwnershipHandover` | `0x25692962` | +| `rescueFunds` | `0x6ccae054` | +| `resolvePayload` | `0xea92e825` | +| `setContractFactoryPlugs` | `0x8b198f5c` | +| `setExpiryTime` | `0x30fc4cff` | +| `setFees` | `0x3d18678e` | +| `transferOwnership` | `0xf2fde38b` | | `updateChainMaxMsgValueLimits` | `0x6a7aa6ac` | -| `uploadProof` | `0x81b48fcf` | +| `uploadProof` | `0x81b48fcf` | | `validateAndGetPrecompileData` | `0x997f5bef` | -| `watcherProofs` | `0x3fa3166b` | -| `watcher__` | `0x300bb063` | -| `writeFees` | `0x5c664aeb` | +| `watcherProofs` | `0x3fa3166b` | +| `watcher__` | `0x300bb063` | +| `writeFees` | `0x5c664aeb` | + diff --git a/contracts/protocol/SocketConfig.sol b/contracts/protocol/SocketConfig.sol index 32bafb17..7b2fa463 100644 --- a/contracts/protocol/SocketConfig.sol +++ b/contracts/protocol/SocketConfig.sol @@ -59,6 +59,12 @@ abstract contract SocketConfig is ISocket, AccessControl { isValidSwitchboard[switchboard_] = SwitchboardStatus.DISABLED; emit SwitchboardDisabled(switchboard_); } +// --- start here + // TODO: ask why enableSwitchboard is only callable by switchboard (as switchboard address is taken from + // msg.sender) also this account must have GOVERNANCE_ROLE role, + // which is not intuitive for switchboard to have this role. + // On the other hand, disableSwitchboard is callable by account with SWITCHBOARD_DISABLER_ROLE role. + // Also registerSwitchboard is only callable by switchboard with no role check. // @notice function to enable a switchboard // @dev only callable by governance role diff --git a/foundry.toml b/foundry.toml index 9b8a496e..72646097 100644 --- a/foundry.toml +++ b/foundry.toml @@ -10,29 +10,29 @@ evm_version = 'paris' via_ir = false [labels] -0xE486D1Da5E250a268b5DA7eBc6AF3503bf8288DC = "AddressResolver" -0xf0CaA8D7b0d7be914D1801Ab2d95B1A75fCd4c01 = "AddressResolverImpl" -0x66d59d0bA711241785F1110C163448071c4Dd4Cc = "AsyncDeployer" -0xFe468C6506c212734A998848Da419E8041f47A64 = "AsyncDeployerImpl" -0xD2E1bF41B54ada70590873BE2409d5AD20341E82 = "AuctionManager" -0xfDDC7488C060Bf56107ca3A47918aEf06B59071d = "AuctionManagerImpl" -0x63cbD05da9bE1e37D3fC3eeB27da601FBbA199d1 = "Configurations" -0x36d42DFE5b2aeF21F7750947cEDc8c950f89fC6A = "ConfigurationsImpl" -0x1746948725fc2E2003511c34BE3509FA112A392E = "DeployForwarder" -0x227d6082Ea2D7Ee52b33F0d83B9411297ABf8ecE = "DeployForwarderImpl" -0xc9B4874dDA3AbB27DF56466DD650dd9B30b48986 = "ERC1967Factory" -0x686Be563fa9797aa7F66dCF73321cbd2F7a98874 = "FeesManager" -0x17F2aC81c4f1bee70D4c8ee9a3cb28E4e096De4f = "FeesManagerImpl" +0xD57689FA7802194Adb2Df677fc01514e9f53A62C = "AddressResolver" +0xAAA7CED4aAc30C9ec66062708E322729941400D0 = "AddressResolverImpl" +0x71C64ECA3817C50BE5BD2ceAb44D9b583ee18D88 = "AsyncDeployer" +0xB9c3482d90cc93491250195F5971D4536e01b17c = "AsyncDeployerImpl" +0xC31b35262A5405Ae629abFE76eeaF49D64665890 = "AuctionManager" +0x5AF2B4685C941808cA798fd48DBb1feCaD40AC54 = "AuctionManagerImpl" +0x762379D7bcAa209aa56A3A68d62B8387Ebf36f58 = "Configurations" +0xB3B4b2a4e057E34462343a22eE1D8B05BEd1B206 = "ConfigurationsImpl" +0x7c7D4C71eFFd0f56a660b37c1B67EaE23BCb8A8c = "DeployForwarder" +0x1Eb1308Fa45F9a8B92BDB4B4Cb902CA74A18Dc3F = "DeployForwarderImpl" +0x011c9beC76F56071271553b4eC8B1d7e101FDe60 = "ERC1967Factory" +0xF942Fc4beE09256D90f6Ec309AB07479F4e9B0A8 = "FeesManager" +0x0Cd5E1be74d86EcD72A8698E3BcF1b5E9E0fC983 = "FeesManagerImpl" 0x9De353dD1131aB4e502590D3a1832652FA316268 = "FeesPool" -0xC570206ACBa112fC8d438235BF8cE31b3548aa96 = "ForwarderSolana" -0x3Fe4DDEd31943B90cB2AdcA39cE1f33Fa4Ab45d8 = "ForwarderSolanaImpl" -0xa0EEEC3D28acF5cF00181130aACf8A63d5F53F94 = "PromiseResolver" -0x78dFD826E6Aef751144987E1E25326De48879869 = "ReadPrecompile" -0xd183b5bf6d77E2D253a1230C2eAE34C18810Fbc3 = "RequestHandler" -0xD05D508704a8984a471E4FCdD57865D36c4A88B7 = "RequestHandlerImpl" -0xD832BFfE0c5e43Ef36dE8a2c50367d3f12DE09B7 = "SchedulePrecompile" -0x2d0fAB18450A7A2885a0130090BfA0B184F0b801 = "Watcher" -0xEEe9A8308b5b2A5814b35D10aeBCDeA760B9117f = "WatcherImpl" -0x1D179869F6079818a1DC852fEbf0890cc6DC558c = "WritePrecompile" -0x9461e4b96d5ceAa749E6Ee535979D1f3A83d5968 = "WritePrecompileImpl" -0xD3A6671C53c57133095b800a10024060a5B6Bf02 = "APP_GATEWAY" +0x9bBb97c66be06458A63D11ff6025Fdad104DA285 = "ForwarderSolana" +0x0811A7dDE3dBe181CEc492086d6A509E7f7a3752 = "ForwarderSolanaImpl" +0x04D0903142D9457fdfd92F971929B8784359De56 = "PromiseResolver" +0x0bcB79686eb404b9938d14d055B5fC9845b68449 = "ReadPrecompile" +0xBcbf0aF70c975F24cC74fdEE0785293F97EA235a = "RequestHandler" +0x43fC7DB472a86c6E720853Bf0dB0126A3fEa2726 = "RequestHandlerImpl" +0xafeDC2E94698C3DaE24dFdFfE77DB1fec1A86C62 = "SchedulePrecompile" +0x72Bc51B1EE2CcD200a82e042071B9F27A2bFDf45 = "Watcher" +0x767Eb57D785e574b9528a3c828F555a96A899310 = "WatcherImpl" +0x8B77Be1dd4bC0C52759902336844A7c440934E84 = "WritePrecompile" +0x4c4953DfDAA93F83d1c47999984C8b50ac5D6d46 = "WritePrecompileImpl" +0xDC81d1BE1E8d92C5a98a15D89A16134D74121FC2 = "APP_GATEWAY" diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index b99d158d..e3554bcc 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -205,7 +205,7 @@ export const whitelistToken = async ( await getInstance(Contracts.FeesPlug, feesPlugAddress) ).connect(signer); - const tokens = getFeeTokens(mode, chain); + const tokens = getFeeTokens(chain); if (tokens.length == 0) return; for (const token of tokens) { diff --git a/script/super-token-solana/DeployEVMSolanaApps.s.sol b/script/super-token-solana/DeployEVMSolanaApps.s.sol index cb080b09..4bfef359 100644 --- a/script/super-token-solana/DeployEVMSolanaApps.s.sol +++ b/script/super-token-solana/DeployEVMSolanaApps.s.sol @@ -23,7 +23,7 @@ contract DeployEVMSolanaApps is Script { // fill with correct values after deployment bytes32 solanaProgramId = vm.envBytes32("SOLANA_TARGET_PROGRAM"); - address forwarderSolanaAddress = 0xC570206ACBa112fC8d438235BF8cE31b3548aa96; + address forwarderSolanaAddress = 0x9bBb97c66be06458A63D11ff6025Fdad104DA285; // Setting fee payment on Arbitrum Sepolia uint256 fees = 10 ether; From d8e6230fce7a0e1651d981c80387323ffbd8496b Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 2 Sep 2025 15:40:17 +0530 Subject: [PATCH 102/139] feat: handle revert on burn --- contracts/evmx/fees/Credit.sol | 32 +++++++++++++++++++++++--------- test/evmx/FeesTest.t.sol | 17 ----------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index dc4af589..6b97c021 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -71,8 +71,13 @@ abstract contract FeesManagerStorage is IFeesManager { /// @dev chainSlug => token address bytes32 public susdcToken; - // slots [59-107] reserved for gap - uint256[49] _gap_after; + // slot 59 + /// @notice Mapping to track request counts for each promise + /// @dev requestCount => (receiver, amount) + mapping(uint40 => bytes) public requestCounts; + + // slots [60-107] reserved for gap + uint256[48] _gap_after; // slots [108-157] 50 slots reserved for address resolver util // 9 slots for app gateway base @@ -139,6 +144,7 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew return allowance(user_, appGateway_) > 0; } + // todo: only allow game gateway to depositd /// @notice Deposits credits and native tokens to a user /// @param depositTo_ The address to deposit the credits to /// @param chainSlug_ The chain slug @@ -215,6 +221,21 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew function burn(uint32 chainSlug_, address receiver_, uint256 amount_) external async { _burn(msg.sender, amount_); ISUSDCPlug(forwarderAddresses[susdcToken][chainSlug_]).mint(receiver_, amount_); + requestCounts[watcher__().getCurrentRequestCount()] = abi.encode(receiver_, amount_); + } + + function handleRevert(bytes32 payloadId_) external override { + if (watcher__().getPayloadParams(payloadId_).asyncPromise != msg.sender) return; + + uint40 requestCount = IPromise(msg.sender).requestCount(); + (address receiver, uint256 amount) = abi.decode( + requestCounts[requestCount], + (address, uint256) + ); + + // re-mint tokens to the receiver + _mint(receiver, amount); + delete requestCounts[requestCount]; } /// @notice Override balanceOf to return available (unblocked) credits @@ -393,13 +414,6 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew signer = ECDSA.recover(digest, signature_); } - /// @notice hook to handle the revert while withdrawing credits - /// @param payloadId_ The payload ID - function handleRevert(bytes32 payloadId_) external override { - if (watcher__().getPayloadParams(payloadId_).asyncPromise != msg.sender) return; - emit WithdrawFailed(payloadId_); - } - // ERC20 metadata function name() public pure override returns (string memory) { return "Socket USDC"; diff --git a/test/evmx/FeesTest.t.sol b/test/evmx/FeesTest.t.sol index 9a2da3d3..e3286bd8 100644 --- a/test/evmx/FeesTest.t.sol +++ b/test/evmx/FeesTest.t.sol @@ -275,23 +275,6 @@ contract FeesTest is AppGatewayBaseSetup { approve(address(feesManager), address(counterGateway)); uint256 receiverBalanceBefore = arbConfig.testUSDC.balanceOf(receiver); - - hoax(address(counterGateway)); - feesManager.withdrawCredits( - arbChainSlug, - address(arbConfig.testUSDC), - withdrawAmount, - feesAmount, - address(receiver) - ); - executeRequest(); - - assertEq( - arbConfig.testUSDC.balanceOf(receiver), - receiverBalanceBefore, - "Receiver balance should be same" - ); - arbConfig.testUSDC.mint(address(arbConfig.feesPlug), withdrawAmount); withdrawCredits(address(counterGateway), withdrawAmount); From 0021e17ef5005dcbf4689b32615757538e13b53f Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 2 Sep 2025 15:48:21 +0530 Subject: [PATCH 103/139] feat: whitelist susdc receivers --- contracts/evmx/fees/Credit.sol | 21 +++++++++++++++++---- contracts/utils/common/Errors.sol | 1 + test/SetupTest.t.sol | 3 +++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 6b97c021..97c3a1ca 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -13,7 +13,7 @@ import "../interfaces/IFeesPool.sol"; import "../interfaces/IReceiver.sol"; import {AddressResolverUtil} from "../helpers/AddressResolverUtil.sol"; -import {NonceUsed, InvalidAmount, InsufficientCreditsAvailable, InsufficientBalance, InvalidChainSlug, NotRequestHandler} from "../../utils/common/Errors.sol"; +import {NonceUsed, InvalidAmount, InsufficientCreditsAvailable, InsufficientBalance, InvalidChainSlug, NotRequestHandler, InvalidReceiver} from "../../utils/common/Errors.sol"; import {WRITE} from "../../utils/common/Constants.sol"; import "../../utils/RescueFundsLib.sol"; import "../base/AppGatewayBase.sol"; @@ -72,12 +72,17 @@ abstract contract FeesManagerStorage is IFeesManager { bytes32 public susdcToken; // slot 59 + /// @notice Mapping to track whitelisted receivers + /// @dev receiver address => bool + mapping(address => bool) public whitelistedReceivers; + + // slot 60 /// @notice Mapping to track request counts for each promise /// @dev requestCount => (receiver, amount) mapping(uint40 => bytes) public requestCounts; - // slots [60-107] reserved for gap - uint256[48] _gap_after; + // slots [61-107] reserved for gap + uint256[47] _gap_after; // slots [108-157] 50 slots reserved for address resolver util // 9 slots for app gateway base @@ -121,6 +126,9 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew /// @notice Emitted when susdc token is set event SusdcTokenSet(uint32 indexed chainSlug, bytes32 indexed susdcToken); + /// @notice Emitted when whitelisted receiver is set + event WhitelistedReceiverSet(address indexed receiver, bool isWhitelisted); + function setFeesPlug(uint32 chainSlug_, bytes32 feesPlug_) external onlyOwner { feesPlugs[chainSlug_] = feesPlug_; emit FeesPlugSet(chainSlug_, feesPlug_); @@ -140,11 +148,15 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew emit SusdcTokenSet(chainSlug_, susdcToken_); } + function setWhitelistedReceiver(address receiver_, bool isWhitelisted_) external onlyOwner { + whitelistedReceivers[receiver_] = isWhitelisted_; + emit WhitelistedReceiverSet(receiver_, isWhitelisted_); + } + function isApproved(address user_, address appGateway_) public view returns (bool) { return allowance(user_, appGateway_) > 0; } - // todo: only allow game gateway to depositd /// @notice Deposits credits and native tokens to a user /// @param depositTo_ The address to deposit the credits to /// @param chainSlug_ The chain slug @@ -159,6 +171,7 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew uint256 creditAmount_, bytes memory data_ ) external override onlyWatcher { + if (!whitelistedReceivers[depositTo_]) revert InvalidReceiver(); tokenOnChainBalances[chainSlug_][token_] += creditAmount_ + nativeAmount_; // Mint tokens to the user diff --git a/contracts/utils/common/Errors.sol b/contracts/utils/common/Errors.sol index 60e0778c..b4fd13fb 100644 --- a/contracts/utils/common/Errors.sol +++ b/contracts/utils/common/Errors.sol @@ -77,3 +77,4 @@ error DeadlinePassed(); // Only Watcher can call functions error OnlyRequestHandlerAllowed(); error OnlyPromiseResolverAllowed(); +error InvalidReceiver(); \ No newline at end of file diff --git a/test/SetupTest.t.sol b/test/SetupTest.t.sol index 83464bba..6852d132 100644 --- a/test/SetupTest.t.sol +++ b/test/SetupTest.t.sol @@ -634,6 +634,9 @@ contract FeesSetup is DeploySetup { // uint256 currentCredits = feesManager.balanceOf(user_); // uint256 currentNative = address(user_).balance; + hoax(watcherEOA); + feesManager.setWhitelistedReceiver(receiver_, true); + vm.expectEmit(true, true, true, false); emit Deposited(chainSlug_, address(token), receiver_, credits_, native_); From 10d84ecec3b5337050501928058e5b9fc2047c6e Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Tue, 2 Sep 2025 18:27:35 +0530 Subject: [PATCH 104/139] fix: remove burn revert handler --- contracts/evmx/fees/Credit.sol | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 97c3a1ca..4f89e493 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -76,13 +76,8 @@ abstract contract FeesManagerStorage is IFeesManager { /// @dev receiver address => bool mapping(address => bool) public whitelistedReceivers; - // slot 60 - /// @notice Mapping to track request counts for each promise - /// @dev requestCount => (receiver, amount) - mapping(uint40 => bytes) public requestCounts; - - // slots [61-107] reserved for gap - uint256[47] _gap_after; + // slots [60-107] reserved for gap + uint256[48] _gap_after; // slots [108-157] 50 slots reserved for address resolver util // 9 slots for app gateway base @@ -225,6 +220,10 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew } function mint(address to, uint256 amount, bytes memory data_) external onlyWatcher { + _mintWithData(to, amount, data_); + } + + function _mintWithData(address to, uint256 amount, bytes memory data_) internal { _mint(to, amount); if (data_.length > 0) { IReceiver(to).onTransfer(evmxSlug, address(this), amount, 0, data_); @@ -234,21 +233,6 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew function burn(uint32 chainSlug_, address receiver_, uint256 amount_) external async { _burn(msg.sender, amount_); ISUSDCPlug(forwarderAddresses[susdcToken][chainSlug_]).mint(receiver_, amount_); - requestCounts[watcher__().getCurrentRequestCount()] = abi.encode(receiver_, amount_); - } - - function handleRevert(bytes32 payloadId_) external override { - if (watcher__().getPayloadParams(payloadId_).asyncPromise != msg.sender) return; - - uint40 requestCount = IPromise(msg.sender).requestCount(); - (address receiver, uint256 amount) = abi.decode( - requestCounts[requestCount], - (address, uint256) - ); - - // re-mint tokens to the receiver - _mint(receiver, amount); - delete requestCounts[requestCount]; } /// @notice Override balanceOf to return available (unblocked) credits From be6cc5dd43c951bb3cfc69ee2a50ccabcc817607 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 5 Sep 2025 22:21:57 +0530 Subject: [PATCH 105/139] feat: opt sepolia dev deployments --- Errors.md | 1 + EventTopics.md | 93 +++++++++++++++++++------------ contracts/evmx/fees/Credit.sol | 3 - contracts/utils/common/Errors.sol | 2 +- deployments/dev_addresses.json | 21 ++++++- deployments/dev_verification.json | 8 ++- foundry.toml | 2 +- hardhat-scripts/config/config.ts | 2 +- hardhat-scripts/verify/verify.ts | 1 + package.json | 4 +- yarn.lock | 5 ++ 11 files changed, 96 insertions(+), 46 deletions(-) diff --git a/Errors.md b/Errors.md index c5757e5f..2acd69a3 100644 --- a/Errors.md +++ b/Errors.md @@ -175,3 +175,4 @@ | `DeadlinePassed()` | `0x70f65caa` | | `OnlyRequestHandlerAllowed()` | `0x5c1aa683` | | `OnlyPromiseResolverAllowed()` | `0x2392c25e` | +| `InvalidReceiver()` | `0x1e4ec46b` | diff --git a/EventTopics.md b/EventTopics.md index 26cce93c..bad36f04 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -66,8 +66,8 @@ | Event | Arguments | Topic | | ----------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Approval` | `(owner: address, spender: address, amount: uint256)` | `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` | | `CreditsBlocked` | `(requestCount: uint40, consumeFrom: address, amount: uint256)` | `0xf037c15aef41440aa823cf1fdeaea332105d8b23d52557f6670189b5d76f1eed` | -| `CreditsTransferred` | `(from: address, to: address, amount: uint256)` | `0xed198cadddd93e734cbf04cb1c3226d9bafaeb504cedbd8ee36b830b0cb9e7a5` | | `CreditsUnblocked` | `(requestCount: uint40, consumeFrom: address)` | `0x45db29ef2701319155cac058aa2f56ce1f73e0e238161d3db9f8c9a47655210d` | | `CreditsUnblockedAndAssigned` | `(requestCount: uint40, consumeFrom: address, transmitter: address, amount: uint256)` | `0x38fd327622576a468e1b2818b00f50c8854703633ef8e583e1f31662888ffac2` | | `CreditsUnwrapped` | `(consumeFrom: address, amount: uint256)` | `0xdcc9473b722b4c953617ab373840b365298a520bc7f20ce94fa7314f4a857774` | @@ -79,6 +79,9 @@ | `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | | `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | | `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `SusdcTokenSet` | `(chainSlug: uint32, susdcToken: bytes32)` | `0xa268c0ce0f78082ba676c10a8a79a2785e196d85b3e883f8368f663536189525` | +| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | +| `WhitelistedReceiverSet` | `(receiver: address, isWhitelisted: bool)` | `0x1fc608eb6791d1ef5d49904b6fc17867efb0319743013f69d29403e20741e53b` | | `WithdrawFailed` | `(payloadId: bytes32)` | `0xea147eb2109f71b4bda9e57528ba08b84821087a31cb43a7851dc6ff743d9be7` | ## FeesPool @@ -170,25 +173,40 @@ ## FeesPlug -| Event | Arguments | Topic | -| ---------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | -| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256)` | `0xeb4e1b24b7fe377de69f80f7380bda5ba4b43176c6a4d300a3be9009c49f4228` | -| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | -| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | -| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | -| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | +| Event | Arguments | Topic | +| ---------------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------- | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `FeesDeposited` | `(token: address, receiver: address, creditAmount: uint256, nativeAmount: uint256, data: bytes)` | `0x91f985f17a8632ae2e0a009d65ae250f373d82359d2389b58ea50ada6436682a` | +| `FeesWithdrawn` | `(token: address, receiver: address, amount: uint256)` | `0x5e110f8bc8a20b65dcc87f224bdf1cc039346e267118bae2739847f07321ffa8` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `TokenRemovedFromWhitelist` | `(token: address)` | `0xdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d917` | +| `TokenWhitelisted` | `(token: address)` | `0x6a65f90b1a644d2faac467a21e07e50e3f8fa5846e26231d30ae79a417d3d262` | + +## SUSDC + +| Event | Arguments | Topic | +| ---------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------- | +| `Approval` | `(owner: address, spender: address, amount: uint256)` | `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925` | +| `ConnectorPlugDisconnected` | `()` | `0xc2af098c82dba3c4b00be8bda596d62d13b98a87b42626fefa67e0bb0e198fdd` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `RoleGranted` | `(role: bytes32, grantee: address)` | `0x2ae6a113c0ed5b78a53413ffbb7679881f11145ccfba4fb92e863dfcd5a1d2f3` | +| `RoleRevoked` | `(role: bytes32, revokee: address)` | `0x155aaafb6329a2098580462df33ec4b7441b19729b9601c5fc17ae1cf99a8a52` | +| `TokensBurned` | `(from: address, to: address, amount: uint256, data: bytes)` | `0x568ab03f32147bb501e2805da5910cb00bfca97231507d615ce5326dcf93eae6` | +| `TokensMinted` | `(to: address, amount: uint256)` | `0x3f2c9d57c068687834f0de942a9babb9e5acab57d516d3480a3c16ee165a4273` | +| `Transfer` | `(from: address, to: address, amount: uint256)` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | ## Configurations | Event | Arguments | Topic | | ---------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------- | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `IsValidPlugSet` | `(appGateway: address, chainSlug: uint32, plug: bytes32, isValid: bool)` | `0xd7a90efd60960a8435ef282822190655f6bd2ffa14bb350dc23d6f6956056d7e` | +| `IsValidPlugSet` | `(isValid: bool, chainSlug: uint32, plug: bytes32, appGateway: address)` | `0xdd99f9f3d0179d3845b6c9b5e020d80c32ca46007e43c43c6ab6a86cb259ed28` | | `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | | `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | | `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | @@ -206,31 +224,34 @@ ## RequestHandler -| Event | Arguments | Topic | -| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `FeesIncreased` | `(requestCount: uint40, newMaxFees: uint256)` | `0xf258fca4e49b803ee2a4c2e33b6fcf18bc3982df21f111c00677025bf1ccbb6a` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `RequestCancelled` | `(requestCount: uint40)` | `0xff191657769be72fc08def44c645014c60d18cb24b9ca05c9a33406a28253245` | -| `RequestCompletedWithErrors` | `(requestCount: uint40)` | `0xd8d9915dc14b5a29b66cb263e1ea1e99e60418fc21d97f0fbf09cae1281291e2` | -| `RequestSettled` | `(requestCount: uint40, winner: address)` | `0x1234f98acbe1548b214f4528461a5377f1e2349569c04caa59325e488e7d2aa4` | -| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0xb730ca5523e3f80e88b4bb71e1e78d447553069cd9a7143bb0032b957135b530` | +| Event | Arguments | Topic | +| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `FeesIncreased` | `(requestCount: uint40, newMaxFees: uint256)` | `0xf258fca4e49b803ee2a4c2e33b6fcf18bc3982df21f111c00677025bf1ccbb6a` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `PrecompileSet` | `(callType: bytes4, precompile: address)` | `0x5254189aca1b416c09dad7fb656bf0ed2c07e03ccd240bd95dfbfbaeb5e10e7b` | +| `RequestCancelled` | `(requestCount: uint40)` | `0xff191657769be72fc08def44c645014c60d18cb24b9ca05c9a33406a28253245` | +| `RequestCompletedWithErrors` | `(requestCount: uint40)` | `0xd8d9915dc14b5a29b66cb263e1ea1e99e60418fc21d97f0fbf09cae1281291e2` | +| `RequestPayloadCountLimitSet` | `(requestPayloadCountLimit: uint128)` | `0x67f58095e99ad7f9519f3b80372f6bab373a6217d08c9479fe58b80dcd5b4b7d` | +| `RequestSettled` | `(requestCount: uint40, winner: address)` | `0x1234f98acbe1548b214f4528461a5377f1e2349569c04caa59325e488e7d2aa4` | +| `RequestSubmitted` | `(hasWrite: bool, requestCount: uint40, totalEstimatedWatcherFees: uint256, requestParams: tuple, payloadParamsArray: tuple[])` | `0xb730ca5523e3f80e88b4bb71e1e78d447553069cd9a7143bb0032b957135b530` | ## Watcher -| Event | Arguments | Topic | -| ---------------------------- | ---------------------------------------- | -------------------------------------------------------------------- | -| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | -| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | -| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | -| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | -| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | -| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | -| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | -| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | -| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | +| Event | Arguments | Topic | +| ---------------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `AppGatewayCallFailed` | `(triggerId: bytes32)` | `0xcaf8475fdade8465ea31672463949e6cf1797fdcdd11eeddbbaf857e1e5907b7` | +| `CalledAppGateway` | `(triggerId: bytes32)` | `0xf659ffb3875368f54fb4ab8f5412ac4518af79701a48076f7a58d4448e4bdd0b` | +| `CoreContractsSet` | `(requestHandler: address, configManager: address, promiseResolver: address)` | `0x32f3480588270473dc6418270d922a820dd9e914739e09a98241457dca2fd560` | +| `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | +| `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | +| `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | +| `TriggerFailed` | `(triggerId: bytes32)` | `0x4386783bb0f7cad4ba12f033dbec03dc3441e7757a122f3097a7a4d945c98040` | +| `TriggerFeesSet` | `(triggerFees: uint256)` | `0x7df3967b7c8727af5ac0ee9825d88aafeb899d769bc428b91f8967fa0b623084` | +| `TriggerSucceeded` | `(triggerId: bytes32)` | `0x92d20fbcbf31370b8218e10ed00c5aad0e689022da30a08905ba5ced053219eb` | ## IMessageSwitchboard diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 4f89e493..39e7f8b7 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -115,9 +115,6 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew /// @notice Emitted when withdraw fails event WithdrawFailed(bytes32 indexed payloadId); - /// @notice Emitted when credits are unblocked - event CreditsUnblocked(address indexed user, uint256 amount); - /// @notice Emitted when susdc token is set event SusdcTokenSet(uint32 indexed chainSlug, bytes32 indexed susdcToken); diff --git a/contracts/utils/common/Errors.sol b/contracts/utils/common/Errors.sol index b4fd13fb..6b286d08 100644 --- a/contracts/utils/common/Errors.sol +++ b/contracts/utils/common/Errors.sol @@ -77,4 +77,4 @@ error DeadlinePassed(); // Only Watcher can call functions error OnlyRequestHandlerAllowed(); error OnlyPromiseResolverAllowed(); -error InvalidReceiver(); \ No newline at end of file +error InvalidReceiver(); diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index de6e9129..35711d0a 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -12,7 +12,7 @@ "DeployForwarderImpl": "0x69e3Dc5667f7413039fE3bFd335660A99DA869A9", "ERC1967Factory": "0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79", "FeesManager": "0xbCFf8224d89f0b4e9B14c4356720439111BAC2bC", - "FeesManagerImpl": "0xeC85e4B8181CD77557CF61fC48dfC4cbab1F82a5", + "FeesManagerImpl": "0xaAd0858c5DC1a3fFE09E8C393c7EC00145997A3E", "FeesPool": "0x13A3018920c7b56B20dd34E29C298121025E6de4", "PromiseResolver": "0xed318668898303141EA6B9c2a9F97D0622b0a530", "ReadPrecompile": "0x7C82C3d2aE1bFB4b1D294e5181bCd7489EF554d1", @@ -43,5 +43,24 @@ "2": "0x0355064bBb553A3765af498004749fB2e19284c0", "3": "0x060493ac77c630f4d307Df9bb9bF32cE7462eb70" } + }, + "11155420": { + "CCTPSwitchboard": "0x56EaDAC97B54C0c7979Bd620cad389eC3476dB43", + "CCTPSwitchboardId": "2", + "ContractFactoryPlug": "0x253be2E93EadAD9D2802D83A26eE62E911F1E3fe", + "FastSwitchboard": "0x2cC155961F225AbFF5e64F4a8f9C4f59b2339172", + "FastSwitchboardId": "1", + "FeesPlug": "0x83Ad3d17493Bdc31C60344021CA93E8dD3666A2A", + "MessageSwitchboard": "0x9efC6D7050eF4F5b12205A32ceE49F456FFB6FA8", + "MessageSwitchboardId": "3", + "Socket": "0x631f1E974442d6d51B626cE27d0D7629F1C0aB38", + "SocketBatcher": "0x4b2942C43579C3a9405887CDFA2F2048a5bE91EE", + "startBlock": 32643803, + "SUSDC": "0x40F2CfE35134141F809582ad121BF23522b5Dd22", + "SwitchboardIdToAddressMap": { + "1": "0x2cC155961F225AbFF5e64F4a8f9C4f59b2339172", + "2": "0x56EaDAC97B54C0c7979Bd620cad389eC3476dB43", + "3": "0x9efC6D7050eF4F5b12205A32ceE49F456FFB6FA8" + } } } diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 9040b3a1..ad3bca22 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -13,7 +13,9 @@ "0x13A3018920c7b56B20dd34E29C298121025E6de4", "FeesPool", "contracts/evmx/fees/FeesPool.sol", - ["0xb62505feacC486e809392c65614Ce4d7b051923b"] + [ + "0xb62505feacC486e809392c65614Ce4d7b051923b" + ] ], [ "0xC3f93140EF2f57a87FDdCe7DdADB544873b67C7D", @@ -62,7 +64,9 @@ "0xe0047f9b97c4C73948fe23F1bA807FE7906040C0", "PromiseResolver", "contracts/evmx/watcher/PromiseResolver.sol", - ["0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB"] + [ + "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB" + ] ], [ "0x95aB9c53FDa2ad009B6698d814735D0030796805", diff --git a/foundry.toml b/foundry.toml index 7ab8ecfd..456a6cb6 100644 --- a/foundry.toml +++ b/foundry.toml @@ -22,7 +22,7 @@ via_ir = false 0x69e3Dc5667f7413039fE3bFd335660A99DA869A9 = "DeployForwarderImpl" 0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79 = "ERC1967Factory" 0xbCFf8224d89f0b4e9B14c4356720439111BAC2bC = "FeesManager" -0x56671a257b8492A6E62D32B670F29A76e58F59F6 = "FeesManagerImpl" +0xaAd0858c5DC1a3fFE09E8C393c7EC00145997A3E = "FeesManagerImpl" 0x13A3018920c7b56B20dd34E29C298121025E6de4 = "FeesPool" 0xed318668898303141EA6B9c2a9F97D0622b0a530 = "PromiseResolver" 0x7C82C3d2aE1bFB4b1D294e5181bCd7489EF554d1 = "ReadPrecompile" diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index e74334e6..b493b520 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -34,7 +34,7 @@ export const getChains = () => { case DeploymentMode.DEV: return [ ChainSlug.ARBITRUM_SEPOLIA, - // ChainSlug.OPTIMISM_SEPOLIA, + ChainSlug.OPTIMISM_SEPOLIA, // ChainSlug.BASE_SEPOLIA, ]; case DeploymentMode.STAGE: diff --git a/hardhat-scripts/verify/verify.ts b/hardhat-scripts/verify/verify.ts index eaec585c..c8fec439 100644 --- a/hardhat-scripts/verify/verify.ts +++ b/hardhat-scripts/verify/verify.ts @@ -49,6 +49,7 @@ export const main = async () => { chainName = ChainSlugToKey[chain]; } console.log({ chainName }); + if (!chainName) continue; hre.changeNetwork(chainName); const chainParams: VerifyArgs[] = verificationParams[chain]; diff --git a/package.json b/package.json index c7e0ff85..2fd558a9 100644 --- a/package.json +++ b/package.json @@ -53,5 +53,7 @@ "typechain": "^8.0.0", "typescript": "^4.6.4" }, - "dependencies": {} + "dependencies": { + "@types/uuid": "^10.0.0" + } } diff --git a/yarn.lock b/yarn.lock index a9f749d2..3e8a4232 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2222,6 +2222,11 @@ dependencies: "@types/node" "*" +"@types/uuid@^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d" + integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ== + "@types/validator@^13.7.17": version "13.12.2" resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.12.2.tgz#760329e756e18a4aab82fc502b51ebdfebbe49f5" From fa0bc5d53ed62dc0ff1ed192435ea288ed9bef52 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 5 Sep 2025 22:25:53 +0530 Subject: [PATCH 106/139] rm: old contracts --- deployments/dev_verification.json | 122 ------------------------------ 1 file changed, 122 deletions(-) diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index ad3bca22..9c95d464 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1,127 +1,5 @@ { "14323": [], - "84532": [], "421614": [], - "7625382": [ - [ - "0x8DA71DE564096Ea4A43E794E1dEcA8F1692B69D7", - "FeesManager", - "contracts/evmx/fees/FeesManager.sol", - [] - ], - [ - "0x13A3018920c7b56B20dd34E29C298121025E6de4", - "FeesPool", - "contracts/evmx/fees/FeesPool.sol", - [ - "0xb62505feacC486e809392c65614Ce4d7b051923b" - ] - ], - [ - "0xC3f93140EF2f57a87FDdCe7DdADB544873b67C7D", - "FeesManager", - "contracts/evmx/fees/FeesManager.sol", - [] - ], - [ - "0x1D530df25aE08F7A440CA155c9d53540C2c50A82", - "SchedulePrecompile", - "contracts/evmx/watcher/precompiles/SchedulePrecompile.sol", - [ - "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB", - 86400, - { - "type": "BigNumber", - "hex": "0x02540be400" - }, - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - 3600 - ] - ], - [ - "0x8D8770876e587300828Bc2B235C89F06CE473170", - "ReadPrecompile", - "contracts/evmx/watcher/precompiles/ReadPrecompile.sol", - [ - "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB", - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - 3600 - ] - ], - [ - "0x4F1FB4E9169f4A604e3eb9833987338D48B8Dd77", - "WritePrecompile", - "contracts/evmx/watcher/precompiles/WritePrecompile.sol", - [] - ], - [ - "0xe0047f9b97c4C73948fe23F1bA807FE7906040C0", - "PromiseResolver", - "contracts/evmx/watcher/PromiseResolver.sol", - [ - "0x90B2f8766F47E0A108D85DC43Ddb45A1d5e486FB" - ] - ], - [ - "0x95aB9c53FDa2ad009B6698d814735D0030796805", - "RequestHandler", - "contracts/evmx/watcher/RequestHandler.sol", - [] - ], - [ - "0xbb163A49239260a5BE19f6aD9B5839f11F6aC24F", - "Configurations", - "contracts/evmx/watcher/Configurations.sol", - [] - ], - [ - "0x2682de36DFBf618dBEdFa4d18c265bdc04F7C9bb", - "DeployForwarder", - "contracts/evmx/helpers/DeployForwarder.sol", - [] - ], - [ - "0x32a6E6F8c09823d8F8ddB285346b2c61Ed1F03b8", - "AuctionManager", - "contracts/evmx/AuctionManager.sol", - [] - ], - [ - "0x26d5DFaaB493292c7d2Cc8C1eD447bd944127935", - "Watcher", - "contracts/evmx/watcher/Watcher.sol", - [] - ], - [ - "0xcdbA9Ad5Da86d61a69ea94a52210C1f2008A849f", - "AsyncDeployer", - "contracts/evmx/helpers/AsyncDeployer.sol", - [] - ], - [ - "0xBD3d78023FAf3590fFcF65013b5cC058Efeb13C8", - "FeesManager", - "contracts/evmx/fees/FeesManager.sol", - [] - ], - [ - "0x8fa6EF5A80E4Eca1302d2dfB85ae151275a4eA6A", - "AddressResolver", - "contracts/evmx/helpers/AddressResolver.sol", - [] - ], - [ - "0x32767D5390C2CD3619799c66f9F4E426c317Cd2F", - "ERC1967Factory", - "lib/solady/src/utils/ERC1967Factory.sol", - [] - ] - ], "11155420": [] } From 7cc66f4240a5c83bf9a07d7a399e351704456be9 Mon Sep 17 00:00:00 2001 From: Akash Date: Fri, 5 Sep 2025 23:37:36 +0530 Subject: [PATCH 107/139] feat: added tokenMap --- hardhat-scripts/constants/feeConstants.ts | 22 +++++++++++----------- hardhat-scripts/constants/types.ts | 1 - hardhat-scripts/s3Config/buildConfig.ts | 3 ++- package.json | 2 +- src/types.ts | 4 ++++ 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index 8428e868..9a6191eb 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -1,31 +1,31 @@ import { DeploymentMode } from "../../src"; import { mode } from "../config"; -import { TokenMap } from "./types"; +import { TokenMap } from "../../src"; -const tokens: TokenMap = { +export const tokens: TokenMap = { [DeploymentMode.LOCAL]: { - 421614: ["0x5e732b6f5DC56dDAe4dBDbf844348F87C3B0b957"], - 11155420: ["0xb669f76f781dC75E06183DcdB7fd8bcD8Ef700E6"], + 421614: [{name: "USDC", symbol: "USDC", address: "0x5e732b6f5DC56dDAe4dBDbf844348F87C3B0b957", decimals: 6}], + 11155420: [{name: "USDC", symbol: "USDC", address: "0xb669f76f781dC75E06183DcdB7fd8bcD8Ef700E6", decimals: 6}], }, [DeploymentMode.DEV]: { - 421614: ["0x2321BF7AdFaf49b1338F1Cd474859dBc0D8dfA96"], - 11155420: ["0x15dbE4B96306Cc9Eba15D834d6c1a895cF4e1697"], + 421614: [{name: "USDC", symbol: "USDC", address: "0x2321BF7AdFaf49b1338F1Cd474859dBc0D8dfA96", decimals: 6}], + 11155420: [{name: "USDC", symbol: "USDC", address: "0x15dbE4B96306Cc9Eba15D834d6c1a895cF4e1697", decimals: 6}], }, [DeploymentMode.STAGE]: { - 8453: ["0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"], - 42161: ["0xaf88d065e77c8cc2239327c5edb3a432268e5831"], - 10: ["0x0b2c639c533813f4aa9d7837caf62653d097ff85"], + 8453: [{name: "USDC", symbol: "USDC", address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", decimals: 6} ], + 42161: [{name: "USDC", symbol: "USDC", address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", decimals: 6}], + 10: [{name: "USDC", symbol: "USDC", address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", decimals: 6}], }, }; -const feePools: { [key: string]: string } = { +export const feePools: { [key: string]: string } = { [DeploymentMode.LOCAL]: "0x9De353dD1131aB4e502590D3a1832652FA316268", [DeploymentMode.DEV]: "0x13A3018920c7b56B20dd34E29C298121025E6de4", [DeploymentMode.STAGE]: "0xC8d803B7c1719cdF21392405879D1B56398045C4", }; export const getFeeTokens = (chainSlug: number): string[] => { - return tokens[mode][chainSlug] || []; + return( tokens[mode][chainSlug] || []).map((token) => token.address); }; export const getFeePool = (): string => { diff --git a/hardhat-scripts/constants/types.ts b/hardhat-scripts/constants/types.ts index 612ff879..3a270e4c 100644 --- a/hardhat-scripts/constants/types.ts +++ b/hardhat-scripts/constants/types.ts @@ -4,7 +4,6 @@ export type DeploymentAddresses = { [chainSlug in ChainSlug]?: ChainAddressesObj; }; -export type TokenMap = { [key: string]: { [chainSlug: number]: string[] } }; export interface WatcherMultiCallParams { contractAddress: string; diff --git a/hardhat-scripts/s3Config/buildConfig.ts b/hardhat-scripts/s3Config/buildConfig.ts index 5ac578b5..2899d3bb 100644 --- a/hardhat-scripts/s3Config/buildConfig.ts +++ b/hardhat-scripts/s3Config/buildConfig.ts @@ -11,7 +11,7 @@ import { getAddresses } from "../utils/address"; import { getChainName, rpcKeys, wssRpcKeys } from "../utils/networks"; import { getChainType } from "./utils"; import { version } from "./version"; - +import { tokens } from "../constants/feeConstants"; dotenvConfig(); const addresses = getAddresses(mode); @@ -21,6 +21,7 @@ export const getS3Config = () => { supportedChainSlugs, version: version[mode], chains: {}, + tokens, testnetChainSlugs: testnetChains, mainnetChainSlugs: mainnetChains, evmxChainSlug: EVMX_CHAIN_ID as ChainSlug, diff --git a/package.json b/package.json index c7e0ff85..7ecebe2d 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.1.41", + "version": "1.1.43", "description": "socket protocol", "scripts": { "build": "yarn abi && tsc --project lib.tsconfig.json", diff --git a/src/types.ts b/src/types.ts index 014b1539..ed777f22 100644 --- a/src/types.ts +++ b/src/types.ts @@ -53,6 +53,7 @@ export type EVMxAddressesObj = { export type S3Config = { version: string; chains: { [chainSlug: number]: ChainConfig }; + tokens:TokenMap supportedChainSlugs: number[]; testnetChainSlugs: number[]; evmxChainSlug: number; @@ -71,3 +72,6 @@ export type ChainConfig = { }; export { FinalityBucket }; + + +export type TokenMap = { [key: string]: { [chainSlug: number]: {name: string, symbol: string, address: string, decimals: number}[] } }; From c6cbbae8cb89752bd896d7e62663b25653211291 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Sat, 6 Sep 2025 00:04:00 +0530 Subject: [PATCH 108/139] feat: script to whitelist susdc receiver --- foundry.toml | 8 ++++ .../deploy/WhitelistFeesReceiver.ts | 40 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 hardhat-scripts/deploy/WhitelistFeesReceiver.ts diff --git a/foundry.toml b/foundry.toml index 456a6cb6..69196b42 100644 --- a/foundry.toml +++ b/foundry.toml @@ -33,3 +33,11 @@ via_ir = false 0xfbb565A9Be17546628ED2cdCa43000758a7b5dDe = "WatcherImpl" 0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15 = "WritePrecompile" 0x52BfcB9bD0f1a387f28608C01cE8123310Ce3199 = "WritePrecompileImpl" +0x56EaDAC97B54C0c7979Bd620cad389eC3476dB43 = "CCTPSwitchboard" +0x253be2E93EadAD9D2802D83A26eE62E911F1E3fe = "ContractFactoryPlug" +0x2cC155961F225AbFF5e64F4a8f9C4f59b2339172 = "FastSwitchboard" +0x83Ad3d17493Bdc31C60344021CA93E8dD3666A2A = "FeesPlug" +0x9efC6D7050eF4F5b12205A32ceE49F456FFB6FA8 = "MessageSwitchboard" +0x631f1E974442d6d51B626cE27d0D7629F1C0aB38 = "Socket" +0x4b2942C43579C3a9405887CDFA2F2048a5bE91EE = "SocketBatcher" +0x40F2CfE35134141F809582ad121BF23522b5Dd22 = "SUSDC" diff --git a/hardhat-scripts/deploy/WhitelistFeesReceiver.ts b/hardhat-scripts/deploy/WhitelistFeesReceiver.ts new file mode 100644 index 00000000..6d773b83 --- /dev/null +++ b/hardhat-scripts/deploy/WhitelistFeesReceiver.ts @@ -0,0 +1,40 @@ +import { config as dotenvConfig } from "dotenv"; +dotenvConfig(); + +import { Contracts, EVMxAddressesObj } from "../../src"; +import { Wallet } from "ethers"; +import { EVMX_CHAIN_ID, mode } from "../config"; +import { DeploymentAddresses } from "../constants"; +import { + getAddresses, + getInstance, + getWatcherSigner, +} from "../utils"; + +const ADDRESS_TO_WHITELIST = "0xbC4D50311708FFAFC1A26882fdab17cBfE55CBB9"; + +export const main = async () => { + let addresses: DeploymentAddresses; + try { + console.log("Configuring EVMx contracts"); + addresses = getAddresses(mode) as unknown as DeploymentAddresses; + const evmxAddresses = addresses[EVMX_CHAIN_ID] as EVMxAddressesObj; + const signer: Wallet = getWatcherSigner(); + + const feesManager = await getInstance(Contracts.FeesManager, evmxAddresses[Contracts.FeesManager]); + const tx = await feesManager.connect(signer).setWhitelistedReceiver(ADDRESS_TO_WHITELIST, true); + console.log("Fees manager whitelisted receiver set tx: ", tx.hash); + await tx.wait(); + console.log("Fees manager whitelisted receiver set"); + } catch (error) { + console.log("Error:", error); + } +}; + + +main() + .then(() => process.exit(0)) + .catch((error: Error) => { + console.error(error); + process.exit(1); + }); From edbf9173b73bd8786e6e27a132a0f18c65984e9c Mon Sep 17 00:00:00 2001 From: Akash Date: Sun, 7 Sep 2025 01:43:03 +0530 Subject: [PATCH 109/139] feat: added 10 chains --- deployments/dev_addresses.json | 131 +++- deployments/dev_verification.json | 631 ++++++++++++++++++ hardhat-scripts/config/config.ts | 13 + hardhat-scripts/constants/feeConstants.ts | 139 +++- hardhat-scripts/deploy/1.deploy.ts | 48 +- hardhat-scripts/deploy/2.roles.ts | 16 +- hardhat-scripts/deploy/3.configureChains.ts | 352 +++++----- hardhat-scripts/deploy/6.connect.ts | 42 +- .../deploy/WhitelistFeesReceiver.ts | 16 +- hardhat-scripts/deploy/deployTestUSDC.ts | 82 +++ hardhat-scripts/s3Config/buildConfig.ts | 2 +- hardhat-scripts/utils/overrides.ts | 70 +- hardhat-scripts/verify/verify.ts | 82 ++- hardhat.config.ts | 54 ++ src/chain-enums/chainId.ts | 16 + src/chain-enums/chainSlug.ts | 16 + .../chainSlugToHardhatChainName.ts | 16 + src/chain-enums/chainSlugToKey.ts | 17 + src/chain-enums/hardhatChainName.ts | 16 + src/chain-enums/hardhatChainNameToSlug.ts | 16 + src/types.ts | 22 +- 21 files changed, 1498 insertions(+), 299 deletions(-) create mode 100644 hardhat-scripts/deploy/deployTestUSDC.ts diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 35711d0a..7a7670c5 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -1,4 +1,71 @@ { + "56": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SocketBatcher": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "startBlock": 60248517, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" + } + }, + "100": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SocketBatcher": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "startBlock": 41989627, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" + } + }, + "137": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "startBlock": 76135057, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + } + }, + "146": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SocketBatcher": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "startBlock": 45976634, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" + } + }, + "8453": { + "CCTPSwitchboard": "0xae59BA0Bd0D92232B3B6304185448C9Fe5445f4d", + "ContractFactoryPlug": "0xfE555AD869ac24305471F0755976c556425E8D23", + "FastSwitchboard": "0x0c17822dcC44F8202F176a4960EAC8da8FDbfCA5", + "FastSwitchboardId": "1", + "FeesPlug": "0x1eFD3AF2317B9E6E7492718878f69De747C9e7c3", + "MessageSwitchboard": "0xdaE4538FbbEf41B2Feb5c79DD2fFC9720AF13d7b", + "Socket": "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "SocketBatcher": "0xfaf8a3f8f4221398F3eC765836e8BF4A3d975962", + "startBlock": 35196561, + "SUSDC": "0xbcaDE56f86a819994d0F66b98e921C484bE6FE4e", + "SwitchboardIdToAddressMap": { + "1": "0x0c17822dcC44F8202F176a4960EAC8da8FDbfCA5" + } + }, "14323": { "AddressResolver": "0xcA99D298B5290558660b4D5C1019Be145FaB6020", "AddressResolverImpl": "0x39b5D3FBBa1BC28438e25955aaB412C7576eCd61", @@ -25,6 +92,49 @@ "WritePrecompile": "0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15", "WritePrecompileImpl": "0x52BfcB9bD0f1a387f28608C01cE8123310Ce3199" }, + "43114": { + "CCTPSwitchboard": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug": "0x302E258fe375A1da4d6B3F4Dd5208638A29bc409", + "FastSwitchboard": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "FastSwitchboardId": "1", + "FeesPlug": "0x3aac37DC85C522c09A3DDdA44D181E6aCCD2f9F0", + "MessageSwitchboard": "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", + "Socket": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "SocketBatcher": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "startBlock": 68322256, + "SUSDC": "0x313397aE9B6c22AC0e00d039543AE425b1F1c039", + "SwitchboardIdToAddressMap": { + "1": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD" + } + }, + "59144": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SocketBatcher": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "startBlock": 23003201, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" + } + }, + "84532": { + "CCTPSwitchboard": "0x9175d90706a2b17f0aE025ce5A6C76e64850c2f5", + "ContractFactoryPlug": "0xf8a9d637cd6fAf3d4C17277DceadbEE69d7752f0", + "FastSwitchboard": "0xE09CC429e77EE5DBeF68f3796b2A33BBDF39C03C", + "FastSwitchboardId": "1", + "FeesPlug": "0x3D7515519beab77B541497626CFB7E764F6887CD", + "MessageSwitchboard": "0xe7858f1dc202f5E9C9B3ee6db052F45164a88534", + "Socket": "0x22B521c3610D373Ea29698215eB78907Ad98B644", + "SocketBatcher": "0x26565cAeA64c78Dc7cB4158e7612451Db436A0c6", + "startBlock": 30707073, + "SUSDC": "0x01bDCAB43c423D08BaCe87ED716280536dAB3eF3", + "SwitchboardIdToAddressMap": { + "1": "0xE09CC429e77EE5DBeF68f3796b2A33BBDF39C03C" + } + }, "421614": { "CCTPSwitchboard": "0x0355064bBb553A3765af498004749fB2e19284c0", "CCTPSwitchboardId": "2", @@ -39,9 +149,20 @@ "startBlock": 185630714, "SUSDC": "0x7F7ad06B15cFe9ebE45b01C694205CdB64e8F56d", "SwitchboardIdToAddressMap": { - "1": "0x36620137587b544A8235C080067B3c439ae1c7d7", - "2": "0x0355064bBb553A3765af498004749fB2e19284c0", - "3": "0x060493ac77c630f4d307Df9bb9bF32cE7462eb70" + "1": "0x36620137587b544A8235C080067B3c439ae1c7d7" + } + }, + "747474": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SocketBatcher": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "startBlock": 10442238, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" } }, "11155420": { @@ -58,9 +179,7 @@ "startBlock": 32643803, "SUSDC": "0x40F2CfE35134141F809582ad121BF23522b5Dd22", "SwitchboardIdToAddressMap": { - "1": "0x2cC155961F225AbFF5e64F4a8f9C4f59b2339172", - "2": "0x56EaDAC97B54C0c7979Bd620cad389eC3476dB43", - "3": "0x9efC6D7050eF4F5b12205A32ceE49F456FFB6FA8" + "1": "0x2cC155961F225AbFF5e64F4a8f9C4f59b2339172" } } } diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 9c95d464..8c20b377 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1,5 +1,636 @@ { + "56": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 56, + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a" + ] + ], + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "Socket", + "contracts/protocol/Socket.sol", + [ + 56, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "100": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 100, + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a" + ] + ], + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "Socket", + "contracts/protocol/Socket.sol", + [ + 100, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "137": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 137, + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "Socket", + "contracts/protocol/Socket.sol", + [ + 137, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "146": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 146, + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a" + ] + ], + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "Socket", + "contracts/protocol/Socket.sol", + [ + 146, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "8453": [ + [ + "0xfE555AD869ac24305471F0755976c556425E8D23", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbcaDE56f86a819994d0F66b98e921C484bE6FE4e", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x1eFD3AF2317B9E6E7492718878f69De747C9e7c3", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xdaE4538FbbEf41B2Feb5c79DD2fFC9720AF13d7b", + "MessageSwitchboard", + "contracts/protocol/switchboard/MessageSwitchboard.sol", + [ + 8453, + "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xae59BA0Bd0D92232B3B6304185448C9Fe5445f4d", + "CCTPSwitchboard", + "contracts/protocol/switchboard/CCTPSwitchboard.sol", + [ + 8453, + "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xAD09780d193884d503182aD4588450C416D6F9D4" + ] + ], + [ + "0x0c17822dcC44F8202F176a4960EAC8da8FDbfCA5", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 8453, + "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xfaf8a3f8f4221398F3eC765836e8BF4A3d975962", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d" + ] + ], + [ + "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "Socket", + "contracts/protocol/Socket.sol", + [ + 8453, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], "14323": [], + "43114": [ + [ + "0x302E258fe375A1da4d6B3F4Dd5208638A29bc409", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x313397aE9B6c22AC0e00d039543AE425b1F1c039", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3aac37DC85C522c09A3DDdA44D181E6aCCD2f9F0", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", + "MessageSwitchboard", + "contracts/protocol/switchboard/MessageSwitchboard.sol", + [ + 43114, + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "CCTPSwitchboard", + "contracts/protocol/switchboard/CCTPSwitchboard.sol", + [ + 43114, + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x8186359aF5F57FbB40c6b14A588d2A59C0C29880" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 43114, + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "Socket", + "contracts/protocol/Socket.sol", + [ + 43114, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a" + ] + ], + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "Socket", + "contracts/protocol/Socket.sol", + [ + 43114, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "59144": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 59144, + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a" + ] + ], + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "Socket", + "contracts/protocol/Socket.sol", + [ + 59144, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "84532": [ + [ + "0xf8a9d637cd6fAf3d4C17277DceadbEE69d7752f0", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x22B521c3610D373Ea29698215eB78907Ad98B644", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x01bDCAB43c423D08BaCe87ED716280536dAB3eF3", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x22B521c3610D373Ea29698215eB78907Ad98B644", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3D7515519beab77B541497626CFB7E764F6887CD", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x22B521c3610D373Ea29698215eB78907Ad98B644", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xe7858f1dc202f5E9C9B3ee6db052F45164a88534", + "MessageSwitchboard", + "contracts/protocol/switchboard/MessageSwitchboard.sol", + [ + 84532, + "0x22B521c3610D373Ea29698215eB78907Ad98B644", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9175d90706a2b17f0aE025ce5A6C76e64850c2f5", + "CCTPSwitchboard", + "contracts/protocol/switchboard/CCTPSwitchboard.sol", + [ + 84532, + "0x22B521c3610D373Ea29698215eB78907Ad98B644", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD" + ] + ], + [ + "0xE09CC429e77EE5DBeF68f3796b2A33BBDF39C03C", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 84532, + "0x22B521c3610D373Ea29698215eB78907Ad98B644", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x26565cAeA64c78Dc7cB4158e7612451Db436A0c6", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x22B521c3610D373Ea29698215eB78907Ad98B644" + ] + ], + [ + "0x22B521c3610D373Ea29698215eB78907Ad98B644", + "Socket", + "contracts/protocol/Socket.sol", + [ + 84532, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], "421614": [], + "747474": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 747474, + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a" + ] + ], + [ + "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + "Socket", + "contracts/protocol/Socket.sol", + [ + 747474, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], "11155420": [] } diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index b493b520..0f75f42e 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -35,6 +35,15 @@ export const getChains = () => { return [ ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM_SEPOLIA, + ChainSlug.BASE_SEPOLIA, + ChainSlug.BSC, + ChainSlug.BASE, + ChainSlug.POLYGON_MAINNET, + ChainSlug.AVALANCHE, + ChainSlug.GNOSIS, + ChainSlug.LINEA, + ChainSlug.SONIC, + ChainSlug.KATANA, // ChainSlug.BASE_SEPOLIA, ]; case DeploymentMode.STAGE: @@ -95,6 +104,7 @@ export const EVM_CHAIN_ID_MAP: Record = { // Addresses export const watcher = "0xb62505feacC486e809392c65614Ce4d7b051923b"; export const transmitter = "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320"; +export const socketOwner = "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18"; // Chain config export const EVMX_CHAIN_ID = EVM_CHAIN_ID_MAP[mode]; @@ -124,3 +134,6 @@ export const UPGRADE_VERSION = 1; // Transmitter constants export const TRANSMITTER_CREDIT_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold export const TRANSMITTER_NATIVE_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold + + +export const CONCURRENCY_LIMIT = 5; \ No newline at end of file diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index 9a6191eb..d0b75328 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -1,20 +1,141 @@ -import { DeploymentMode } from "../../src"; +import { ChainSlug, DeploymentMode } from "../../src"; import { mode } from "../config"; import { TokenMap } from "../../src"; export const tokens: TokenMap = { [DeploymentMode.LOCAL]: { - 421614: [{name: "USDC", symbol: "USDC", address: "0x5e732b6f5DC56dDAe4dBDbf844348F87C3B0b957", decimals: 6}], - 11155420: [{name: "USDC", symbol: "USDC", address: "0xb669f76f781dC75E06183DcdB7fd8bcD8Ef700E6", decimals: 6}], + 421614: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e732b6f5DC56dDAe4dBDbf844348F87C3B0b957", + decimals: 6, + }, + ], + 11155420: [ + { + name: "USDC", + symbol: "USDC", + address: "0xb669f76f781dC75E06183DcdB7fd8bcD8Ef700E6", + decimals: 6, + }, + ], }, [DeploymentMode.DEV]: { - 421614: [{name: "USDC", symbol: "USDC", address: "0x2321BF7AdFaf49b1338F1Cd474859dBc0D8dfA96", decimals: 6}], - 11155420: [{name: "USDC", symbol: "USDC", address: "0x15dbE4B96306Cc9Eba15D834d6c1a895cF4e1697", decimals: 6}], + 421614: [ + { + name: "USDC", + symbol: "USDC", + address: "0x2321BF7AdFaf49b1338F1Cd474859dBc0D8dfA96", + decimals: 6, + }, + ], + 11155420: [ + { + name: "USDC", + symbol: "USDC", + address: "0x15dbE4B96306Cc9Eba15D834d6c1a895cF4e1697", + decimals: 6, + }, + ], + [ChainSlug.BASE_SEPOLIA]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x95Be4D8500e3e5C970802c64b0755027d4Fc5C9F", + decimals: 6, + }, + ], + [ChainSlug.BSC]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + decimals: 6, + }, + ], + [ChainSlug.BASE]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x8aAaa86d6a4A4bEC43d985D4eCdF9CA02386d583", + decimals: 6, + }, + ], + [ChainSlug.AVALANCHE]: [ + { + name: "USDC", + symbol: "USDC", + address: "0xeAb2e310A53FD3Fb34C2944690a79DFB2e834F20", + decimals: 6, + }, + ], + [ChainSlug.GNOSIS]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + decimals: 6, + }, + ], + [ChainSlug.LINEA]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + decimals: 6, + }, + ], + [ChainSlug.SONIC]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + decimals: 6, + }, + ], + [ChainSlug.KATANA]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + decimals: 6, + }, + ], + [ChainSlug.POLYGON_MAINNET]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + decimals: 6, + }, + ], }, [DeploymentMode.STAGE]: { - 8453: [{name: "USDC", symbol: "USDC", address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", decimals: 6} ], - 42161: [{name: "USDC", symbol: "USDC", address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", decimals: 6}], - 10: [{name: "USDC", symbol: "USDC", address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", decimals: 6}], + 8453: [ + { + name: "USDC", + symbol: "USDC", + address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + decimals: 6, + }, + ], + 42161: [ + { + name: "USDC", + symbol: "USDC", + address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + decimals: 6, + }, + ], + 10: [ + { + name: "USDC", + symbol: "USDC", + address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + decimals: 6, + }, + ], }, }; @@ -25,7 +146,7 @@ export const feePools: { [key: string]: string } = { }; export const getFeeTokens = (chainSlug: number): string[] => { - return( tokens[mode][chainSlug] || []).map((token) => token.address); + return (tokens[mode][chainSlug] || []).map((token) => token.address); }; export const getFeePool = (): string => { diff --git a/hardhat-scripts/deploy/1.deploy.ts b/hardhat-scripts/deploy/1.deploy.ts index f3b1fe34..96a9a506 100644 --- a/hardhat-scripts/deploy/1.deploy.ts +++ b/hardhat-scripts/deploy/1.deploy.ts @@ -329,30 +329,30 @@ const deploySocketContracts = async () => { ); deployUtils.addresses[contractName] = sb.address; - contractName = Contracts.CCTPSwitchboard; - const cctpSwitchboard: Contract = await getOrDeploy( - contractName, - contractName, - `contracts/protocol/switchboard/${contractName}.sol`, - [ - chain as ChainSlug, - socket.address, - socketOwner, - MESSAGE_TRANSMITTER[chain as ChainSlug], - ], - deployUtils - ); - deployUtils.addresses[contractName] = cctpSwitchboard.address; - - contractName = Contracts.MessageSwitchboard; - const messageSwitchboard: Contract = await getOrDeploy( - contractName, - contractName, - `contracts/protocol/switchboard/${contractName}.sol`, - [chain as ChainSlug, socket.address, socketOwner], - deployUtils - ); - deployUtils.addresses[contractName] = messageSwitchboard.address; + // contractName = Contracts.CCTPSwitchboard; + // const cctpSwitchboard: Contract = await getOrDeploy( + // contractName, + // contractName, + // `contracts/protocol/switchboard/${contractName}.sol`, + // [ + // chain as ChainSlug, + // socket.address, + // socketOwner, + // MESSAGE_TRANSMITTER[chain as ChainSlug], + // ], + // deployUtils + // ); + // deployUtils.addresses[contractName] = cctpSwitchboard.address; + + // contractName = Contracts.MessageSwitchboard; + // const messageSwitchboard: Contract = await getOrDeploy( + // contractName, + // contractName, + // `contracts/protocol/switchboard/${contractName}.sol`, + // [chain as ChainSlug, socket.address, socketOwner], + // deployUtils + // ); + // deployUtils.addresses[contractName] = messageSwitchboard.address; if (getFeesPlugChains().includes(chain as ChainSlug)) { contractName = Contracts.FeesPlug; diff --git a/hardhat-scripts/deploy/2.roles.ts b/hardhat-scripts/deploy/2.roles.ts index 8150ca15..8f465db3 100644 --- a/hardhat-scripts/deploy/2.roles.ts +++ b/hardhat-scripts/deploy/2.roles.ts @@ -2,7 +2,8 @@ import { config as dotenvConfig } from "dotenv"; dotenvConfig(); import { Wallet } from "ethers"; -import { chains, EVMX_CHAIN_ID, mode, watcher, transmitter } from "../config"; +import pLimit from "p-limit"; +import { chains, EVMX_CHAIN_ID, mode, watcher, transmitter, CONCURRENCY_LIMIT } from "../config"; import { DeploymentAddresses } from "../constants"; import { getAddresses, getInstance, getRoleHash, overrides } from "../utils"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; @@ -90,7 +91,7 @@ async function setRolesOnChain(chain: number, addresses: DeploymentAddresses) { await setRoleForContract( contractName as Contracts, - contractAddress, + contractAddress.toString(), targetAddress, roleName, signer, @@ -129,9 +130,14 @@ export const main = async () => { console.log("Setting Roles"); const addresses = getAddresses(mode) as unknown as DeploymentAddresses; console.log("Setting Roles for On Chain"); - for (const chain of chains) { - await setRolesOnChain(chain, addresses); - } + + // Set up parallel processing with concurrency limit of 3 + const limit = pLimit(CONCURRENCY_LIMIT); + const chainTasks = chains.map((chain) => + limit(() => setRolesOnChain(chain, addresses)) + ); + + await Promise.all(chainTasks); await setRolesForEVMx(addresses); } catch (error) { console.log("Error:", error); diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 0f68e7d9..7a924ac6 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -76,29 +76,29 @@ export const configureChains = async (addresses: DeploymentAddresses) => { fastSwitchboardId.toString() ] = chainAddresses[Contracts.FastSwitchboard]; - const cctpSwitchboardId = await registerSb( - chain, - chainAddresses[Contracts.CCTPSwitchboard], - signer, - socketContract - ); - deployUtils.addresses[Contracts.CCTPSwitchboardId] = - cctpSwitchboardId.toString(); - deployUtils.addresses.SwitchboardIdToAddressMap[ - cctpSwitchboardId.toString() - ] = chainAddresses[Contracts.CCTPSwitchboard]; - - const messageSwitchboardId = await registerSb( - chain, - chainAddresses[Contracts.MessageSwitchboard], - signer, - socketContract - ); - deployUtils.addresses[Contracts.MessageSwitchboardId] = - messageSwitchboardId.toString(); - deployUtils.addresses.SwitchboardIdToAddressMap[ - messageSwitchboardId.toString() - ] = chainAddresses[Contracts.MessageSwitchboard]; + // const cctpSwitchboardId = await registerSb( + // chain, + // chainAddresses[Contracts.CCTPSwitchboard], + // signer, + // socketContract + // ); + // deployUtils.addresses[Contracts.CCTPSwitchboardId] = + // cctpSwitchboardId.toString(); + // deployUtils.addresses.SwitchboardIdToAddressMap[ + // cctpSwitchboardId.toString() + // ] = chainAddresses[Contracts.CCTPSwitchboard]; + + // const messageSwitchboardId = await registerSb( + // chain, + // chainAddresses[Contracts.MessageSwitchboard], + // signer, + // socketContract + // ); + // deployUtils.addresses[Contracts.MessageSwitchboardId] = + // messageSwitchboardId.toString(); + // deployUtils.addresses.SwitchboardIdToAddressMap[ + // messageSwitchboardId.toString() + // ] = chainAddresses[Contracts.MessageSwitchboard]; if (chainAddresses[Contracts.FeesPlug]) { await whitelistToken(chain, chainAddresses[Contracts.FeesPlug], signer); @@ -110,17 +110,17 @@ export const configureChains = async (addresses: DeploymentAddresses) => { chain, addresses, fastSwitchboardId, - cctpSwitchboardId + // cctpSwitchboardId ); - await addRemoteEndpointsToCCTPSwitchboard( - chain, - addresses, - signer, - socketContract - ); + // await addRemoteEndpointsToCCTPSwitchboard( + // chain, + // addresses, + // signer, + // socketContract + // ); - await setSiblingConfig(chain, addresses, signer); + // await setSiblingConfig(chain, addresses, signer); if (chainAddresses[Contracts.SUSDC]) await setSUSDCToken( @@ -152,7 +152,7 @@ async function setOnchainContracts( chain: number, addresses: DeploymentAddresses, fastSwitchboardId: string, - cctpSwitchboardId: string + cctpSwitchboardId?: string ) { console.log("Setting onchain contracts", chain); const signer: Wallet = getWatcherSigner(); @@ -174,16 +174,16 @@ async function setOnchainContracts( signer ); - await updateContractSettings( - EVMX_CHAIN_ID, - Contracts.Configurations, - "switchboards", - [chain, CCTP_SWITCHBOARD_TYPE], - cctpSwitchboardId, - "setSwitchboard", - [chain, CCTP_SWITCHBOARD_TYPE, cctpSwitchboardId], - signer - ); + // await updateContractSettings( + // EVMX_CHAIN_ID, + // Contracts.Configurations, + // "switchboards", + // [chain, CCTP_SWITCHBOARD_TYPE], + // cctpSwitchboardId, + // "setSwitchboard", + // [chain, CCTP_SWITCHBOARD_TYPE, cctpSwitchboardId], + // signer + // ); await updateContractSettings( EVMX_CHAIN_ID, @@ -225,140 +225,140 @@ async function setOnchainContracts( ); } -const setSiblingConfig = async ( - chain: number, - addresses: DeploymentAddresses, - signer: Wallet -) => { - try { - console.log("Setting sibling config"); - const chainAddresses = addresses[chain] as ChainAddressesObj; - const sbAddress = chainAddresses[Contracts.MessageSwitchboard]; - const switchboard = ( - await getInstance(Contracts.MessageSwitchboard, sbAddress) - ).connect(signer); - - const remoteChainSlugs = getRemoteChainSlugs(chain); - - for (const remoteChainSlug of remoteChainSlugs) { - const remoteSwitchboardAddress = - addresses[remoteChainSlug]?.[Contracts.MessageSwitchboard]; - - if (!remoteSwitchboardAddress) { - console.log( - `Remote switchboard address not found for ${remoteChainSlug}` - ); - continue; - } - - const remoteSocket = addresses[remoteChainSlug]?.[Contracts.Socket]; - - if (!remoteSocket) { - console.log(`Remote socket address not found for ${remoteChainSlug}`); - continue; - } - - const siblingSwitchboard = await switchboard.siblingSwitchboards( - remoteChainSlug - ); - const siblingSocket = await switchboard.siblingSockets(remoteChainSlug); - const siblingFees = await switchboard.switchboardFees(remoteChainSlug); - - if ( - siblingSwitchboard == - toBytes32FormatHexString(remoteSwitchboardAddress) && - siblingSocket == toBytes32FormatHexString(remoteSocket) && - siblingFees == MSG_SB_FEES - ) { - console.log(`Sibling config ${remoteChainSlug} already exists`); - continue; - } - - const registerTx = await switchboard.setSiblingConfig( - remoteChainSlug, - MSG_SB_FEES, - toBytes32FormatHexString(remoteSocket), - toBytes32FormatHexString(remoteSwitchboardAddress), - { - ...(await overrides(chain)), - } - ); - console.log( - `Setting sibling config ${remoteChainSlug} to ${sbAddress}: ${registerTx.hash}` - ); - await registerTx.wait(); - } - } catch (error) { - throw error; - } -}; - -const addRemoteEndpointsToCCTPSwitchboard = async ( - chain: number, - addresses: DeploymentAddresses, - signer: Wallet, - socket: Contract -) => { - try { - console.log("Adding remote endpoints to CCTP switchboard"); - const chainAddresses = addresses[chain] as ChainAddressesObj; - const sbAddress = chainAddresses[Contracts.CCTPSwitchboard]; - const switchboard = ( - await getInstance(Contracts.CCTPSwitchboard, sbAddress) - ).connect(signer); - const remoteChainSlugs = getRemoteChainSlugs(chain); - console.log(chain, " remoteChainSlugs: ", remoteChainSlugs); - - for (const remoteChainSlug of remoteChainSlugs) { - const remoteSwitchboardAddress = toBytes32FormatHexString( - addresses[remoteChainSlug]?.[Contracts.CCTPSwitchboard]! - ); - const currentRemoteEndpoint = await switchboard.chainSlugToRemoteEndpoint( - remoteChainSlug - ); - - if (currentRemoteEndpoint.remoteAddress == remoteSwitchboardAddress) { - console.log(`Remote endpoint ${remoteChainSlug} already exists`); - continue; - } - - if (!remoteSwitchboardAddress) { - console.log( - `Remote switchboard address not found for ${remoteChainSlug}` - ); - continue; - } - const registerTx = await switchboard.addRemoteEndpoint( - remoteChainSlug, - remoteSwitchboardAddress, - CCTP_DOMAINS[remoteChainSlug], - { - ...(await overrides(chain)), - } - ); - console.log( - `Adding remote endpoint ${remoteChainSlug} to ${sbAddress}: ${registerTx.hash}` - ); - await registerTx.wait(); - } - } catch (error) { - throw error; - } -}; - -const getRemoteChainSlugs = (chain: number) => { - if (testnetChains.includes(chain)) { - return chains.filter( - (c) => c !== chain && testnetChains.includes(c as ChainSlug) - ); - } - if (mainnetChains.includes(chain)) { - return chains.filter( - (c) => c !== chain && mainnetChains.includes(c as ChainSlug) - ); - } - return chains.filter((c) => c !== chain); -}; +// const setSiblingConfig = async ( +// chain: number, +// addresses: DeploymentAddresses, +// signer: Wallet +// ) => { +// try { +// console.log("Setting sibling config"); +// const chainAddresses = addresses[chain] as ChainAddressesObj; +// const sbAddress = chainAddresses[Contracts.MessageSwitchboard]; +// const switchboard = ( +// await getInstance(Contracts.MessageSwitchboard, sbAddress) +// ).connect(signer); + +// const remoteChainSlugs = getRemoteChainSlugs(chain); + +// for (const remoteChainSlug of remoteChainSlugs) { +// const remoteSwitchboardAddress = +// addresses[remoteChainSlug]?.[Contracts.MessageSwitchboard]; + +// if (!remoteSwitchboardAddress) { +// console.log( +// `Remote switchboard address not found for ${remoteChainSlug}` +// ); +// continue; +// } + +// const remoteSocket = addresses[remoteChainSlug]?.[Contracts.Socket]; + +// if (!remoteSocket) { +// console.log(`Remote socket address not found for ${remoteChainSlug}`); +// continue; +// } + +// const siblingSwitchboard = await switchboard.siblingSwitchboards( +// remoteChainSlug +// ); +// const siblingSocket = await switchboard.siblingSockets(remoteChainSlug); +// const siblingFees = await switchboard.switchboardFees(remoteChainSlug); + +// if ( +// siblingSwitchboard == +// toBytes32FormatHexString(remoteSwitchboardAddress) && +// siblingSocket == toBytes32FormatHexString(remoteSocket) && +// siblingFees == MSG_SB_FEES +// ) { +// console.log(`Sibling config ${remoteChainSlug} already exists`); +// continue; +// } + +// const registerTx = await switchboard.setSiblingConfig( +// remoteChainSlug, +// MSG_SB_FEES, +// toBytes32FormatHexString(remoteSocket), +// toBytes32FormatHexString(remoteSwitchboardAddress), +// { +// ...(await overrides(chain)), +// } +// ); +// console.log( +// `Setting sibling config ${remoteChainSlug} to ${sbAddress}: ${registerTx.hash}` +// ); +// await registerTx.wait(); +// } +// } catch (error) { +// throw error; +// } +// }; + +// const addRemoteEndpointsToCCTPSwitchboard = async ( +// chain: number, +// addresses: DeploymentAddresses, +// signer: Wallet, +// socket: Contract +// ) => { +// try { +// console.log("Adding remote endpoints to CCTP switchboard"); +// const chainAddresses = addresses[chain] as ChainAddressesObj; +// const sbAddress = chainAddresses[Contracts.CCTPSwitchboard]; +// const switchboard = ( +// await getInstance(Contracts.CCTPSwitchboard, sbAddress) +// ).connect(signer); +// const remoteChainSlugs = getRemoteChainSlugs(chain); +// console.log(chain, " remoteChainSlugs: ", remoteChainSlugs); + +// for (const remoteChainSlug of remoteChainSlugs) { +// const remoteSwitchboardAddress = toBytes32FormatHexString( +// addresses[remoteChainSlug]?.[Contracts.CCTPSwitchboard]! +// ); +// const currentRemoteEndpoint = await switchboard.chainSlugToRemoteEndpoint( +// remoteChainSlug +// ); + +// if (currentRemoteEndpoint.remoteAddress == remoteSwitchboardAddress) { +// console.log(`Remote endpoint ${remoteChainSlug} already exists`); +// continue; +// } + +// if (!remoteSwitchboardAddress) { +// console.log( +// `Remote switchboard address not found for ${remoteChainSlug}` +// ); +// continue; +// } +// const registerTx = await switchboard.addRemoteEndpoint( +// remoteChainSlug, +// remoteSwitchboardAddress, +// CCTP_DOMAINS[remoteChainSlug], +// { +// ...(await overrides(chain)), +// } +// ); +// console.log( +// `Adding remote endpoint ${remoteChainSlug} to ${sbAddress}: ${registerTx.hash}` +// ); +// await registerTx.wait(); +// } +// } catch (error) { +// throw error; +// } +// }; + +// const getRemoteChainSlugs = (chain: number) => { +// if (testnetChains.includes(chain)) { +// return chains.filter( +// (c) => c !== chain && testnetChains.includes(c as ChainSlug) +// ); +// } +// if (mainnetChains.includes(chain)) { +// return chains.filter( +// (c) => c !== chain && mainnetChains.includes(c as ChainSlug) +// ); +// } +// return chains.filter((c) => c !== chain); +// }; const registerSb = async ( chain: number, diff --git a/hardhat-scripts/deploy/6.connect.ts b/hardhat-scripts/deploy/6.connect.ts index df75b796..b74bda1b 100644 --- a/hardhat-scripts/deploy/6.connect.ts +++ b/hardhat-scripts/deploy/6.connect.ts @@ -1,6 +1,6 @@ import { Wallet } from "ethers"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; -import { chains, EVMX_CHAIN_ID, mode } from "../config"; +import { chains, CONCURRENCY_LIMIT, EVMX_CHAIN_ID, mode } from "../config"; import { AppGatewayConfig, DeploymentAddresses } from "../constants"; import { checkIfAppGatewayIdExists, @@ -13,6 +13,7 @@ import { } from "../utils"; import { getWatcherSigner, sendWatcherMultiCallWithNonce } from "../utils/sign"; import { isConfigSetOnEVMx, isConfigSetOnSocket } from "../utils"; +import pLimit from "p-limit"; const plugs = [ Contracts.ContractFactoryPlug, @@ -23,7 +24,7 @@ const plugs = [ // Main function to connect plugs on all chains export const main = async () => { try { - await connectPlugsOnSocket(); + await connectPlugsOnSocketForAllChains(); await updateConfigEVMx(); } catch (error) { console.log("Error while sending transaction", error); @@ -76,26 +77,35 @@ async function connectPlug( await tx.wait(); } -export const connectPlugsOnSocket = async () => { +export const connectPlugsOnSocketForAllChains = async () => { console.log("Connecting plugs"); const addresses = getAddresses(mode) as unknown as DeploymentAddresses; // Connect plugs on each chain - await Promise.all( - chains.map(async (chain) => { - if (!addresses[chain]) return; - - const socketSigner = getSocketSigner(chain as ChainSlug); - const addr = addresses[chain]!; - // Connect each plug contract - for (const plugContract of plugs) { - if (addr[plugContract]) { - await connectPlug(chain, plugContract, socketSigner, addresses, addr); - } + const limit = pLimit(CONCURRENCY_LIMIT); + const chainTasks = chains.map(async (chain) => { + limit(() => connectPlugsOnSocket(chain, addresses)); + }); + await Promise.all(chainTasks); +}; + +export const connectPlugsOnSocket = async (chain: number, addresses: DeploymentAddresses) => { + try { + if (!addresses[chain]) return; + const socketSigner = getSocketSigner(chain as ChainSlug); + const addr = addresses[chain]!; + // Connect each plug contract + for (const plugContract of plugs) { + if (addr[plugContract]) { + await connectPlug(chain, plugContract, socketSigner, addresses, addr); } - }) - ); + } + } catch (error) { + console.log("Error while sending transaction", error); + } + }; + // Configure plugs on the Watcher VM export const updateConfigEVMx = async () => { try { diff --git a/hardhat-scripts/deploy/WhitelistFeesReceiver.ts b/hardhat-scripts/deploy/WhitelistFeesReceiver.ts index 6d773b83..1d7e3aed 100644 --- a/hardhat-scripts/deploy/WhitelistFeesReceiver.ts +++ b/hardhat-scripts/deploy/WhitelistFeesReceiver.ts @@ -5,11 +5,7 @@ import { Contracts, EVMxAddressesObj } from "../../src"; import { Wallet } from "ethers"; import { EVMX_CHAIN_ID, mode } from "../config"; import { DeploymentAddresses } from "../constants"; -import { - getAddresses, - getInstance, - getWatcherSigner, -} from "../utils"; +import { getAddresses, getInstance, getWatcherSigner } from "../utils"; const ADDRESS_TO_WHITELIST = "0xbC4D50311708FFAFC1A26882fdab17cBfE55CBB9"; @@ -21,8 +17,13 @@ export const main = async () => { const evmxAddresses = addresses[EVMX_CHAIN_ID] as EVMxAddressesObj; const signer: Wallet = getWatcherSigner(); - const feesManager = await getInstance(Contracts.FeesManager, evmxAddresses[Contracts.FeesManager]); - const tx = await feesManager.connect(signer).setWhitelistedReceiver(ADDRESS_TO_WHITELIST, true); + const feesManager = await getInstance( + Contracts.FeesManager, + evmxAddresses[Contracts.FeesManager] + ); + const tx = await feesManager + .connect(signer) + .setWhitelistedReceiver(ADDRESS_TO_WHITELIST, true); console.log("Fees manager whitelisted receiver set tx: ", tx.hash); await tx.wait(); console.log("Fees manager whitelisted receiver set"); @@ -31,7 +32,6 @@ export const main = async () => { } }; - main() .then(() => process.exit(0)) .catch((error: Error) => { diff --git a/hardhat-scripts/deploy/deployTestUSDC.ts b/hardhat-scripts/deploy/deployTestUSDC.ts new file mode 100644 index 00000000..ebd3ec08 --- /dev/null +++ b/hardhat-scripts/deploy/deployTestUSDC.ts @@ -0,0 +1,82 @@ +import { config } from "dotenv"; +config(); +import { Contract } from "ethers"; +import { formatEther, parseEther } from "ethers/lib/utils"; +import { ChainSlug } from "../../src"; +import { + chains, + EVMX_CHAIN_ID, + mode, + logConfig, + socketOwner, +} from "../config/config"; +import { deployContractWithArgs } from "../utils"; +import { getSocketSigner, getWatcherSigner } from "../utils/sign"; +import { tokens } from "../constants/feeConstants"; + +const main = async () => { + logConfig(); + await logBalances(); + await deployTestUSDC(); +}; + +const logBalances = async () => { + const evmxDeployer = await getWatcherSigner(); + const evmxBalance = await evmxDeployer.provider.getBalance( + evmxDeployer.address + ); + console.log( + `EVMx Deployer ${evmxDeployer.address} balance on ${EVMX_CHAIN_ID}:`, + formatEther(evmxBalance) + ); + await Promise.all( + chains.map(async (chain) => { + const socketDeployer = await getSocketSigner(chain as ChainSlug); + const socketBalance = await socketDeployer.provider.getBalance( + socketDeployer.address + ); + console.log( + `Socket Deployer ${socketDeployer.address} balance on ${chain}:`, + formatEther(socketBalance) + ); + }) + ); +}; +const deployTestUSDC = async () => { + for (const chain of chains) { + const signer = getSocketSigner(chain as ChainSlug); + try { + if ( + tokens[mode][chain as ChainSlug]?.find((token) => token.name === "USDC") + ) { + console.log(`USDC already deployed on ${chain}`); + continue; + } + let contractName = "TestUSDC"; + const testUSDC: Contract = await deployContractWithArgs( + contractName, + [ + "USDC Coin", + "USDC", + 6, + socketOwner, + parseEther("1000000000000000000"), + ], + signer, + chain + ); + console.log( + `Deployed ${contractName} on ${chain} at ${testUSDC.address}` + ); + } catch (error) { + console.error(error); + } + } +}; + +main() + .then(() => process.exit(0)) + .catch((error: Error) => { + console.error(error); + process.exit(1); + }); diff --git a/hardhat-scripts/s3Config/buildConfig.ts b/hardhat-scripts/s3Config/buildConfig.ts index 2899d3bb..8e7bceac 100644 --- a/hardhat-scripts/s3Config/buildConfig.ts +++ b/hardhat-scripts/s3Config/buildConfig.ts @@ -11,7 +11,7 @@ import { getAddresses } from "../utils/address"; import { getChainName, rpcKeys, wssRpcKeys } from "../utils/networks"; import { getChainType } from "./utils"; import { version } from "./version"; -import { tokens } from "../constants/feeConstants"; +import { tokens } from "../constants/feeConstants"; dotenvConfig(); const addresses = getAddresses(mode); diff --git a/hardhat-scripts/utils/overrides.ts b/hardhat-scripts/utils/overrides.ts index 4f05c3b0..dcc401bd 100644 --- a/hardhat-scripts/utils/overrides.ts +++ b/hardhat-scripts/utils/overrides.ts @@ -4,19 +4,41 @@ import { EVMX_CHAIN_ID } from "../config/config"; import { getProviderFromChainSlug } from "./networks"; const defaultType = 0; +const DEFAULT_GAS_PRICE_MULTIPLIER = 1.05; + +type ChainOverride = { + type?: number; + gasLimit?: number; + gasPrice?: number; + gasPriceMultiplier?: number; +}; export const chainOverrides: { - [chainSlug in ChainSlug]?: { - type?: number; - gasLimit?: number; - gasPrice?: number; - }; + [chainSlug in ChainSlug]?: ChainOverride; } = { [ChainSlug.ARBITRUM_SEPOLIA]: { - // type: 2, - // gasLimit: 50_000_000, - gasPrice: 800_000_000, + type: 1, + gasLimit: 50_000_000, + gasPrice: 200_000_000, + }, + [ChainSlug.BASE_SEPOLIA]: { + type: 1, + gasLimit: 1_000_000, + // gasPrice: 200_000_000, + }, + [ChainSlug.BSC]: { + gasLimit: 6_000_000, }, + [ChainSlug.MAINNET]: { + gasLimit: 6_000_000, + gasPriceMultiplier: 1.25, + }, + + [ChainSlug.POLYGON_MAINNET]: { + gasPriceMultiplier: 2, + gasLimit: 3_000_000, + }, + [ChainSlug.SEPOLIA]: { type: 1, gasLimit: 2_000_000, @@ -30,6 +52,16 @@ export const chainOverrides: { [ChainSlug.BASE]: { // gasLimit: 2_000_000, }, + [ChainSlug.AVALANCHE]: { + gasLimit: 3_000_000, + }, + [ChainSlug.GNOSIS]: { + gasLimit: 15_000_000, + gasPriceMultiplier: 2, + }, + [ChainSlug.LINEA]: { + gasLimit: 10_000_000, + }, [ChainSlug.ARBITRUM]: { gasPrice: 100_629_157, }, @@ -57,15 +89,19 @@ export const getOverrides = async ( chainSlug: ChainSlug, provider: providers.StaticJsonRpcProvider ) => { - let overrides = chainOverrides[chainSlug]; - let gasPrice = overrides?.gasPrice; - let gasLimit = overrides?.gasLimit; - let type = overrides?.type; - if (gasPrice == undefined || gasPrice == null) - gasPrice = (await getGasPrice(chainSlug, provider)).toNumber(); - if (type == undefined) type = defaultType; - // if gas limit is undefined, ethers will calcuate it automatically. If want to override, - // add in the overrides object. Dont set a default value + const overrides = chainOverrides[chainSlug] || {}; + const { gasLimit, type = defaultType } = overrides; + + let gasPrice = overrides.gasPrice; + if (!gasPrice) { + const baseGasPrice = await provider.getGasPrice(); + const multiplier = + overrides.gasPriceMultiplier || DEFAULT_GAS_PRICE_MULTIPLIER; + gasPrice = baseGasPrice + .mul(Math.round(multiplier * 1000)) + .div(1000) + .toNumber(); + } return { gasLimit, gasPrice, type }; }; diff --git a/hardhat-scripts/verify/verify.ts b/hardhat-scripts/verify/verify.ts index c8fec439..530c7db3 100644 --- a/hardhat-scripts/verify/verify.ts +++ b/hardhat-scripts/verify/verify.ts @@ -5,8 +5,9 @@ import { ChainSlugToKey, } from "../../src"; import hre from "hardhat"; -import { EVMX_CHAIN_ID, mode } from "../config/config"; +import { CONCURRENCY_LIMIT, EVMX_CHAIN_ID, mode } from "../config/config"; import { storeUnVerifiedParams, verify } from "../utils"; +import pLimit from "p-limit"; import local_addresses from "../../deployments/local_addresses.json"; import dev_verification from "../../deployments/dev_verification.json"; @@ -37,47 +38,68 @@ export type VerifyArgs = [string, string, string, any[]]; export const main = async () => { try { const verificationParams = getVerificationParams(mode); - const chains = Object.keys(verificationParams); + const chains = Object.keys(verificationParams).map(chain => parseInt(chain) as ChainSlug); + console.log({ chains }); if (!chains) return; - for (let chainIndex = 0; chainIndex < chains.length; chainIndex++) { - const chain = parseInt(chains[chainIndex]) as ChainSlug; - let chainName: string; - if (chain == (EVMX_CHAIN_ID as ChainSlug)) { - chainName = "EVMX"; - } else { - chainName = ChainSlugToKey[chain]; - } - console.log({ chainName }); - if (!chainName) continue; - hre.changeNetwork(chainName); + for (let chain of chains) { + await verifyChain(chain, verificationParams[chain]); + } + // const limit = pLimit(1); + // const chainTasks = chains.map(async (chain) => { + // limit(() => verifyChain(chain, verificationParams[chain])); + // }); + // await Promise.all(chainTasks); + } catch (error) { + console.log("Error in verifying contracts", error); + } +}; - const chainParams: VerifyArgs[] = verificationParams[chain]; - let retryCount = 0; +export const verifyChain = async (chain: number, verificationParams: VerifyArgs[]) => { + try { + + let chainName: string; + if ([56,100, 137].includes(chain)) { + console.log(`Skipping chain: ${chain}`); + return; + }; - while (retryCount < 5) { - const unverifiedChainParams: VerifyArgs[] = []; - if (chainParams.length) { - const len = chainParams.length; - for (let index = 0; index < len!; index++) { - const res = await verify(...chainParams[index]); - if (!res) { - unverifiedChainParams.push(chainParams[index]); - } + if (chain == (EVMX_CHAIN_ID as ChainSlug)) { + chainName = "EVMX"; + } else { + chainName = ChainSlugToKey[chain]; + } + console.log({ chainName, chain }); + if (!chainName) { + console.log(`Invalid chain: ${chain}`); + return; + }; + hre.changeNetwork(chainName); + + const chainParams: VerifyArgs[] = verificationParams as VerifyArgs[]; + let retryCount = 0; + + while (retryCount < 5) { + const unverifiedChainParams: VerifyArgs[] = []; + if (chainParams.length) { + const len = chainParams.length; + for (let index = 0; index < len!; index++) { + const res = await verify(...chainParams[index]); + if (!res) { + unverifiedChainParams.push(chainParams[index]); } } - await storeUnVerifiedParams(unverifiedChainParams, chain, mode); - - await new Promise((resolve) => setTimeout(resolve, 1000)); - retryCount++; - if (unverifiedChainParams.length == 0) break; } + await storeUnVerifiedParams(unverifiedChainParams, chain, mode); + + await new Promise((resolve) => setTimeout(resolve, 1000)); + retryCount++; + if (unverifiedChainParams.length == 0) break; } } catch (error) { console.log("Error in verifying contracts", error); } }; - main() .then(() => process.exit(0)) .catch((error: Error) => { diff --git a/hardhat.config.ts b/hardhat.config.ts index d94a5db6..3e409160 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -63,6 +63,12 @@ let liveNetworks = { [HardhatChainName.BASE]: getChainConfig(ChainSlug.BASE), [HardhatChainName.ARBITRUM]: getChainConfig(ChainSlug.ARBITRUM), [HardhatChainName.OPTIMISM]: getChainConfig(ChainSlug.OPTIMISM), + [HardhatChainName.KATANA]: getChainConfig(ChainSlug.KATANA), + [HardhatChainName.SONIC]: getChainConfig(ChainSlug.SONIC), + [HardhatChainName.LINEA]: getChainConfig(ChainSlug.LINEA), + [HardhatChainName.AVALANCHE]: getChainConfig(ChainSlug.AVALANCHE), + [HardhatChainName.GNOSIS]: getChainConfig(ChainSlug.GNOSIS), + [HardhatChainName.POLYGON_MAINNET]: getChainConfig(ChainSlug.POLYGON_MAINNET), EVMX: { accounts: [`0x${privateKey}`], chainId: EVMX_CHAIN_ID, @@ -103,6 +109,54 @@ const config: HardhatUserConfig = { EVMX: "none", }, customChains: [ + { + network: "katana", + chainId: ChainId.KATANA, + urls: { + apiURL: "https://api-katana.etherscan.io/api", + browserURL: "https://katana.etherscan.io/", + }, + }, + { + network: "sonic", + chainId: ChainId.SONIC, + urls: { + apiURL: "https://api-sonic.etherscan.io/api", + browserURL: "https://sonic.etherscan.io/", + }, + }, + { + network: "linea", + chainId: ChainId.LINEA, + urls: { + apiURL: "https://api-linea.etherscan.io/api", + browserURL: "https://linea.etherscan.io/", + }, + }, + { + network: "avalanche", + chainId: ChainId.AVALANCHE, + urls: { + apiURL: "https://api-avalanche.etherscan.io/api", + browserURL: "https://avalanche.etherscan.io/", + }, + }, + { + network: "gnosis", + chainId: ChainId.GNOSIS, + urls: { + apiURL: "https://api-gnosis.etherscan.io/api", + browserURL: "https://gnosis.etherscan.io/", + }, + }, + { + network: "polygonMainnet", + chainId: ChainId.POLYGON_MAINNET, + urls: { + apiURL: "https://api-polygon.etherscan.io/api", + browserURL: "https://polygon.etherscan.io/", + }, + }, { network: "optimisticTestnet", chainId: ChainId.OPTIMISM_SEPOLIA, diff --git a/src/chain-enums/chainId.ts b/src/chain-enums/chainId.ts index 69a11947..4e1f4fd8 100644 --- a/src/chain-enums/chainId.ts +++ b/src/chain-enums/chainId.ts @@ -59,4 +59,20 @@ export enum ChainId { INTEROP_ALPHA_1 = 420120001, SOLANA_MAINNET = 10000001, SOLANA_DEVNET = 10000002, + SONIC = 146, + KATANA = 747474, + HYPEREVM = 999, + SEI = 1329, + ZERO = 543210, + ZKSYNC = 324, + ARENA_Z = 7897, + INK = 57073, + BERA = 80094, + B3 = 8333, + UNICHAIN = 130, + MONAD_TESTNET = 10143, + SCROLL = 534352, + SONEIUM = 1868, + SWELLCHAIN = 1923, + WORLD_CHAIN = 480, } diff --git a/src/chain-enums/chainSlug.ts b/src/chain-enums/chainSlug.ts index d62533f8..e541c94f 100644 --- a/src/chain-enums/chainSlug.ts +++ b/src/chain-enums/chainSlug.ts @@ -61,4 +61,20 @@ export enum ChainSlug { INTEROP_ALPHA_1 = ChainId.INTEROP_ALPHA_1, SOLANA_MAINNET = ChainId.SOLANA_MAINNET, SOLANA_DEVNET = ChainId.SOLANA_DEVNET, + SONIC = ChainId.SONIC, + KATANA = ChainId.KATANA, + HYPEREVM = ChainId.HYPEREVM, + SEI = ChainId.SEI, + ZERO = ChainId.ZERO, + ZKSYNC = ChainId.ZKSYNC, + ARENA_Z = ChainId.ARENA_Z, + INK = ChainId.INK, + BERA = ChainId.BERA, + B3 = ChainId.B3, + UNICHAIN = ChainId.UNICHAIN, + MONAD_TESTNET = ChainId.MONAD_TESTNET, + SCROLL = ChainId.SCROLL, + SONEIUM = ChainId.SONEIUM, + SWELLCHAIN = ChainId.SWELLCHAIN, + WORLD_CHAIN = ChainId.WORLD_CHAIN, } diff --git a/src/chain-enums/chainSlugToHardhatChainName.ts b/src/chain-enums/chainSlugToHardhatChainName.ts index 02b6b0ae..b7c043e0 100644 --- a/src/chain-enums/chainSlugToHardhatChainName.ts +++ b/src/chain-enums/chainSlugToHardhatChainName.ts @@ -60,4 +60,20 @@ export const chainSlugToHardhatChainName = { [ChainSlug.ZERO_SEPOLIA]: HardhatChainName.ZERO_SEPOLIA, [ChainSlug.INTEROP_ALPHA_0]: HardhatChainName.INTEROP_ALPHA_0, [ChainSlug.INTEROP_ALPHA_1]: HardhatChainName.INTEROP_ALPHA_1, + [ChainSlug.ZERO]: HardhatChainName.ZERO, + [ChainSlug.ZKSYNC]: HardhatChainName.ZKSYNC, + [ChainSlug.ARENA_Z]: HardhatChainName.ARENA_Z, + [ChainSlug.INK]: HardhatChainName.INK, + [ChainSlug.SONIC]: HardhatChainName.SONIC, + [ChainSlug.BERA]: HardhatChainName.BERA, + [ChainSlug.B3]: HardhatChainName.B3, + [ChainSlug.UNICHAIN]: HardhatChainName.UNICHAIN, + [ChainSlug.MONAD_TESTNET]: HardhatChainName.MONAD_TESTNET, + [ChainSlug.SCROLL]: HardhatChainName.SCROLL, + [ChainSlug.SONEIUM]: HardhatChainName.SONEIUM, + [ChainSlug.SWELLCHAIN]: HardhatChainName.SWELLCHAIN, + [ChainSlug.WORLD_CHAIN]: HardhatChainName.WORLD_CHAIN, + [ChainSlug.KATANA]: HardhatChainName.KATANA, + [ChainSlug.HYPEREVM]: HardhatChainName.HYPEREVM, + [ChainSlug.SEI]: HardhatChainName.SEI, }; diff --git a/src/chain-enums/chainSlugToKey.ts b/src/chain-enums/chainSlugToKey.ts index 43c601a4..8f9b6b49 100644 --- a/src/chain-enums/chainSlugToKey.ts +++ b/src/chain-enums/chainSlugToKey.ts @@ -60,4 +60,21 @@ export const ChainSlugToKey = { [ChainSlug.ZERO_SEPOLIA]: HardhatChainName.ZERO_SEPOLIA, [ChainSlug.INTEROP_ALPHA_0]: HardhatChainName.INTEROP_ALPHA_0, [ChainSlug.INTEROP_ALPHA_1]: HardhatChainName.INTEROP_ALPHA_1, + [ChainSlug.ZERO]: HardhatChainName.ZERO, + [ChainSlug.ZKSYNC]: HardhatChainName.ZKSYNC, + [ChainSlug.ARENA_Z]: HardhatChainName.ARENA_Z, + [ChainSlug.INK]: HardhatChainName.INK, + [ChainSlug.SONIC]: HardhatChainName.SONIC, + [ChainSlug.BERA]: HardhatChainName.BERA, + [ChainSlug.B3]: HardhatChainName.B3, + [ChainSlug.UNICHAIN]: HardhatChainName.UNICHAIN, + [ChainSlug.MONAD_TESTNET]: HardhatChainName.MONAD_TESTNET, + [ChainSlug.SCROLL]: HardhatChainName.SCROLL, + [ChainSlug.SONEIUM]: HardhatChainName.SONEIUM, + [ChainSlug.SWELLCHAIN]: HardhatChainName.SWELLCHAIN, + [ChainSlug.WORLD_CHAIN]: HardhatChainName.WORLD_CHAIN, + [ChainSlug.KATANA]: HardhatChainName.KATANA, + [ChainSlug.HYPEREVM]: HardhatChainName.HYPEREVM, + [ChainSlug.SEI]: HardhatChainName.SEI, + }; diff --git a/src/chain-enums/hardhatChainName.ts b/src/chain-enums/hardhatChainName.ts index c74be92e..fb8c1a41 100644 --- a/src/chain-enums/hardhatChainName.ts +++ b/src/chain-enums/hardhatChainName.ts @@ -57,4 +57,20 @@ export enum HardhatChainName { ZERO_SEPOLIA = "zero_sepolia", INTEROP_ALPHA_0 = "interop_alpha_0", INTEROP_ALPHA_1 = "interop_alpha_1", + ZERO = "zero", + ZKSYNC = "zksync", + ARENA_Z = "arena_z", + INK = "ink", + SONIC = "sonic", + BERA = "bera", + B3 = "b3", + UNICHAIN = "unichain", + MONAD_TESTNET = "monad_testnet", + SCROLL = "scroll", + SONEIUM = "soneium", + SWELLCHAIN = "swellchain", + WORLD_CHAIN = "world_chain", + KATANA = "katana", + HYPEREVM = "hyperevm", + SEI = "sei", } diff --git a/src/chain-enums/hardhatChainNameToSlug.ts b/src/chain-enums/hardhatChainNameToSlug.ts index 110b45c9..e63a8876 100644 --- a/src/chain-enums/hardhatChainNameToSlug.ts +++ b/src/chain-enums/hardhatChainNameToSlug.ts @@ -60,4 +60,20 @@ export const hardhatChainNameToSlug = { [HardhatChainName.ZERO_SEPOLIA]: ChainSlug.ZERO_SEPOLIA, [HardhatChainName.INTEROP_ALPHA_0]: ChainSlug.INTEROP_ALPHA_0, [HardhatChainName.INTEROP_ALPHA_1]: ChainSlug.INTEROP_ALPHA_1, + [HardhatChainName.ZERO]: ChainSlug.ZERO, + [HardhatChainName.ZKSYNC]: ChainSlug.ZKSYNC, + [HardhatChainName.ARENA_Z]: ChainSlug.ARENA_Z, + [HardhatChainName.INK]: ChainSlug.INK, + [HardhatChainName.SONIC]: ChainSlug.SONIC, + [HardhatChainName.BERA]: ChainSlug.BERA, + [HardhatChainName.B3]: ChainSlug.B3, + [HardhatChainName.UNICHAIN]: ChainSlug.UNICHAIN, + [HardhatChainName.MONAD_TESTNET]: ChainSlug.MONAD_TESTNET, + [HardhatChainName.SCROLL]: ChainSlug.SCROLL, + [HardhatChainName.SONEIUM]: ChainSlug.SONEIUM, + [HardhatChainName.SWELLCHAIN]: ChainSlug.SWELLCHAIN, + [HardhatChainName.WORLD_CHAIN]: ChainSlug.WORLD_CHAIN, + [HardhatChainName.KATANA]: ChainSlug.KATANA, + [HardhatChainName.HYPEREVM]: ChainSlug.HYPEREVM, + [HardhatChainName.SEI]: ChainSlug.SEI, }; diff --git a/src/types.ts b/src/types.ts index ed777f22..087ab640 100644 --- a/src/types.ts +++ b/src/types.ts @@ -19,11 +19,11 @@ export type ChainAddressesObj = { Socket: string; SocketBatcher: string; FastSwitchboard: string; - CCTPSwitchboard: string; - MessageSwitchboard: string; + CCTPSwitchboard?: string; + MessageSwitchboard?: string; FastSwitchboardId: string; - CCTPSwitchboardId: string; - MessageSwitchboardId: string; + CCTPSwitchboardId?: string; + MessageSwitchboardId?: string; ContractFactoryPlug: string; SocketFeesManager?: string; FeesPlug?: string; @@ -53,7 +53,7 @@ export type EVMxAddressesObj = { export type S3Config = { version: string; chains: { [chainSlug: number]: ChainConfig }; - tokens:TokenMap + tokens: TokenMap; supportedChainSlugs: number[]; testnetChainSlugs: number[]; evmxChainSlug: number; @@ -73,5 +73,13 @@ export type ChainConfig = { export { FinalityBucket }; - -export type TokenMap = { [key: string]: { [chainSlug: number]: {name: string, symbol: string, address: string, decimals: number}[] } }; +export type TokenMap = { + [key: string]: { + [chainSlug: number]: { + name: string; + symbol: string; + address: string; + decimals: number; + }[]; + }; +}; From e14aec56d72469aa185320ed3e6a5a71b97d86c9 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 11 Sep 2025 21:07:32 +0530 Subject: [PATCH 110/139] fix: trigger retryable --- contracts/evmx/watcher/Trigger.sol | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contracts/evmx/watcher/Trigger.sol b/contracts/evmx/watcher/Trigger.sol index dedfd51d..181c2367 100644 --- a/contracts/evmx/watcher/Trigger.sol +++ b/contracts/evmx/watcher/Trigger.sol @@ -38,7 +38,6 @@ abstract contract Trigger is WatcherStorage, AddressResolverUtil { triggerFromChainSlug = params_.chainSlug; triggerFromPlug = params_.plug; - isAppGatewayCalled[params_.triggerId] = true; (bool success, , ) = appGateway.tryCall( 0, gasleft(), @@ -49,10 +48,16 @@ abstract contract Trigger is WatcherStorage, AddressResolverUtil { if (!success) { emit TriggerFailed(params_.triggerId); } else { + isAppGatewayCalled[params_.triggerId] = true; emit TriggerSucceeded(params_.triggerId); } triggerFromChainSlug = 0; triggerFromPlug = bytes32(0); } + + // todo: add onlyWatcher modifier + function resetIsAppGatewayCalled(bytes32 triggerId_) external { + isAppGatewayCalled[triggerId_] = false; + } } From a5448c84ec4c2667e26c33f620ea747d07432709 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 11 Sep 2025 21:07:54 +0530 Subject: [PATCH 111/139] fix: lint --- hardhat-scripts/config/config.ts | 3 +-- hardhat-scripts/constants/types.ts | 1 - hardhat-scripts/deploy/1.deploy.ts | 9 ++++----- hardhat-scripts/deploy/2.roles.ts | 15 +++++++++++---- hardhat-scripts/deploy/3.configureChains.ts | 2 +- hardhat-scripts/deploy/6.connect.ts | 7 ++++--- hardhat-scripts/verify/verify.ts | 18 +++++++++++------- src/chain-enums/chainSlugToKey.ts | 1 - src/finality.ts | 6 +++--- 9 files changed, 35 insertions(+), 27 deletions(-) diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 0f75f42e..44b3a65e 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -135,5 +135,4 @@ export const UPGRADE_VERSION = 1; export const TRANSMITTER_CREDIT_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold export const TRANSMITTER_NATIVE_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold - -export const CONCURRENCY_LIMIT = 5; \ No newline at end of file +export const CONCURRENCY_LIMIT = 5; diff --git a/hardhat-scripts/constants/types.ts b/hardhat-scripts/constants/types.ts index 3a270e4c..1a229d3c 100644 --- a/hardhat-scripts/constants/types.ts +++ b/hardhat-scripts/constants/types.ts @@ -4,7 +4,6 @@ export type DeploymentAddresses = { [chainSlug in ChainSlug]?: ChainAddressesObj; }; - export interface WatcherMultiCallParams { contractAddress: string; data: string; diff --git a/hardhat-scripts/deploy/1.deploy.ts b/hardhat-scripts/deploy/1.deploy.ts index 96a9a506..d01951fe 100644 --- a/hardhat-scripts/deploy/1.deploy.ts +++ b/hardhat-scripts/deploy/1.deploy.ts @@ -438,6 +438,10 @@ const deployContractWithProxy = async ( ); const newImplementation = implementation.address; + if (currentImplAddress.toLowerCase() === newImplementation.toLowerCase()) + return deployUtils; + + console.log("Upgrading contract: ", contractName); console.log( "Current implementation for", contractName, @@ -446,11 +450,6 @@ const deployContractWithProxy = async ( ); console.log("New implementation for", contractName, ":", newImplementation); - if (currentImplAddress.toLowerCase() === newImplementation.toLowerCase()) - return deployUtils; - - console.log("Upgrading contract: ", contractName); - const tx = await proxyFactory .connect(deployUtils.signer) .upgrade(deployUtils.addresses[contractName], newImplementation); diff --git a/hardhat-scripts/deploy/2.roles.ts b/hardhat-scripts/deploy/2.roles.ts index 8f465db3..0786e8a8 100644 --- a/hardhat-scripts/deploy/2.roles.ts +++ b/hardhat-scripts/deploy/2.roles.ts @@ -3,7 +3,14 @@ dotenvConfig(); import { Wallet } from "ethers"; import pLimit from "p-limit"; -import { chains, EVMX_CHAIN_ID, mode, watcher, transmitter, CONCURRENCY_LIMIT } from "../config"; +import { + chains, + EVMX_CHAIN_ID, + mode, + watcher, + transmitter, + CONCURRENCY_LIMIT, +} from "../config"; import { DeploymentAddresses } from "../constants"; import { getAddresses, getInstance, getRoleHash, overrides } from "../utils"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; @@ -130,13 +137,13 @@ export const main = async () => { console.log("Setting Roles"); const addresses = getAddresses(mode) as unknown as DeploymentAddresses; console.log("Setting Roles for On Chain"); - + // Set up parallel processing with concurrency limit of 3 - const limit = pLimit(CONCURRENCY_LIMIT); + const limit = pLimit(CONCURRENCY_LIMIT); const chainTasks = chains.map((chain) => limit(() => setRolesOnChain(chain, addresses)) ); - + await Promise.all(chainTasks); await setRolesForEVMx(addresses); } catch (error) { diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 7a924ac6..6b96c3d1 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -109,7 +109,7 @@ export const configureChains = async (addresses: DeploymentAddresses) => { await setOnchainContracts( chain, addresses, - fastSwitchboardId, + fastSwitchboardId // cctpSwitchboardId ); diff --git a/hardhat-scripts/deploy/6.connect.ts b/hardhat-scripts/deploy/6.connect.ts index b74bda1b..8d6796fa 100644 --- a/hardhat-scripts/deploy/6.connect.ts +++ b/hardhat-scripts/deploy/6.connect.ts @@ -88,7 +88,10 @@ export const connectPlugsOnSocketForAllChains = async () => { await Promise.all(chainTasks); }; -export const connectPlugsOnSocket = async (chain: number, addresses: DeploymentAddresses) => { +export const connectPlugsOnSocket = async ( + chain: number, + addresses: DeploymentAddresses +) => { try { if (!addresses[chain]) return; const socketSigner = getSocketSigner(chain as ChainSlug); @@ -102,10 +105,8 @@ export const connectPlugsOnSocket = async (chain: number, addresses: DeploymentA } catch (error) { console.log("Error while sending transaction", error); } - }; - // Configure plugs on the Watcher VM export const updateConfigEVMx = async () => { try { diff --git a/hardhat-scripts/verify/verify.ts b/hardhat-scripts/verify/verify.ts index 530c7db3..d40709cd 100644 --- a/hardhat-scripts/verify/verify.ts +++ b/hardhat-scripts/verify/verify.ts @@ -38,7 +38,9 @@ export type VerifyArgs = [string, string, string, any[]]; export const main = async () => { try { const verificationParams = getVerificationParams(mode); - const chains = Object.keys(verificationParams).map(chain => parseInt(chain) as ChainSlug); + const chains = Object.keys(verificationParams).map( + (chain) => parseInt(chain) as ChainSlug + ); console.log({ chains }); if (!chains) return; @@ -55,14 +57,16 @@ export const main = async () => { } }; -export const verifyChain = async (chain: number, verificationParams: VerifyArgs[]) => { - try { - +export const verifyChain = async ( + chain: number, + verificationParams: VerifyArgs[] +) => { + try { let chainName: string; - if ([56,100, 137].includes(chain)) { + if ([56, 100, 137].includes(chain)) { console.log(`Skipping chain: ${chain}`); return; - }; + } if (chain == (EVMX_CHAIN_ID as ChainSlug)) { chainName = "EVMX"; @@ -73,7 +77,7 @@ export const verifyChain = async (chain: number, verificationParams: VerifyArgs[ if (!chainName) { console.log(`Invalid chain: ${chain}`); return; - }; + } hre.changeNetwork(chainName); const chainParams: VerifyArgs[] = verificationParams as VerifyArgs[]; diff --git a/src/chain-enums/chainSlugToKey.ts b/src/chain-enums/chainSlugToKey.ts index 8f9b6b49..d4833da2 100644 --- a/src/chain-enums/chainSlugToKey.ts +++ b/src/chain-enums/chainSlugToKey.ts @@ -76,5 +76,4 @@ export const ChainSlugToKey = { [ChainSlug.KATANA]: HardhatChainName.KATANA, [ChainSlug.HYPEREVM]: HardhatChainName.HYPEREVM, [ChainSlug.SEI]: HardhatChainName.SEI, - }; diff --git a/src/finality.ts b/src/finality.ts index bbccd896..82a6d194 100644 --- a/src/finality.ts +++ b/src/finality.ts @@ -25,9 +25,9 @@ export const finalityBlockOverrides: { }, [ChainSlug.POLYGON_MAINNET]: { - [FinalityBucket.LOW]: 256, - [FinalityBucket.MEDIUM]: 512, - [FinalityBucket.HIGH]: 1000, + [FinalityBucket.LOW]: 5, + [FinalityBucket.MEDIUM]: 5, + [FinalityBucket.HIGH]: 5, }, [ChainSlug.NEOX_TESTNET]: { [FinalityBucket.LOW]: 1, From 0ea14781df7ee8989c2370cbff9cbcae155fb36c Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 11 Sep 2025 21:08:03 +0530 Subject: [PATCH 112/139] feat: upgrade watcher --- deployments/dev_addresses.json | 2 +- deployments/dev_verification.json | 81 ++++++++++++------------------- 2 files changed, 31 insertions(+), 52 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 7a7670c5..42418476 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -88,7 +88,7 @@ "SchedulePrecompile": "0x4660c5fF2762E688f8D0def828ad161AE4940F57", "startBlock": 46937, "Watcher": "0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d", - "WatcherImpl": "0xfbb565A9Be17546628ED2cdCa43000758a7b5dDe", + "WatcherImpl": "0xc7837f8dC93335d203DaBCb0c35dC401Ade9F1B3", "WritePrecompile": "0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15", "WritePrecompileImpl": "0x52BfcB9bD0f1a387f28608C01cE8123310Ce3199" }, diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 8c20b377..258e9600 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -53,11 +53,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 56, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [56, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "100": [ @@ -114,11 +110,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 100, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [100, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "137": [ @@ -175,11 +167,7 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [ - 137, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [137, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "146": [ @@ -236,11 +224,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 146, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [146, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "8453": [ @@ -318,14 +302,29 @@ "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", "Socket", "contracts/protocol/Socket.sol", - [ - 8453, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [8453, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], + "14323": [ + [ + "0xc7837f8dC93335d203DaBCb0c35dC401Ade9F1B3", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], + [ + "0x52fEa0aBEe0CC6CBf46099a9886Ed0C123241fDc", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], + [ + "0x0f832af23F7fc3332396f73caAB2Fa44A6d3aFFC", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] ] ], - "14323": [], "43114": [ [ "0x302E258fe375A1da4d6B3F4Dd5208638A29bc409", @@ -401,11 +400,7 @@ "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", "Socket", "contracts/protocol/Socket.sol", - [ - 43114, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ], [ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", @@ -420,11 +415,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 43114, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "59144": [ @@ -481,11 +472,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 59144, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [59144, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "84532": [ @@ -563,11 +550,7 @@ "0x22B521c3610D373Ea29698215eB78907Ad98B644", "Socket", "contracts/protocol/Socket.sol", - [ - 84532, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [84532, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "421614": [], @@ -625,11 +608,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 747474, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [747474, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "11155420": [] From 05521868fc1526bd0b5d966fb204f81dc265f65d Mon Sep 17 00:00:00 2001 From: Akash Date: Sat, 13 Sep 2025 19:51:57 +0530 Subject: [PATCH 113/139] feat: added new chains --- deployments/stage_addresses.json | 134 +----------------- deployments/stage_verification.json | 17 +-- hardhat-scripts/addChain/utils.ts | 2 +- hardhat-scripts/config/config.ts | 85 ++++++++++- hardhat-scripts/s3Config/buildConfig.ts | 7 +- package.json | 2 +- setupInfraContracts.sh | 3 + src/chain-enums/chainId.ts | 4 + src/chain-enums/chainSlug.ts | 4 + .../chainSlugToHardhatChainName.ts | 4 + src/chain-enums/chainSlugToId.ts | 4 + src/chain-enums/chainSlugToKey.ts | 4 + src/chain-enums/currency.ts | 41 +++--- src/chain-enums/ethLikeChains.ts | 6 +- src/chain-enums/hardhatChainName.ts | 4 + src/chain-enums/hardhatChainNameToSlug.ts | 4 + src/chain-enums/mainnetIds.ts | 21 +++ src/chain-enums/native-tokens.ts | 33 +++-- src/chain-enums/testnetIds.ts | 2 + src/types.ts | 3 + 20 files changed, 198 insertions(+), 186 deletions(-) diff --git a/deployments/stage_addresses.json b/deployments/stage_addresses.json index ffd2c9e3..9e26dfee 100644 --- a/deployments/stage_addresses.json +++ b/deployments/stage_addresses.json @@ -1,133 +1 @@ -{ - "10": { - "CCTPSwitchboard": "0x8d1aAf3c24D221aE30E069136C8B1e305d7668Dc", - "CCTPSwitchboardId": "2", - "ContractFactoryPlug": "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", - "FastSwitchboard": "0xDa17184a5DE13B731C7F06ED147a6048eD6f9EEA", - "FastSwitchboardId": "1", - "FeesPlug": "0x375b8c18b57DbAA5146cdCb4a8154Ff2eCc238D6", - "MessageSwitchboard": "0xD9803F3A7F2b7Ce185daAaC94EFE00B30F0f9fab", - "MessageSwitchboardId": "3", - "Socket": "0x79EB309890F4A797816478dB7D9d57A1e63CeeC2", - "SocketBatcher": "0xe31C4265Cb0E22663164172B055Ac25281adfb66", - "startBlock": 139061413, - "SwitchboardIdToAddressMap": { - "1": "0xDa17184a5DE13B731C7F06ED147a6048eD6f9EEA", - "2": "0x8d1aAf3c24D221aE30E069136C8B1e305d7668Dc", - "3": "0xD9803F3A7F2b7Ce185daAaC94EFE00B30F0f9fab" - } - }, - "8453": { - "CCTPSwitchboard": "0x72e8aba972EEe812d6a5C6Ab13197e884C7D8FA9", - "CCTPSwitchboardId": "2", - "ContractFactoryPlug": "0xcFb68baF734daA2b5df3eE18F1fb45c99230A2A5", - "FastSwitchboard": "0xb5763dC91FD626786E17b43E8808062a87b037aF", - "FastSwitchboardId": "1", - "FeesPlug": "0x6C1d46856dc8e1Fe16B1A8d0caEc720F9A58A193", - "MessageSwitchboard": "0x0D85b9835bD1E82baeFcdb12C4D171294c64Afd2", - "MessageSwitchboardId": "3", - "Socket": "0x375b8c18b57DbAA5146cdCb4a8154Ff2eCc238D6", - "SocketBatcher": "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", - "startBlock": 33466371, - "SwitchboardIdToAddressMap": { - "1": "0xb5763dC91FD626786E17b43E8808062a87b037aF", - "2": "0x72e8aba972EEe812d6a5C6Ab13197e884C7D8FA9", - "3": "0x0D85b9835bD1E82baeFcdb12C4D171294c64Afd2" - } - }, - "14323": { - "AddressResolver": "0xAA77c2dE14CfFF4244a127deED6b53ce79481e14", - "AddressResolverImpl": "0xe857a826D330Fc0429c67FaBEB8B66C26ea1DD5f", - "AsyncDeployer": "0x24c3f774c231ADFeb5e22Ad826a666A0FF9742C8", - "AsyncDeployerImpl": "0xB7Bf09935108753491E59114dc0B713cDa6F703F", - "AuctionManager": "0xd5853f69f5dE728AEF7d1cF029cB3bF1581A4ED4", - "AuctionManagerImpl": "0x89A0D4550D5aFa809B74856624D4595188641BCe", - "Configurations": "0x0f2801ee741A3BdeA2245d97AB54B1C4d7734534", - "ConfigurationsImpl": "0xD41d93042Dd1aB8c712C212A6907d4dC0718D021", - "DeployForwarder": "0x54676a772aEe69E3F87178F2b5E4414dcE9A9720", - "DeployForwarderImpl": "0x9882ce57b618175Bd9d3a4eC50ebD682B39bc467", - "ERC1967Factory": "0x61788F19CA1b098cE8437f8eb13B1Ad68f4FcD77", - "FeesManager": "0x9339e8D915Aaf467d2fC01a4e694c8FE85621e94", - "FeesManagerImpl": "0x27b763c5410E83c02F21D97B33555729B77B2Ce1", - "FeesPool": "0xC8d803B7c1719cdF21392405879D1B56398045C4", - "PromiseResolver": "0x9BE3513a5d32E74935a54e5516b4daa198da5574", - "ReadPrecompile": "0x784730D5e5D2F64eA63BfafeDC759317438c9186", - "RequestHandler": "0x22FaddfD47B9E0B545f83a2E7Cd05c12889c7a57", - "RequestHandlerImpl": "0xAA6EfF8dbd53B8d95a02c59Fe5C8A8422B08F5AA", - "SchedulePrecompile": "0x074118aB15e54A84b42Ff3de5233721434cF9f55", - "startBlock": 11040, - "Watcher": "0xdd25a87AeB5bCEeBAc0EB27aFfaBB6eB5a2857ca", - "WatcherImpl": "0xb143810f13fDF66F7a9B973252AEC80ec47FF0cb", - "WritePrecompile": "0x66ce424303EC8499C5cdC4F6437A0434D8bd9b81", - "WritePrecompileImpl": "0x962E1db23f6C5879A5c9D58CcB8c67CD282F1000" - }, - "42161": { - "CCTPSwitchboard": "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", - "CCTPSwitchboardId": "2", - "ContractFactoryPlug": "0x0D85b9835bD1E82baeFcdb12C4D171294c64Afd2", - "FastSwitchboard": "0x375b8c18b57DbAA5146cdCb4a8154Ff2eCc238D6", - "FastSwitchboardId": "1", - "FeesPlug": "0x72e8aba972EEe812d6a5C6Ab13197e884C7D8FA9", - "MessageSwitchboard": "0xb5763dC91FD626786E17b43E8808062a87b037aF", - "MessageSwitchboardId": "3", - "Socket": "0x8d1aAf3c24D221aE30E069136C8B1e305d7668Dc", - "SocketBatcher": "0xD9803F3A7F2b7Ce185daAaC94EFE00B30F0f9fab", - "startBlock": 362517265, - "SwitchboardIdToAddressMap": { - "1": "0x375b8c18b57DbAA5146cdCb4a8154Ff2eCc238D6", - "2": "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", - "3": "0xb5763dC91FD626786E17b43E8808062a87b037aF" - } - }, - "84532": { - "CCTPSwitchboard": "0x23463461b040c3B2DE91ce84e697656de6021636", - "CCTPSwitchboardId": "2", - "ContractFactoryPlug": "0xf740d6b59762fF2547Ed7aD629e041F80E1A3f75", - "FastSwitchboard": "0x81046b8A1752253b214E0EAace04E3927ECbC3cC", - "FastSwitchboardId": "1", - "MessageSwitchboard": "0x72583393DBF61d3dd37b5474AECd73F16A94e7E0", - "MessageSwitchboardId": "3", - "Socket": "0xbD458B2442d1c9a0BA96b12EeAE98dac7843A220", - "SocketBatcher": "0x8aE491E31A5Caba13Cb9468943B2241E3046F0bb", - "startBlock": 28976719, - "SwitchboardIdToAddressMap": { - "1": "0x81046b8A1752253b214E0EAace04E3927ECbC3cC", - "2": "0x23463461b040c3B2DE91ce84e697656de6021636", - "3": "0x72583393DBF61d3dd37b5474AECd73F16A94e7E0" - } - }, - "421614": { - "CCTPSwitchboard": "0xc0D6939719120cBB7e5aBa02bc05dB9A2ECa3ffB", - "CCTPSwitchboardId": "2", - "ContractFactoryPlug": "0xB9590200eB8ED11C6A36D06A633Bff92648F9F10", - "FastSwitchboard": "0x6a3cA5381D2074695b9B17e582eaf90a107D1Dd4", - "FastSwitchboardId": "1", - "MessageSwitchboard": "0xf5450eF55F2396c2cf7A6ee0c6ff63F93701485b", - "MessageSwitchboardId": "3", - "Socket": "0x247d46e6f1E63F323d62f8930775225Aa6f89961", - "SocketBatcher": "0x5F40d9fdc41b56c9E41caB097d68C9F8E49ad2B7", - "startBlock": 178265135, - "SwitchboardIdToAddressMap": { - "1": "0x6a3cA5381D2074695b9B17e582eaf90a107D1Dd4", - "2": "0xc0D6939719120cBB7e5aBa02bc05dB9A2ECa3ffB", - "3": "0xf5450eF55F2396c2cf7A6ee0c6ff63F93701485b" - } - }, - "11155420": { - "CCTPSwitchboard": "0xd044404DA542873c8998BB4E0792BeBFDBf8D870", - "CCTPSwitchboardId": "2", - "ContractFactoryPlug": "0xb5Fb70d981A997240347378f9a6122E76888D325", - "FastSwitchboard": "0x7272e719e2fd5E4fBaA927cfC56431299FcEFe2D", - "FastSwitchboardId": "1", - "MessageSwitchboard": "0x5bFdC07B0302B51BD1c7ac4419D1d03DD120F034", - "MessageSwitchboardId": "3", - "Socket": "0x8e0F811Bc6ec08ffe152f460Ce9e3Ac211c83c69", - "SocketBatcher": "0x1358990F5D91152086854FB3b5137E88ac41004c", - "startBlock": 30959559, - "SwitchboardIdToAddressMap": { - "1": "0x7272e719e2fd5E4fBaA927cfC56431299FcEFe2D", - "2": "0xd044404DA542873c8998BB4E0792BeBFDBf8D870", - "3": "0x5bFdC07B0302B51BD1c7ac4419D1d03DD120F034" - } - } -} +{} \ No newline at end of file diff --git a/deployments/stage_verification.json b/deployments/stage_verification.json index 7851e646..9e26dfee 100644 --- a/deployments/stage_verification.json +++ b/deployments/stage_verification.json @@ -1,16 +1 @@ -{ - "10": [], - "8453": [], - "14323": [ - [ - "0xB7Bf09935108753491E59114dc0B713cDa6F703F", - "AsyncDeployer", - "contracts/evmx/helpers/AsyncDeployer.sol", - [] - ] - ], - "42161": [], - "84532": [], - "421614": [], - "11155420": [] -} +{} \ No newline at end of file diff --git a/hardhat-scripts/addChain/utils.ts b/hardhat-scripts/addChain/utils.ts index 0a7d2c3d..efd7737c 100644 --- a/hardhat-scripts/addChain/utils.ts +++ b/hardhat-scripts/addChain/utils.ts @@ -5,7 +5,7 @@ import { ChainId, ChainType, NativeTokens } from "../../src"; const enumFolderPath = path.join( __dirname, - `/../../src/constants/chain-enums/` + `/../../src/chain-enums/` ); export const updateSDK = async ( diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 44b3a65e..01cd9d10 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -44,16 +44,45 @@ export const getChains = () => { ChainSlug.LINEA, ChainSlug.SONIC, ChainSlug.KATANA, - // ChainSlug.BASE_SEPOLIA, + // ChainSlug.CAMP, + ChainSlug.INK, + ChainSlug.HYPEREVM, + ChainSlug.BERA, + ChainSlug.UNICHAIN, + ChainSlug.SEI, + ChainSlug.PLUME, + ChainSlug.MANTLE, + // ChainSlug.ZKSYNC, + // ChainSlug.FLOW, + // ChainSlug.RISE_TESTNET, ]; case DeploymentMode.STAGE: return [ - ChainSlug.BASE, ChainSlug.ARBITRUM, + ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM, ChainSlug.OPTIMISM_SEPOLIA, - ChainSlug.ARBITRUM_SEPOLIA, + ChainSlug.BASE, ChainSlug.BASE_SEPOLIA, + ChainSlug.BSC, + ChainSlug.POLYGON_MAINNET, + ChainSlug.AVALANCHE, + ChainSlug.GNOSIS, + ChainSlug.LINEA, + ChainSlug.SONIC, + ChainSlug.KATANA, + ChainSlug.MAINNET, + ChainSlug.CAMP, + ChainSlug.INK, + ChainSlug.HYPEREVM, + ChainSlug.BERA, + ChainSlug.UNICHAIN, + ChainSlug.SEI, + ChainSlug.PLUME, + ChainSlug.MANTLE, + ChainSlug.ZKSYNC, + ChainSlug.FLOW, + ChainSlug.RISE_TESTNET, ]; case DeploymentMode.PROD: return [ @@ -74,7 +103,19 @@ export const getFeesPlugChains = (): Array => { case DeploymentMode.DEV: return getChains(); case DeploymentMode.STAGE: - return [ChainSlug.OPTIMISM, ChainSlug.ARBITRUM, ChainSlug.BASE]; + return [ + ChainSlug.OPTIMISM, + ChainSlug.ARBITRUM, + ChainSlug.BASE, + ChainSlug.AVALANCHE, + ChainSlug.BSC, + ChainSlug.MAINNET, + ChainSlug.LINEA, + ChainSlug.POLYGON_MAINNET, + ChainSlug.SEI, + ChainSlug.SONIC, + ChainSlug.UNICHAIN, + ]; case DeploymentMode.PROD: return getChains(); default: @@ -86,13 +127,49 @@ export const testnetChains: Array = [ ChainSlug.OPTIMISM_SEPOLIA, ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.BASE_SEPOLIA, + ChainSlug.RISE_TESTNET, ]; export const mainnetChains: Array = [ + ChainSlug.MAINNET, ChainSlug.OPTIMISM, ChainSlug.ARBITRUM, ChainSlug.BASE, + ChainSlug.BSC, + ChainSlug.POLYGON_MAINNET, + ChainSlug.AVALANCHE, + ChainSlug.GNOSIS, + ChainSlug.LINEA, + ChainSlug.SONIC, + ChainSlug.KATANA, + ChainSlug.CAMP, + ChainSlug.INK, + ChainSlug.HYPEREVM, + ChainSlug.BERA, + ChainSlug.UNICHAIN, + ChainSlug.SEI, + ChainSlug.PLUME, + ChainSlug.MANTLE, + ChainSlug.ZKSYNC, + ChainSlug.FLOW, ]; +export const IndexerHighChains: Array = [ + ChainSlug.MAINNET, + ChainSlug.OPTIMISM, + ChainSlug.ARBITRUM, + ChainSlug.BASE, + ChainSlug.BSC, + ChainSlug.POLYGON_MAINNET, + ChainSlug.AVALANCHE, + ChainSlug.BERA, + ChainSlug.UNICHAIN, + ChainSlug.SONIC, +]; + +export const IndexerLowChains: Array = getChains().filter( + (chain) => !IndexerHighChains.includes(chain) +); + export const chains: Array = getChains(); export const EVM_CHAIN_ID_MAP: Record = { [DeploymentMode.LOCAL]: 7625382, diff --git a/hardhat-scripts/s3Config/buildConfig.ts b/hardhat-scripts/s3Config/buildConfig.ts index 8e7bceac..33a75aed 100644 --- a/hardhat-scripts/s3Config/buildConfig.ts +++ b/hardhat-scripts/s3Config/buildConfig.ts @@ -1,7 +1,9 @@ import { config as dotenvConfig } from "dotenv"; -import { ChainConfig, ChainSlug, S3Config, getFinalityBlocks } from "../../src"; +import { ChainConfig, ChainSlug, Currency, NativeTokens, S3Config, getFinalityBlocks } from "../../src"; import { EVMX_CHAIN_ID, + IndexerHighChains, + IndexerLowChains, chains, mainnetChains, mode, @@ -25,6 +27,8 @@ export const getS3Config = () => { testnetChainSlugs: testnetChains, mainnetChainSlugs: mainnetChains, evmxChainSlug: EVMX_CHAIN_ID as ChainSlug, + indexerHighChains: IndexerHighChains, + indexerLowChains: IndexerLowChains, }; supportedChainSlugs.forEach((chainSlug) => { config.chains[chainSlug] = getChainConfig(chainSlug); @@ -49,6 +53,7 @@ export const getChainConfig = (chainSlug: ChainSlug) => { addresses: addresses[chainSlug], chainType: getChainType(chainSlug), finalityBlocks: getFinalityBlocks(chainSlug), + nativeToken: Currency[chainSlug] ?? NativeTokens.ETHEREUM, }; return chainConfig; }; diff --git a/package.json b/package.json index 4737ae41..beb9caa4 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.1.43", + "version": "1.1.45", "description": "socket protocol", "scripts": { "build": "yarn abi && tsc --project lib.tsconfig.json", diff --git a/setupInfraContracts.sh b/setupInfraContracts.sh index c08fed42..064d5b50 100644 --- a/setupInfraContracts.sh +++ b/setupInfraContracts.sh @@ -16,4 +16,7 @@ time npx hardhat run hardhat-scripts/misc-scripts/eventTopics.ts --no-compile time npx hardhat run hardhat-scripts/misc-scripts/functionSigs.ts --no-compile time npx ts-node hardhat-scripts/misc-scripts/createLabels.ts time npx hardhat run hardhat-scripts/verify/verify.ts --no-compile + +# time npx hardhat run hardhat-scripts/deploy/deployTestUSDC.ts --no-compile + yarn lint \ No newline at end of file diff --git a/src/chain-enums/chainId.ts b/src/chain-enums/chainId.ts index 4e1f4fd8..c02af505 100644 --- a/src/chain-enums/chainId.ts +++ b/src/chain-enums/chainId.ts @@ -75,4 +75,8 @@ export enum ChainId { SONEIUM = 1868, SWELLCHAIN = 1923, WORLD_CHAIN = 480, + FLOW = 747, + CAMP = 484, + PLUME = 98866, + RISE_TESTNET = 11155931, } diff --git a/src/chain-enums/chainSlug.ts b/src/chain-enums/chainSlug.ts index e541c94f..c0d9089e 100644 --- a/src/chain-enums/chainSlug.ts +++ b/src/chain-enums/chainSlug.ts @@ -77,4 +77,8 @@ export enum ChainSlug { SONEIUM = ChainId.SONEIUM, SWELLCHAIN = ChainId.SWELLCHAIN, WORLD_CHAIN = ChainId.WORLD_CHAIN, + FLOW = ChainId.FLOW, + CAMP = ChainId.CAMP, + PLUME = ChainId.PLUME, + RISE_TESTNET = ChainId.RISE_TESTNET, } diff --git a/src/chain-enums/chainSlugToHardhatChainName.ts b/src/chain-enums/chainSlugToHardhatChainName.ts index b7c043e0..e1735dab 100644 --- a/src/chain-enums/chainSlugToHardhatChainName.ts +++ b/src/chain-enums/chainSlugToHardhatChainName.ts @@ -76,4 +76,8 @@ export const chainSlugToHardhatChainName = { [ChainSlug.KATANA]: HardhatChainName.KATANA, [ChainSlug.HYPEREVM]: HardhatChainName.HYPEREVM, [ChainSlug.SEI]: HardhatChainName.SEI, + [ChainSlug.FLOW]: HardhatChainName.FLOW, + [ChainSlug.CAMP]: HardhatChainName.CAMP, + [ChainSlug.PLUME]: HardhatChainName.PLUME, + [ChainSlug.RISE_TESTNET]: HardhatChainName.RISE_TESTNET, }; diff --git a/src/chain-enums/chainSlugToId.ts b/src/chain-enums/chainSlugToId.ts index 07b27268..2b16dd4a 100644 --- a/src/chain-enums/chainSlugToId.ts +++ b/src/chain-enums/chainSlugToId.ts @@ -60,4 +60,8 @@ export const ChainSlugToId = { [ChainSlug.ZERO_SEPOLIA]: ChainId.ZERO_SEPOLIA, [ChainSlug.INTEROP_ALPHA_0]: ChainId.INTEROP_ALPHA_0, [ChainSlug.INTEROP_ALPHA_1]: ChainId.INTEROP_ALPHA_1, + [ChainSlug.FLOW]: ChainId.FLOW, + [ChainSlug.CAMP]: ChainId.CAMP, + [ChainSlug.PLUME]: ChainId.PLUME, + [ChainSlug.RISE_TESTNET]: ChainId.RISE_TESTNET, }; diff --git a/src/chain-enums/chainSlugToKey.ts b/src/chain-enums/chainSlugToKey.ts index d4833da2..4f5918e1 100644 --- a/src/chain-enums/chainSlugToKey.ts +++ b/src/chain-enums/chainSlugToKey.ts @@ -76,4 +76,8 @@ export const ChainSlugToKey = { [ChainSlug.KATANA]: HardhatChainName.KATANA, [ChainSlug.HYPEREVM]: HardhatChainName.HYPEREVM, [ChainSlug.SEI]: HardhatChainName.SEI, + [ChainSlug.FLOW]: HardhatChainName.FLOW, + [ChainSlug.CAMP]: HardhatChainName.CAMP, + [ChainSlug.PLUME]: HardhatChainName.PLUME, + [ChainSlug.RISE_TESTNET]: HardhatChainName.RISE_TESTNET, }; diff --git a/src/chain-enums/currency.ts b/src/chain-enums/currency.ts index 1f9448db..202ac2ca 100644 --- a/src/chain-enums/currency.ts +++ b/src/chain-enums/currency.ts @@ -2,21 +2,28 @@ import { ChainSlug } from "./chainSlug"; import { NativeTokens } from "./native-tokens"; export const Currency = { - [ChainSlug.BSC]: NativeTokens.binancecoin, - [ChainSlug.POLYGON_MAINNET]: NativeTokens["matic-network"], - [ChainSlug.SX_NETWORK_TESTNET]: NativeTokens["sx-network-2"], - [ChainSlug.SX_NETWORK]: NativeTokens["sx-network-2"], - [ChainSlug.MANTLE]: NativeTokens.mantle, - [ChainSlug.BSC_TESTNET]: NativeTokens["binancecoin"], - [ChainSlug.WINR]: NativeTokens["winr"], - [ChainSlug.NEOX_TESTNET]: NativeTokens["gas"], - [ChainSlug.NEOX_T4_TESTNET]: NativeTokens["gas"], - [ChainSlug.NEOX]: NativeTokens["gas"], - [ChainSlug.GNOSIS]: NativeTokens["dai"], - [ChainSlug.AVALANCHE]: NativeTokens["avalanche-2"], - [ChainSlug.XLAYER]: NativeTokens["okb"], - [ChainSlug.POLTER_TESTNET]: NativeTokens["aavegotchi"], - [ChainSlug.POLYGON_AMOY]: NativeTokens["matic-network"], - [ChainSlug.OPBNB]: NativeTokens["binancecoin"], - [ChainSlug.GEIST]: NativeTokens["aavegotchi"], + [ChainSlug.BSC]: NativeTokens.BINANCECOIN, + [ChainSlug.POLYGON_MAINNET]: NativeTokens.MATIC_NETWORK, + [ChainSlug.SX_NETWORK_TESTNET]: NativeTokens.SX_NETWORK_2, + [ChainSlug.SX_NETWORK]: NativeTokens.SX_NETWORK_2, + [ChainSlug.MANTLE]: NativeTokens.MANTLE, + [ChainSlug.BSC_TESTNET]: NativeTokens.BINANCECOIN, + [ChainSlug.WINR]: NativeTokens.WINR, + [ChainSlug.NEOX_TESTNET]: NativeTokens.GAS, + [ChainSlug.NEOX_T4_TESTNET]: NativeTokens.GAS, + [ChainSlug.NEOX]: NativeTokens.GAS, + [ChainSlug.GNOSIS]: NativeTokens.DAI, + [ChainSlug.AVALANCHE]: NativeTokens.AVALANCHE_2, + [ChainSlug.XLAYER]: NativeTokens.OKB, + [ChainSlug.POLTER_TESTNET]: NativeTokens.AAVEGOTCHI, + [ChainSlug.POLYGON_AMOY]: NativeTokens.MATIC_NETWORK, + [ChainSlug.OPBNB]: NativeTokens.BINANCECOIN, + [ChainSlug.GEIST]: NativeTokens.AAVEGOTCHI, + [ChainSlug.SONIC]: NativeTokens.SONIC_3, + [ChainSlug.HYPEREVM]: NativeTokens.HYPERLIQUID, + [ChainSlug.SEI]: NativeTokens.WRAPPED_SEI, + [ChainSlug.BERA]: NativeTokens.BERACHAIN_BERA, + [ChainSlug.FLOW]: NativeTokens.FLOW, + [ChainSlug.CAMP]: NativeTokens.CAMP_NETWORK, + [ChainSlug.PLUME]: NativeTokens.PLUME, }; diff --git a/src/chain-enums/ethLikeChains.ts b/src/chain-enums/ethLikeChains.ts index dde62f66..658c5663 100644 --- a/src/chain-enums/ethLikeChains.ts +++ b/src/chain-enums/ethLikeChains.ts @@ -26,4 +26,8 @@ export const ethLikeChains = [ ChainSlug.POLYGON_AMOY, ChainSlug.INTEROP_ALPHA_0, ChainSlug.INTEROP_ALPHA_1, -]; + ChainSlug.FLOW, + ChainSlug.CAMP, + ChainSlug.PLUME, + ChainSlug.RISE_TESTNET, +]; \ No newline at end of file diff --git a/src/chain-enums/hardhatChainName.ts b/src/chain-enums/hardhatChainName.ts index fb8c1a41..ebf5a4e7 100644 --- a/src/chain-enums/hardhatChainName.ts +++ b/src/chain-enums/hardhatChainName.ts @@ -73,4 +73,8 @@ export enum HardhatChainName { KATANA = "katana", HYPEREVM = "hyperevm", SEI = "sei", + FLOW = "flow", + CAMP = "camp", + PLUME = "plume", + RISE_TESTNET = "rise_testnet", } diff --git a/src/chain-enums/hardhatChainNameToSlug.ts b/src/chain-enums/hardhatChainNameToSlug.ts index e63a8876..b4fb455a 100644 --- a/src/chain-enums/hardhatChainNameToSlug.ts +++ b/src/chain-enums/hardhatChainNameToSlug.ts @@ -76,4 +76,8 @@ export const hardhatChainNameToSlug = { [HardhatChainName.KATANA]: ChainSlug.KATANA, [HardhatChainName.HYPEREVM]: ChainSlug.HYPEREVM, [HardhatChainName.SEI]: ChainSlug.SEI, + [HardhatChainName.FLOW]: ChainSlug.FLOW, + [HardhatChainName.CAMP]: ChainSlug.CAMP, + [HardhatChainName.PLUME]: ChainSlug.PLUME, + [HardhatChainName.RISE_TESTNET]: ChainSlug.RISE_TESTNET, }; diff --git a/src/chain-enums/mainnetIds.ts b/src/chain-enums/mainnetIds.ts index eaaeced7..e61c0448 100644 --- a/src/chain-enums/mainnetIds.ts +++ b/src/chain-enums/mainnetIds.ts @@ -29,4 +29,25 @@ export const MainnetIds: ChainSlug[] = [ ChainSlug.MANTA_PACIFIC, ChainSlug.OPBNB, ChainSlug.GEIST, + ChainSlug.FLOW, + ChainSlug.CAMP, + ChainSlug.PLUME, + ChainSlug.SONIC, + ChainSlug.KATANA, + ChainSlug.HYPEREVM, + ChainSlug.SEI, + ChainSlug.ZERO, + ChainSlug.ZKSYNC, + ChainSlug.ARENA_Z, + ChainSlug.INK, + ChainSlug.BERA, + ChainSlug.B3, + ChainSlug.UNICHAIN, + ChainSlug.SCROLL, + ChainSlug.SONEIUM, + ChainSlug.SWELLCHAIN, + ChainSlug.WORLD_CHAIN, + ChainSlug.FLOW, + ChainSlug.CAMP, + ChainSlug.PLUME, ]; diff --git a/src/chain-enums/native-tokens.ts b/src/chain-enums/native-tokens.ts index 1e70d1bf..4869ac28 100644 --- a/src/chain-enums/native-tokens.ts +++ b/src/chain-enums/native-tokens.ts @@ -1,15 +1,24 @@ // add coingecko token id here export enum NativeTokens { - "ethereum" = "ethereum", - "matic-network" = "matic-network", - "binancecoin" = "binancecoin", - "sx-network-2" = "sx-network-2", - "mantle" = "mantle", - "winr" = "winr-protocol", - "no-token" = "no-token", - "gas" = "gas", - "dai" = "dai", - "avalanche-2" = "avalanche-2", - "okb" = "okb", - "aavegotchi" = "aavegotchi", + ETHEREUM = "ethereum", + MATIC_NETWORK = "matic-network", + BINANCECOIN = "binancecoin", + SX_NETWORK_2 = "sx-network-2", + MANTLE = "mantle", + WINR = "winr-protocol", + NO_TOKEN = "no-token", + GAS = "gas", + DAI = "dai", + XDAI = "xdai", + AVALANCHE_2 = "avalanche-2", + OKB = "okb", + AAVEGOTCHI = "aavegotchi", + POLYGON_ECOSYSTEM_TOKEN = "polygon-ecosystem-token", + SONIC_3 = "sonic-3", + HYPERLIQUID = "hyperliquid", + WRAPPED_SEI = "wrapped-sei", + BERACHAIN_BERA = "berachain-bera", + PLUME = "plume", + CAMP_NETWORK = "camp-network", + FLOW = "flow", } diff --git a/src/chain-enums/testnetIds.ts b/src/chain-enums/testnetIds.ts index efe3e6d4..beed80c4 100644 --- a/src/chain-enums/testnetIds.ts +++ b/src/chain-enums/testnetIds.ts @@ -30,4 +30,6 @@ export const TestnetIds: ChainSlug[] = [ ChainSlug.BASE_SEPOLIA, ChainSlug.INTEROP_ALPHA_0, ChainSlug.INTEROP_ALPHA_1, + ChainSlug.MONAD_TESTNET, + ChainSlug.RISE_TESTNET, ]; diff --git a/src/types.ts b/src/types.ts index 087ab640..ee5373f3 100644 --- a/src/types.ts +++ b/src/types.ts @@ -58,6 +58,8 @@ export type S3Config = { testnetChainSlugs: number[]; evmxChainSlug: number; mainnetChainSlugs: number[]; + indexerHighChains: number[]; + indexerLowChains: number[]; }; export type ChainConfig = { @@ -69,6 +71,7 @@ export type ChainConfig = { addresses: ChainAddressesObj | EVMxAddressesObj; finalityBlocks: ChainFinalityBlocks; chainType: ChainType; + nativeToken: string; }; export { FinalityBucket }; From 52014054d57abe42842b354eb1b61935c404ea77 Mon Sep 17 00:00:00 2001 From: Akash Date: Sat, 13 Sep 2025 22:16:45 +0530 Subject: [PATCH 114/139] feat: new deployments --- deployments/dev_addresses.json | 72 ++++ deployments/dev_verification.json | 438 +++++++++++++++++++++- foundry.toml | 11 +- hardhat-scripts/addChain/utils.ts | 5 +- hardhat-scripts/config/config.ts | 5 +- hardhat-scripts/constants/feeConstants.ts | 56 +++ hardhat-scripts/utils/overrides.ts | 14 +- src/chain-enums/currency.ts | 6 +- 8 files changed, 577 insertions(+), 30 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 42418476..95c00a2c 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -25,6 +25,19 @@ "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" } }, + "130": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "startBlock": 27026358, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + } + }, "137": { "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", @@ -51,6 +64,35 @@ "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" } }, + "999": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "startBlock": 13754196, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD" + }, + "1329": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "startBlock": 167855363, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + } + }, + "5000": { + "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD" + }, "8453": { "CCTPSwitchboard": "0xae59BA0Bd0D92232B3B6304185448C9Fe5445f4d", "ContractFactoryPlug": "0xfE555AD869ac24305471F0755976c556425E8D23", @@ -107,6 +149,19 @@ "1": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD" } }, + "57073": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "startBlock": 24276129, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + } + }, "59144": { "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", "FastSwitchboard": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", @@ -120,6 +175,19 @@ "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" } }, + "80094": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "startBlock": 10433014, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + } + }, "84532": { "CCTPSwitchboard": "0x9175d90706a2b17f0aE025ce5A6C76e64850c2f5", "ContractFactoryPlug": "0xf8a9d637cd6fAf3d4C17277DceadbEE69d7752f0", @@ -135,6 +203,10 @@ "1": "0xE09CC429e77EE5DBeF68f3796b2A33BBDF39C03C" } }, + "98866": { + "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" + }, "421614": { "CCTPSwitchboard": "0x0355064bBb553A3765af498004749fB2e19284c0", "CCTPSwitchboardId": "2", diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 258e9600..8f5d850e 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -53,7 +53,11 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [56, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 56, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "100": [ @@ -110,7 +114,72 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [100, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 100, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "130": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 130, + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "Socket", + "contracts/protocol/Socket.sol", + [ + 130, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "137": [ @@ -167,7 +236,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [137, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 137, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "146": [ @@ -224,7 +297,185 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [146, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 146, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "999": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 999, + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "Socket", + "contracts/protocol/Socket.sol", + [ + 999, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "1329": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 1329, + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "Socket", + "contracts/protocol/Socket.sol", + [ + 1329, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "5000": [ + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 5000, + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "Socket", + "contracts/protocol/Socket.sol", + [ + 5000, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "8453": [ @@ -302,7 +553,11 @@ "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", "Socket", "contracts/protocol/Socket.sol", - [8453, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 8453, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "14323": [ @@ -400,7 +655,11 @@ "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", "Socket", "contracts/protocol/Socket.sol", - [43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 43114, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ], [ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", @@ -415,7 +674,72 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 43114, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "57073": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 57073, + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "Socket", + "contracts/protocol/Socket.sol", + [ + 57073, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "59144": [ @@ -472,7 +796,72 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [59144, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 59144, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "80094": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 80094, + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "Socket", + "contracts/protocol/Socket.sol", + [ + 80094, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "84532": [ @@ -550,7 +939,32 @@ "0x22B521c3610D373Ea29698215eB78907Ad98B644", "Socket", "contracts/protocol/Socket.sol", - [84532, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 84532, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] + ] + ], + "98866": [ + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "Socket", + "contracts/protocol/Socket.sol", + [ + 98866, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "421614": [], @@ -608,7 +1022,11 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [747474, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 747474, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "11155420": [] diff --git a/foundry.toml b/foundry.toml index 69196b42..64ee9359 100644 --- a/foundry.toml +++ b/foundry.toml @@ -30,14 +30,7 @@ via_ir = false 0xe75f36466466D1383AC98ecfC627Ab49440C46c9 = "RequestHandlerImpl" 0x4660c5fF2762E688f8D0def828ad161AE4940F57 = "SchedulePrecompile" 0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d = "Watcher" -0xfbb565A9Be17546628ED2cdCa43000758a7b5dDe = "WatcherImpl" +0xc7837f8dC93335d203DaBCb0c35dC401Ade9F1B3 = "WatcherImpl" 0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15 = "WritePrecompile" 0x52BfcB9bD0f1a387f28608C01cE8123310Ce3199 = "WritePrecompileImpl" -0x56EaDAC97B54C0c7979Bd620cad389eC3476dB43 = "CCTPSwitchboard" -0x253be2E93EadAD9D2802D83A26eE62E911F1E3fe = "ContractFactoryPlug" -0x2cC155961F225AbFF5e64F4a8f9C4f59b2339172 = "FastSwitchboard" -0x83Ad3d17493Bdc31C60344021CA93E8dD3666A2A = "FeesPlug" -0x9efC6D7050eF4F5b12205A32ceE49F456FFB6FA8 = "MessageSwitchboard" -0x631f1E974442d6d51B626cE27d0D7629F1C0aB38 = "Socket" -0x4b2942C43579C3a9405887CDFA2F2048a5bE91EE = "SocketBatcher" -0x40F2CfE35134141F809582ad121BF23522b5Dd22 = "SUSDC" +0xE776ef8fcE29F8E232692C133867fBcBaEB52DbD = "APP_GATEWAY" diff --git a/hardhat-scripts/addChain/utils.ts b/hardhat-scripts/addChain/utils.ts index efd7737c..0df31977 100644 --- a/hardhat-scripts/addChain/utils.ts +++ b/hardhat-scripts/addChain/utils.ts @@ -3,10 +3,7 @@ import path from "path"; import { ChainId, ChainType, NativeTokens } from "../../src"; -const enumFolderPath = path.join( - __dirname, - `/../../src/chain-enums/` -); +const enumFolderPath = path.join(__dirname, `/../../src/chain-enums/`); export const updateSDK = async ( chainName: string, diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 01cd9d10..b2f8d9bf 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -46,12 +46,11 @@ export const getChains = () => { ChainSlug.KATANA, // ChainSlug.CAMP, ChainSlug.INK, - ChainSlug.HYPEREVM, + // ChainSlug.HYPEREVM, ChainSlug.BERA, ChainSlug.UNICHAIN, ChainSlug.SEI, - ChainSlug.PLUME, - ChainSlug.MANTLE, + // ChainSlug.MANTLE, // ChainSlug.ZKSYNC, // ChainSlug.FLOW, // ChainSlug.RISE_TESTNET, diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index d0b75328..b234eb32 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -110,6 +110,62 @@ export const tokens: TokenMap = { decimals: 6, }, ], + [ChainSlug.INK]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + decimals: 6, + }, + ], + [ChainSlug.HYPEREVM]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + decimals: 6, + }, + ], + [ChainSlug.BERA]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + decimals: 6, + }, + ], + [ChainSlug.UNICHAIN]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + decimals: 6, + }, + ], + [ChainSlug.SEI]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + decimals: 6, + }, + ], + [ChainSlug.PLUME]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + decimals: 6, + }, + ], + [ChainSlug.MANTLE]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + decimals: 6, + }, + ], }, [DeploymentMode.STAGE]: { 8453: [ diff --git a/hardhat-scripts/utils/overrides.ts b/hardhat-scripts/utils/overrides.ts index dcc401bd..bc073c19 100644 --- a/hardhat-scripts/utils/overrides.ts +++ b/hardhat-scripts/utils/overrides.ts @@ -2,6 +2,7 @@ import { ChainSlug } from "../../src"; import { BigNumber, BigNumberish, Contract, providers, Signer } from "ethers"; import { EVMX_CHAIN_ID } from "../config/config"; import { getProviderFromChainSlug } from "./networks"; +import { parseUnits } from "ethers/lib/utils"; const defaultType = 0; const DEFAULT_GAS_PRICE_MULTIPLIER = 1.05; @@ -9,7 +10,7 @@ const DEFAULT_GAS_PRICE_MULTIPLIER = 1.05; type ChainOverride = { type?: number; gasLimit?: number; - gasPrice?: number; + gasPrice?: BigNumberish; gasPriceMultiplier?: number; }; @@ -65,6 +66,17 @@ export const chainOverrides: { [ChainSlug.ARBITRUM]: { gasPrice: 100_629_157, }, + [ChainSlug.SEI]: { + gasLimit: 3_000_000, + }, + [ChainSlug.HYPEREVM]: { + gasLimit: 1_000_000, + }, + [ChainSlug.MANTLE]: { + gasLimit: 1_000_551_690, + gasPrice: parseUnits("0.03", "gwei"), + }, + [EVMX_CHAIN_ID as ChainSlug]: { // type: 0, // // gasLimit: 1_000_000_000, diff --git a/src/chain-enums/currency.ts b/src/chain-enums/currency.ts index 202ac2ca..ef05435f 100644 --- a/src/chain-enums/currency.ts +++ b/src/chain-enums/currency.ts @@ -4,7 +4,7 @@ import { NativeTokens } from "./native-tokens"; export const Currency = { [ChainSlug.BSC]: NativeTokens.BINANCECOIN, [ChainSlug.POLYGON_MAINNET]: NativeTokens.MATIC_NETWORK, - [ChainSlug.SX_NETWORK_TESTNET]: NativeTokens.SX_NETWORK_2, + [ChainSlug.SX_NETWORK_TESTNET]: NativeTokens.SX_NETWORK_2, [ChainSlug.SX_NETWORK]: NativeTokens.SX_NETWORK_2, [ChainSlug.MANTLE]: NativeTokens.MANTLE, [ChainSlug.BSC_TESTNET]: NativeTokens.BINANCECOIN, @@ -13,10 +13,10 @@ export const Currency = { [ChainSlug.NEOX_T4_TESTNET]: NativeTokens.GAS, [ChainSlug.NEOX]: NativeTokens.GAS, [ChainSlug.GNOSIS]: NativeTokens.DAI, - [ChainSlug.AVALANCHE]: NativeTokens.AVALANCHE_2, + [ChainSlug.AVALANCHE]: NativeTokens.AVALANCHE_2, [ChainSlug.XLAYER]: NativeTokens.OKB, [ChainSlug.POLTER_TESTNET]: NativeTokens.AAVEGOTCHI, - [ChainSlug.POLYGON_AMOY]: NativeTokens.MATIC_NETWORK, + [ChainSlug.POLYGON_AMOY]: NativeTokens.MATIC_NETWORK, [ChainSlug.OPBNB]: NativeTokens.BINANCECOIN, [ChainSlug.GEIST]: NativeTokens.AAVEGOTCHI, [ChainSlug.SONIC]: NativeTokens.SONIC_3, From 74d69457fd3036367312f115e2c6a709f367ffd3 Mon Sep 17 00:00:00 2001 From: Akash Date: Sat, 13 Sep 2025 22:30:11 +0530 Subject: [PATCH 115/139] feat: added hyperevm --- deployments/dev_addresses.json | 6 +++++- hardhat-scripts/config/config.ts | 10 ++++------ hardhat-scripts/deploy/1.deploy.ts | 5 +++++ hardhat-scripts/s3Config/buildConfig.ts | 11 +++++++++-- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 95c00a2c..86dfccbb 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -67,11 +67,15 @@ "999": { "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboardId": "1", "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", "startBlock": 13754196, - "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD" + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + } }, "1329": { "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index b2f8d9bf..cacade80 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -44,19 +44,19 @@ export const getChains = () => { ChainSlug.LINEA, ChainSlug.SONIC, ChainSlug.KATANA, - // ChainSlug.CAMP, ChainSlug.INK, - // ChainSlug.HYPEREVM, + ChainSlug.HYPEREVM, ChainSlug.BERA, ChainSlug.UNICHAIN, ChainSlug.SEI, // ChainSlug.MANTLE, - // ChainSlug.ZKSYNC, + // ChainSlug.CAMP, // ChainSlug.FLOW, // ChainSlug.RISE_TESTNET, ]; case DeploymentMode.STAGE: return [ + ChainSlug.MAINNET, ChainSlug.ARBITRUM, ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM, @@ -70,16 +70,13 @@ export const getChains = () => { ChainSlug.LINEA, ChainSlug.SONIC, ChainSlug.KATANA, - ChainSlug.MAINNET, ChainSlug.CAMP, ChainSlug.INK, ChainSlug.HYPEREVM, ChainSlug.BERA, ChainSlug.UNICHAIN, ChainSlug.SEI, - ChainSlug.PLUME, ChainSlug.MANTLE, - ChainSlug.ZKSYNC, ChainSlug.FLOW, ChainSlug.RISE_TESTNET, ]; @@ -182,6 +179,7 @@ export const watcher = "0xb62505feacC486e809392c65614Ce4d7b051923b"; export const transmitter = "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320"; export const socketOwner = "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18"; +export const skipEVMXDeployment = true; // Chain config export const EVMX_CHAIN_ID = EVM_CHAIN_ID_MAP[mode]; export const MAX_MSG_VALUE_LIMIT = ethers.utils.parseEther("0.001"); diff --git a/hardhat-scripts/deploy/1.deploy.ts b/hardhat-scripts/deploy/1.deploy.ts index d01951fe..35db34d6 100644 --- a/hardhat-scripts/deploy/1.deploy.ts +++ b/hardhat-scripts/deploy/1.deploy.ts @@ -22,6 +22,7 @@ import { READ_FEES, SCHEDULE_CALLBACK_FEES, SCHEDULE_FEES_PER_SECOND, + skipEVMXDeployment, TRIGGER_FEES, WRITE_FEES, } from "../config/config"; @@ -75,6 +76,10 @@ const logBalances = async () => { const deployEVMxContracts = async () => { try { + if (skipEVMXDeployment) { + console.log("Skipping EVMx deployment"); + return; + } let addresses: DeploymentAddresses; let deployUtils: DeployParams = { addresses: {} as ChainAddressesObj, diff --git a/hardhat-scripts/s3Config/buildConfig.ts b/hardhat-scripts/s3Config/buildConfig.ts index 33a75aed..43970a26 100644 --- a/hardhat-scripts/s3Config/buildConfig.ts +++ b/hardhat-scripts/s3Config/buildConfig.ts @@ -1,5 +1,12 @@ import { config as dotenvConfig } from "dotenv"; -import { ChainConfig, ChainSlug, Currency, NativeTokens, S3Config, getFinalityBlocks } from "../../src"; +import { + ChainConfig, + ChainSlug, + Currency, + NativeTokens, + S3Config, + getFinalityBlocks, +} from "../../src"; import { EVMX_CHAIN_ID, IndexerHighChains, @@ -28,7 +35,7 @@ export const getS3Config = () => { mainnetChainSlugs: mainnetChains, evmxChainSlug: EVMX_CHAIN_ID as ChainSlug, indexerHighChains: IndexerHighChains, - indexerLowChains: IndexerLowChains, + indexerLowChains: IndexerLowChains, }; supportedChainSlugs.forEach((chainSlug) => { config.chains[chainSlug] = getChainConfig(chainSlug); From 55b3bb07f56ace4dce3920d8503dc64f66d781ea Mon Sep 17 00:00:00 2001 From: Akash Date: Tue, 16 Sep 2025 00:11:17 +0530 Subject: [PATCH 116/139] feat: stage deployed --- .gitignore | 2 + deployments/dev_addresses.json | 47 ++- deployments/dev_verification.json | 276 +++++++++----- deployments/stage_addresses.json | 101 +++++- deployments/stage_verification.json | 381 +++++++++++++++++++- hardhat-scripts/config/config.ts | 45 +-- hardhat-scripts/constants/feeConstants.ts | 25 ++ hardhat-scripts/deploy/2.roles.ts | 25 +- hardhat-scripts/deploy/3.configureChains.ts | 9 +- hardhat-scripts/deploy/6.connect.ts | 23 +- hardhat-scripts/test/chainTest.ts | 349 ++++++++++++++++++ hardhat-scripts/test/gas-fees.ts | 64 ++++ hardhat-scripts/utils/appConfig.ts | 16 +- hardhat-scripts/utils/overrides.ts | 6 +- package.json | 1 + src/chain-enums/native-tokens.ts | 1 + src/chain-enums/opStackChains.ts | 2 + 17 files changed, 1238 insertions(+), 135 deletions(-) create mode 100644 hardhat-scripts/test/chainTest.ts create mode 100644 hardhat-scripts/test/gas-fees.ts diff --git a/.gitignore b/.gitignore index ee1c88c5..86c4727c 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ testScript.sh CLAUDE.md .idea/ + +hardhat-scripts/loadTest/* \ No newline at end of file diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 86dfccbb..4bece330 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -1,4 +1,17 @@ { + "1": { + "ContractFactoryPlug": "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", + "FastSwitchboard": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FastSwitchboardId": "1", + "FeesPlug": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "Socket": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "startBlock": 23368199, + "SUSDC": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "SwitchboardIdToAddressMap": { + "1": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d" + } + }, "56": { "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", "FastSwitchboard": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", @@ -64,6 +77,32 @@ "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" } }, + "484": { + "ContractFactoryPlug": "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", + "FastSwitchboard": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FastSwitchboardId": "1", + "FeesPlug": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "Socket": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "startBlock": 6540991, + "SUSDC": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "SwitchboardIdToAddressMap": { + "1": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d" + } + }, + "747": { + "ContractFactoryPlug": "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", + "FastSwitchboard": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FastSwitchboardId": "1", + "FeesPlug": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "Socket": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "startBlock": 40319172, + "SUSDC": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "SwitchboardIdToAddressMap": { + "1": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d" + } + }, "999": { "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", @@ -91,11 +130,17 @@ } }, "5000": { + "ContractFactoryPlug": "0xeAb2e310A53FD3Fb34C2944690a79DFB2e834F20", "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboardId": "1", "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", - "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD" + "startBlock": 84906616, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + } }, "8453": { "CCTPSwitchboard": "0xae59BA0Bd0D92232B3B6304185448C9Fe5445f4d", diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 8f5d850e..a33e82ad 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1,4 +1,61 @@ { + "1": [ + [ + "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 1, + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "Socket", + "contracts/protocol/Socket.sol", + [1, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], "56": [ [ "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", @@ -53,11 +110,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 56, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [56, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "100": [ @@ -114,11 +167,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 100, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [100, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "130": [ @@ -175,11 +224,7 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [ - 130, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [130, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "137": [ @@ -236,11 +281,7 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [ - 137, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [137, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "146": [ @@ -297,11 +338,121 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", + [146, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], + "484": [ + [ + "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 484, + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "Socket", + "contracts/protocol/Socket.sol", + [484, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], + "747": [ + [ + "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 747, + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", [ - 146, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "Socket", + "contracts/protocol/Socket.sol", + [747, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "999": [ @@ -358,11 +509,7 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [ - 999, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [999, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "1329": [ @@ -419,14 +566,19 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [ - 1329, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [1329, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "5000": [ + [ + "0xeAb2e310A53FD3Fb34C2944690a79DFB2e834F20", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], [ "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", "SUSDC", @@ -471,11 +623,7 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [ - 5000, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [5000, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "8453": [ @@ -553,11 +701,7 @@ "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", "Socket", "contracts/protocol/Socket.sol", - [ - 8453, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [8453, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "14323": [ @@ -655,11 +799,7 @@ "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", "Socket", "contracts/protocol/Socket.sol", - [ - 43114, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ], [ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", @@ -674,11 +814,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 43114, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "57073": [ @@ -735,11 +871,7 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [ - 57073, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [57073, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "59144": [ @@ -796,11 +928,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 59144, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [59144, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "80094": [ @@ -857,11 +985,7 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [ - 80094, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [80094, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "84532": [ @@ -939,11 +1063,7 @@ "0x22B521c3610D373Ea29698215eB78907Ad98B644", "Socket", "contracts/protocol/Socket.sol", - [ - 84532, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [84532, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "98866": [ @@ -960,11 +1080,7 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [ - 98866, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [98866, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "421614": [], @@ -1022,11 +1138,7 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [ - 747474, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] + [747474, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], "11155420": [] diff --git a/deployments/stage_addresses.json b/deployments/stage_addresses.json index 9e26dfee..f75d720d 100644 --- a/deployments/stage_addresses.json +++ b/deployments/stage_addresses.json @@ -1 +1,100 @@ -{} \ No newline at end of file +{ + "10": { + "ContractFactoryPlug": "0xC559BABEbcD92278E91a545308190E4761efc347", + "FastSwitchboard": "0xD78f99D62BeaF0918bB0601C68EB537b6703Ce63", + "FastSwitchboardId": "1", + "FeesPlug": "0xA557EBE094F939ae6eE8F18c8F88D06182168786", + "Socket": "0xA944BBe5D4F67a242C9e92d539fF2d55616283a7", + "SocketBatcher": "0x06234dB2D69Ac158793a3ce59c3764422028E964", + "startBlock": 141180188, + "SUSDC": "0x6D54668ba18B425a1DbFC0BD720145c0aeE97f65", + "SwitchboardIdToAddressMap": { + "1": "0xD78f99D62BeaF0918bB0601C68EB537b6703Ce63" + } + }, + "8453": { + "ContractFactoryPlug": "0x2e531e37FdccA3CFd427a593f53f326bd24b8142", + "FastSwitchboard": "0xd3009795fFDc64Ee0d23198772a58ca9e53EEd25", + "FastSwitchboardId": "1", + "FeesPlug": "0xFAF76924169cf58f239d02EC40a2a1eA9eaeb62E", + "Socket": "0x6EF9c18c1A69417625f4Cb3c634124a71025C3A9", + "SocketBatcher": "0x356DBc19C69832010f92c963a8Ded6b5f9deeaCe", + "startBlock": 35584928, + "SUSDC": "0x900Cf1914Adcee43Cb1A69c042ded801Cd5051Ef", + "SwitchboardIdToAddressMap": { + "1": "0xd3009795fFDc64Ee0d23198772a58ca9e53EEd25" + } + }, + "14323": { + "AddressResolver": "0xE4C438c46b9dB51e298A1F65151eDe8418be009A", + "AddressResolverImpl": "0x241532190C8b549Ebb4CE7624454A47c1cC97171", + "AsyncDeployer": "0x08c2DFE559288e9fBfB440E68033BE9BB666142E", + "AsyncDeployerImpl": "0x148182E16aaf2Fd6137D0eb335c3f6c8266e0936", + "AuctionManager": "0xa6610D1bFb6F791eDaeBAdFc43e2415f16844929", + "AuctionManagerImpl": "0x4B8B34e439EBAB00116B1b4C642923b6A227AdCa", + "Configurations": "0x6c289e8b8A8Ac6965440Cd23f2Db8C810f2336F9", + "ConfigurationsImpl": "0x30240731147d217Bf228EC68104eb8664A377c33", + "DeployForwarder": "0x015BB35B075FACBED756C9403c4A6BAfF37328D7", + "DeployForwarderImpl": "0xD4DB3AB70EBA19586132686fBD4928809c3e42B4", + "ERC1967Factory": "0x945300e92aA450A9aEf1d9FBA7b7Aee45622a082", + "FeesManager": "0xB3a34AB69B538d48311656a4b5df56A1423C0075", + "FeesManagerImpl": "0xBe2153E78cc02F87a2652390Bd49481dBc1ccd2E", + "FeesPool": "0xC8d803B7c1719cdF21392405879D1B56398045C4", + "PromiseResolver": "0xD5225A5BC7ef3eAc6eb5255776fF5F007C95D03E", + "ReadPrecompile": "0xD059D6D64B9dbAE2e56F70CBEc9Af03fd41DaE35", + "RequestHandler": "0xEd8f50ddf6ba832c699b019Ed62f86e511b72d53", + "RequestHandlerImpl": "0x994DA55f4295B073f1D60B5074cc7f6cD7b11753", + "SchedulePrecompile": "0x62Be6a0eabce7Efb1B9BB065e36b85C63B2101c6", + "startBlock": 50623, + "Watcher": "0xdd4B3431472573dB6dB988E8746a118005328589", + "WatcherImpl": "0x529d72181F1FFDA70aD62737f348d4913D5826F6", + "WritePrecompile": "0xE786f01425718D52F7C0753FbDF743b56704D31f", + "WritePrecompileImpl": "0x01aDAb65E88b931860E63928096B16dA717b0f99" + }, + "42161": { + "ContractFactoryPlug": "0xae59BA0Bd0D92232B3B6304185448C9Fe5445f4d", + "FastSwitchboard": "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "FastSwitchboardId": "1", + "FeesPlug": "0xfaf8a3f8f4221398F3eC765836e8BF4A3d975962", + "Socket": "0x693bcDb114a57302Cd687b8Af1bD7583ee56748C", + "SocketBatcher": "0x0d7994B4aAc7cbdFAFEAED0B9B51E7de0586ec6f", + "startBlock": 379484006, + "SUSDC": "0x0c17822dcC44F8202F176a4960EAC8da8FDbfCA5", + "SwitchboardIdToAddressMap": { + "1": "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d" + } + }, + "84532": { + "ContractFactoryPlug": "0x24A6Da9bAa5ba4AE8AF411546429b7eD2B29aA48", + "FastSwitchboard": "0x7442C13842dC293fce94Bf86116068F8FF62Ecf9", + "FastSwitchboardId": "1", + "Socket": "0x4861c9EB83d8ba745a184E5a11a50B6be25e4dDb", + "SocketBatcher": "0x5132751743cD59DB406A043d9983984E52Ca2cD5", + "startBlock": 31095773, + "SwitchboardIdToAddressMap": { + "1": "0x7442C13842dC293fce94Bf86116068F8FF62Ecf9" + } + }, + "421614": { + "ContractFactoryPlug": "0x5B6ed8Aaa52643d1d2d3409398e30b4eAdC767f2", + "FastSwitchboard": "0xE6be06b48c66BEbBa2114948a94cbE7eC7220a7e", + "FastSwitchboardId": "1", + "Socket": "0x7aA47Ed012c185127edA67f533D91f44391bfC7C", + "SocketBatcher": "0x163272Ec38a16193a22400799D242e381fecEB42", + "startBlock": 194622586, + "SwitchboardIdToAddressMap": { + "1": "0xE6be06b48c66BEbBa2114948a94cbE7eC7220a7e" + } + }, + "11155420": { + "ContractFactoryPlug": "0xfC6E8e1aC27b5d61A03a64f383F51d3669F82165", + "FastSwitchboard": "0xbE5CB1cf4e049F124B868DebF15d9B04ce0817b3", + "FastSwitchboardId": "1", + "Socket": "0x26292db660fbeB0271E11aa4f1d2a2d0c57dc378", + "SocketBatcher": "0xaA02a6FdA809cF11c4e26a82AcfE7666204736A0", + "startBlock": 33078325, + "SwitchboardIdToAddressMap": { + "1": "0xbE5CB1cf4e049F124B868DebF15d9B04ce0817b3" + } + } +} diff --git a/deployments/stage_verification.json b/deployments/stage_verification.json index 9e26dfee..31f41a06 100644 --- a/deployments/stage_verification.json +++ b/deployments/stage_verification.json @@ -1 +1,380 @@ -{} \ No newline at end of file +{ + "10": [ + [ + "0xC559BABEbcD92278E91a545308190E4761efc347", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xA944BBe5D4F67a242C9e92d539fF2d55616283a7", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x6D54668ba18B425a1DbFC0BD720145c0aeE97f65", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xA944BBe5D4F67a242C9e92d539fF2d55616283a7", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xA557EBE094F939ae6eE8F18c8F88D06182168786", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xA944BBe5D4F67a242C9e92d539fF2d55616283a7", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xD78f99D62BeaF0918bB0601C68EB537b6703Ce63", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 10, + "0xA944BBe5D4F67a242C9e92d539fF2d55616283a7", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x06234dB2D69Ac158793a3ce59c3764422028E964", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xA944BBe5D4F67a242C9e92d539fF2d55616283a7" + ] + ], + [ + "0xA944BBe5D4F67a242C9e92d539fF2d55616283a7", + "Socket", + "contracts/protocol/Socket.sol", + [10, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], + "8453": [ + [ + "0x2e531e37FdccA3CFd427a593f53f326bd24b8142", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x6EF9c18c1A69417625f4Cb3c634124a71025C3A9", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x900Cf1914Adcee43Cb1A69c042ded801Cd5051Ef", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x6EF9c18c1A69417625f4Cb3c634124a71025C3A9", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xFAF76924169cf58f239d02EC40a2a1eA9eaeb62E", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x6EF9c18c1A69417625f4Cb3c634124a71025C3A9", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xd3009795fFDc64Ee0d23198772a58ca9e53EEd25", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 8453, + "0x6EF9c18c1A69417625f4Cb3c634124a71025C3A9", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x356DBc19C69832010f92c963a8Ded6b5f9deeaCe", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x6EF9c18c1A69417625f4Cb3c634124a71025C3A9" + ] + ], + [ + "0x6EF9c18c1A69417625f4Cb3c634124a71025C3A9", + "Socket", + "contracts/protocol/Socket.sol", + [8453, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], + "14323": [ + [ + "0x62Be6a0eabce7Efb1B9BB065e36b85C63B2101c6", + "SchedulePrecompile", + "contracts/evmx/watcher/precompiles/SchedulePrecompile.sol", + [ + "0xdd4B3431472573dB6dB988E8746a118005328589", + 86400, + { + "type": "BigNumber", + "hex": "0x02540be400" + }, + { + "type": "BigNumber", + "hex": "0xe8d4a51000" + }, + 3600 + ] + ], + [ + "0xD059D6D64B9dbAE2e56F70CBEc9Af03fd41DaE35", + "ReadPrecompile", + "contracts/evmx/watcher/precompiles/ReadPrecompile.sol", + [ + "0xdd4B3431472573dB6dB988E8746a118005328589", + { + "type": "BigNumber", + "hex": "0xe8d4a51000" + }, + 3600 + ] + ], + [ + "0x01aDAb65E88b931860E63928096B16dA717b0f99", + "WritePrecompile", + "contracts/evmx/watcher/precompiles/WritePrecompile.sol", + [] + ], + [ + "0xD5225A5BC7ef3eAc6eb5255776fF5F007C95D03E", + "PromiseResolver", + "contracts/evmx/watcher/PromiseResolver.sol", + ["0xdd4B3431472573dB6dB988E8746a118005328589"] + ], + [ + "0x994DA55f4295B073f1D60B5074cc7f6cD7b11753", + "RequestHandler", + "contracts/evmx/watcher/RequestHandler.sol", + [] + ], + [ + "0x30240731147d217Bf228EC68104eb8664A377c33", + "Configurations", + "contracts/evmx/watcher/Configurations.sol", + [] + ], + [ + "0xD4DB3AB70EBA19586132686fBD4928809c3e42B4", + "DeployForwarder", + "contracts/evmx/helpers/DeployForwarder.sol", + [] + ], + [ + "0x4B8B34e439EBAB00116B1b4C642923b6A227AdCa", + "AuctionManager", + "contracts/evmx/AuctionManager.sol", + [] + ], + [ + "0x529d72181F1FFDA70aD62737f348d4913D5826F6", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], + [ + "0x148182E16aaf2Fd6137D0eb335c3f6c8266e0936", + "AsyncDeployer", + "contracts/evmx/helpers/AsyncDeployer.sol", + [] + ], + [ + "0xBe2153E78cc02F87a2652390Bd49481dBc1ccd2E", + "FeesManager", + "contracts/evmx/fees/FeesManager.sol", + [] + ], + [ + "0x241532190C8b549Ebb4CE7624454A47c1cC97171", + "AddressResolver", + "contracts/evmx/helpers/AddressResolver.sol", + [] + ], + [ + "0x945300e92aA450A9aEf1d9FBA7b7Aee45622a082", + "ERC1967Factory", + "lib/solady/src/utils/ERC1967Factory.sol", + [] + ] + ], + "42161": [ + [ + "0xae59BA0Bd0D92232B3B6304185448C9Fe5445f4d", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x693bcDb114a57302Cd687b8Af1bD7583ee56748C", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x0c17822dcC44F8202F176a4960EAC8da8FDbfCA5", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x693bcDb114a57302Cd687b8Af1bD7583ee56748C", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xfaf8a3f8f4221398F3eC765836e8BF4A3d975962", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x693bcDb114a57302Cd687b8Af1bD7583ee56748C", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 42161, + "0x693bcDb114a57302Cd687b8Af1bD7583ee56748C", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x0d7994B4aAc7cbdFAFEAED0B9B51E7de0586ec6f", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x693bcDb114a57302Cd687b8Af1bD7583ee56748C" + ] + ], + [ + "0x693bcDb114a57302Cd687b8Af1bD7583ee56748C", + "Socket", + "contracts/protocol/Socket.sol", + [42161, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], + "84532": [ + [ + "0x24A6Da9bAa5ba4AE8AF411546429b7eD2B29aA48", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x4861c9EB83d8ba745a184E5a11a50B6be25e4dDb", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x7442C13842dC293fce94Bf86116068F8FF62Ecf9", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 84532, + "0x4861c9EB83d8ba745a184E5a11a50B6be25e4dDb", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5132751743cD59DB406A043d9983984E52Ca2cD5", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x4861c9EB83d8ba745a184E5a11a50B6be25e4dDb" + ] + ], + [ + "0x4861c9EB83d8ba745a184E5a11a50B6be25e4dDb", + "Socket", + "contracts/protocol/Socket.sol", + [84532, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], + "421614": [ + [ + "0x5B6ed8Aaa52643d1d2d3409398e30b4eAdC767f2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x7aA47Ed012c185127edA67f533D91f44391bfC7C", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xE6be06b48c66BEbBa2114948a94cbE7eC7220a7e", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 421614, + "0x7aA47Ed012c185127edA67f533D91f44391bfC7C", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x163272Ec38a16193a22400799D242e381fecEB42", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x7aA47Ed012c185127edA67f533D91f44391bfC7C" + ] + ], + [ + "0x7aA47Ed012c185127edA67f533D91f44391bfC7C", + "Socket", + "contracts/protocol/Socket.sol", + [421614, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], + "11155420": [ + [ + "0xfC6E8e1aC27b5d61A03a64f383F51d3669F82165", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x26292db660fbeB0271E11aa4f1d2a2d0c57dc378", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbE5CB1cf4e049F124B868DebF15d9B04ce0817b3", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 11155420, + "0x26292db660fbeB0271E11aa4f1d2a2d0c57dc378", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xaA02a6FdA809cF11c4e26a82AcfE7666204736A0", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x26292db660fbeB0271E11aa4f1d2a2d0c57dc378" + ] + ], + [ + "0x26292db660fbeB0271E11aa4f1d2a2d0c57dc378", + "Socket", + "contracts/protocol/Socket.sol", + [11155420, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ] +} diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index cacade80..0e5bc87b 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -50,35 +50,35 @@ export const getChains = () => { ChainSlug.UNICHAIN, ChainSlug.SEI, // ChainSlug.MANTLE, - // ChainSlug.CAMP, - // ChainSlug.FLOW, - // ChainSlug.RISE_TESTNET, + ChainSlug.CAMP, + ChainSlug.FLOW, + ChainSlug.RISE_TESTNET, ]; case DeploymentMode.STAGE: return [ - ChainSlug.MAINNET, + // ChainSlug.MAINNET, ChainSlug.ARBITRUM, ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.OPTIMISM, ChainSlug.OPTIMISM_SEPOLIA, ChainSlug.BASE, ChainSlug.BASE_SEPOLIA, - ChainSlug.BSC, - ChainSlug.POLYGON_MAINNET, - ChainSlug.AVALANCHE, - ChainSlug.GNOSIS, - ChainSlug.LINEA, - ChainSlug.SONIC, - ChainSlug.KATANA, - ChainSlug.CAMP, - ChainSlug.INK, - ChainSlug.HYPEREVM, - ChainSlug.BERA, - ChainSlug.UNICHAIN, - ChainSlug.SEI, - ChainSlug.MANTLE, - ChainSlug.FLOW, - ChainSlug.RISE_TESTNET, + // ChainSlug.BSC, + // ChainSlug.POLYGON_MAINNET, + // ChainSlug.AVALANCHE, + // ChainSlug.GNOSIS, + // ChainSlug.LINEA, + // ChainSlug.SONIC, + // ChainSlug.KATANA, + // ChainSlug.CAMP, + // ChainSlug.INK, + // ChainSlug.HYPEREVM, + // ChainSlug.BERA, + // ChainSlug.UNICHAIN, + // ChainSlug.SEI, + // ChainSlug.MANTLE, + // ChainSlug.FLOW, + // ChainSlug.RISE_TESTNET, ]; case DeploymentMode.PROD: return [ @@ -170,7 +170,8 @@ export const chains: Array = getChains(); export const EVM_CHAIN_ID_MAP: Record = { [DeploymentMode.LOCAL]: 7625382, [DeploymentMode.DEV]: 14323, - [DeploymentMode.STAGE]: 14323, + [DeploymentMode.STAGE]: 14323, // dummy stage + // [DeploymentMode.STAGE]: 12921, [DeploymentMode.PROD]: 3605, }; @@ -179,7 +180,7 @@ export const watcher = "0xb62505feacC486e809392c65614Ce4d7b051923b"; export const transmitter = "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320"; export const socketOwner = "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18"; -export const skipEVMXDeployment = true; +export const skipEVMXDeployment = false; // Chain config export const EVMX_CHAIN_ID = EVM_CHAIN_ID_MAP[mode]; export const MAX_MSG_VALUE_LIMIT = ethers.utils.parseEther("0.001"); diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index b234eb32..1bc851fc 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -166,6 +166,30 @@ export const tokens: TokenMap = { decimals: 6, }, ], + [ChainSlug.CAMP]: [ + { + name: "USDC", + symbol: "USDC", + address: "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + decimals: 6, + }, + ], + [ChainSlug.FLOW]: [ + { + name: "USDC", + symbol: "USDC", + address: "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + decimals: 6, + }, + ], + [ChainSlug.MAINNET]: [ + { + name: "USDC", + symbol: "USDC", + address: "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + decimals: 6, + }, + ], }, [DeploymentMode.STAGE]: { 8453: [ @@ -199,6 +223,7 @@ export const feePools: { [key: string]: string } = { [DeploymentMode.LOCAL]: "0x9De353dD1131aB4e502590D3a1832652FA316268", [DeploymentMode.DEV]: "0x13A3018920c7b56B20dd34E29C298121025E6de4", [DeploymentMode.STAGE]: "0xC8d803B7c1719cdF21392405879D1B56398045C4", + // [DeploymentMode.STAGE]: "0xC8d803B7c1719cdF21392405879D1B56398045C4", }; export const getFeeTokens = (chainSlug: number): string[] => { diff --git a/hardhat-scripts/deploy/2.roles.ts b/hardhat-scripts/deploy/2.roles.ts index 0786e8a8..c60e4462 100644 --- a/hardhat-scripts/deploy/2.roles.ts +++ b/hardhat-scripts/deploy/2.roles.ts @@ -53,20 +53,20 @@ async function setRoleForContract( roleHash, targetAddress, { + ...(await overrides(chain as ChainSlug)), from: signer.address, } ); if (!hasRole) { - let tx = await contract.grantRole(roleHash, targetAddress, { - ...(await overrides(chain as ChainSlug)), - }); console.log( `granting ${roleName} role to ${targetAddress} for ${contractName}`, - chain, - "txHash: ", - tx.hash + chain ); + let tx = await contract.grantRole(roleHash, targetAddress, { + ...(await overrides(chain as ChainSlug)), + }); + console.log("txHash: ", tx.hash); await tx.wait(); } } @@ -139,12 +139,15 @@ export const main = async () => { console.log("Setting Roles for On Chain"); // Set up parallel processing with concurrency limit of 3 - const limit = pLimit(CONCURRENCY_LIMIT); - const chainTasks = chains.map((chain) => - limit(() => setRolesOnChain(chain, addresses)) - ); + for (const chain of chains) { + await setRolesOnChain(chain, addresses); + } + // const limit = pLimit(CONCURRENCY_LIMIT); + // const chainTasks = chains.map((chain) => + // limit(() => setRolesOnChain(chain, addresses)) + // ); + // await Promise.all(chainTasks); - await Promise.all(chainTasks); await setRolesForEVMx(addresses); } catch (error) { console.log("Error:", error); diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 6b96c3d1..6e112bfe 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -379,6 +379,7 @@ const registerSb = async ( // therefore override from address as well switchboardId = await socket.switchboardIds(sbAddress, { from: signer.address, + ...(await overrides(chain)), }); if (Number(switchboardId) == 0) { @@ -388,7 +389,9 @@ const registerSb = async ( console.log(`Registering Switchboard ${sbAddress}: ${registerTx.hash}`); await registerTx.wait(); - switchboardId = await switchboard.switchboardId(); + switchboardId = await switchboard.switchboardId({ + ...(await overrides(chain)), + }); console.log(`Switchboard ID: ${switchboardId}`); } @@ -413,7 +416,9 @@ export const whitelistToken = async ( if (tokens.length == 0) return; for (const token of tokens) { - const isWhitelisted = await feesPlugContract.whitelistedTokens(token); + const isWhitelisted = await feesPlugContract.whitelistedTokens(token, { + ...(await overrides(chain)), + }); if (!isWhitelisted) { const tx = await feesPlugContract.whitelistToken(token, { diff --git a/hardhat-scripts/deploy/6.connect.ts b/hardhat-scripts/deploy/6.connect.ts index 8d6796fa..460b4b6f 100644 --- a/hardhat-scripts/deploy/6.connect.ts +++ b/hardhat-scripts/deploy/6.connect.ts @@ -54,7 +54,9 @@ async function connectPlug( const appGatewayId = getAppGatewayId(plugContract, addresses); checkIfAppGatewayIdExists(appGatewayId, "AppGatewayId"); // Check if config is already set - if (await isConfigSetOnSocket(plug, socket, appGatewayId, switchboardId)) { + if ( + await isConfigSetOnSocket(plug, socket, appGatewayId, switchboardId, chain) + ) { console.log(`${plugContract} Socket Config on ${chain} already set!`); return; } @@ -62,7 +64,9 @@ async function connectPlug( // Connect the plug let functionName = "initSocket"; - const isInitialized = await plug.isSocketInitialized(); + const isInitialized = await plug.isSocketInitialized({ + ...(await overrides(chain)), + }); if (isInitialized.toNumber() === 1) functionName = "connectSocket"; const tx = await plug.functions[functionName]( @@ -81,11 +85,9 @@ export const connectPlugsOnSocketForAllChains = async () => { console.log("Connecting plugs"); const addresses = getAddresses(mode) as unknown as DeploymentAddresses; // Connect plugs on each chain - const limit = pLimit(CONCURRENCY_LIMIT); - const chainTasks = chains.map(async (chain) => { - limit(() => connectPlugsOnSocket(chain, addresses)); - }); - await Promise.all(chainTasks); + for (const chain of chains) { + await connectPlugsOnSocket(chain, addresses); + } }; export const connectPlugsOnSocket = async ( @@ -93,13 +95,18 @@ export const connectPlugsOnSocket = async ( addresses: DeploymentAddresses ) => { try { - if (!addresses[chain]) return; + if (!addresses[chain]) { + console.log(`${chain} not found in addresses`); + return; + } const socketSigner = getSocketSigner(chain as ChainSlug); const addr = addresses[chain]!; // Connect each plug contract for (const plugContract of plugs) { if (addr[plugContract]) { await connectPlug(chain, plugContract, socketSigner, addresses, addr); + } else { + console.log(`${plugContract} not found in ${chain}`); } } } catch (error) { diff --git a/hardhat-scripts/test/chainTest.ts b/hardhat-scripts/test/chainTest.ts new file mode 100644 index 00000000..235f3313 --- /dev/null +++ b/hardhat-scripts/test/chainTest.ts @@ -0,0 +1,349 @@ +import { config as dotenvConfig } from "dotenv"; +dotenvConfig(); +import { ethers } from "ethers"; +import axios from "axios"; +import { chains } from "../config/config"; +import { chainSlugToHardhatChainName } from "../../src"; + +// Chain IDs to test +const TEST_CHAINS = chains; + +interface ChainTestResult { + chainId: number; + chainName: string; + hasForwarder: boolean; + forwarderAddress?: string; + txHash?: string; + status?: string; + error?: string; +} + +interface StatusResponse { + status: string; + response: Array<{ + status: string; + requestCount: number; + writePayloads: Array<{ + payloadId: string; + chainSlug: number; + batchCount: number; + target: string; + callType: string; + payload: string; + }>; + }>; +} + +class ChainTester { + private provider: ethers.providers.JsonRpcProvider; + private wallet: ethers.Wallet; + private counterAppGateway: ethers.Contract; + private feesManager: ethers.Contract; + private results: ChainTestResult[] = []; + + constructor() { + // Initialize provider and wallet + this.provider = new ethers.providers.JsonRpcProvider(process.env.EVMX_RPC); + this.wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, this.provider); + + // Counter App Gateway ABI (minimal required functions) + const counterAppGatewayABI = [ + "function forwarderAddresses(bytes32, uint32) view returns (address)", + "function deployContracts(uint32) external", + "function incrementCounters(address[] memory instances_) external", + "function counter() view returns (bytes32)", + ]; + + // FeesManager ABI (minimal required functions) + const feesManagerABI = [ + "function totalBalanceOf(address) view returns (uint256)", + "function getBlockedCredits(address) view returns (uint256)", + "function balanceOf(address) view returns (uint256)", + ]; + + this.counterAppGateway = new ethers.Contract( + process.env.COUNTER_APP_GATEWAY!, + counterAppGatewayABI, + this.wallet + ); + + this.feesManager = new ethers.Contract( + process.env.FEES_MANAGER!, + feesManagerABI, + this.provider + ); + } + + async checkBalance(): Promise { + console.log("=".repeat(80)); + console.log("CHECKING COUNTER APP GATEWAY BALANCE"); + console.log("=".repeat(80)); + + try { + const appGatewayAddress = process.env.COUNTER_APP_GATEWAY!; + const feesManagerAddress = process.env.FEES_MANAGER!; + + const totalCredits = await this.feesManager.totalBalanceOf( + appGatewayAddress + ); + const blockedCredits = await this.feesManager.getBlockedCredits( + appGatewayAddress + ); + const availableFees = await this.feesManager.balanceOf(appGatewayAddress); + + console.log(`Counter App Gateway: ${appGatewayAddress}`); + console.log(`Fees Manager: ${feesManagerAddress}`); + console.log( + `Total Credits: ${ethers.utils.formatEther(totalCredits)} ETH` + ); + console.log( + `Blocked Credits: ${ethers.utils.formatEther(blockedCredits)} ETH` + ); + console.log( + `Available Fees: ${ethers.utils.formatEther(availableFees)} ETH` + ); + } catch (error) { + console.error("Error checking balance:", error); + } + + console.log(""); + } + + async testChain(chainId: number): Promise { + const chainName = + chainSlugToHardhatChainName[chainId] || `Chain ${chainId}`; + console.log(`Testing ${chainName} (${chainId})...`); + + const result: ChainTestResult = { + chainId, + chainName, + hasForwarder: false, + }; + + try { + // Get counter contract ID + const counterContractId = await this.counterAppGateway.counter(); + + // Check if forwarder exists + const forwarderAddress = await this.counterAppGateway.forwarderAddresses( + counterContractId, + chainId + ); + + if (forwarderAddress !== ethers.constants.AddressZero) { + // Forwarder exists, call increment + result.hasForwarder = true; + result.forwarderAddress = forwarderAddress; + console.log(` ✓ Forwarder exists: ${forwarderAddress}`); + console.log(` → Calling incrementCounters...`); + + const tx = await this.counterAppGateway.incrementCounters([ + forwarderAddress, + ]); + result.txHash = tx.hash; + console.log(` → Transaction: ${tx.hash}`); + + await tx.wait(); + console.log(` ✓ Transaction confirmed`); + } else { + // No forwarder, deploy contracts + result.hasForwarder = false; + console.log(` ✗ No forwarder found`); + console.log(` → Calling deployContracts...`); + + const tx = await this.counterAppGateway.deployContracts(chainId); + result.txHash = tx.hash; + console.log(` → Transaction: ${tx.hash}`); + + await tx.wait(); + console.log(` ✓ Transaction confirmed`); + } + } catch (error) { + result.error = error instanceof Error ? error.message : String(error); + console.log(` ✗ Error: ${result.error}`); + } + + return result; + } + + async checkTransactionStatus(txHash: string): Promise { + const maxRetries = 12; // 12 * 5 seconds = 1 minute + let retries = 0; + + while (retries < maxRetries) { + try { + console.log( + ` Checking status... (attempt ${retries + 1}/${maxRetries})` + ); + + const response = await axios.get( + `${process.env.API_BASE_URL}/getDetailsByTxHash?txHash=${txHash}`, + { timeout: 10000 } + ); + + const data: StatusResponse = response.data; + + if (data.status === "SUCCESS" && data.response.length > 0) { + const status = data.response[0].status; + console.log(` Status: ${status}`); + + if (status === "COMPLETED") { + return "COMPLETED"; + } else if (status === "REVERTING") { + return "REVERTING"; + } + // Continue checking if status is still processing + } + + retries++; + if (retries < maxRetries) { + console.log(` Waiting 5 seconds before next check...`); + await new Promise((resolve) => setTimeout(resolve, 5000)); + } + } catch (error) { + console.log( + ` API error: ${ + error instanceof Error ? error.message : String(error) + }` + ); + retries++; + if (retries < maxRetries) { + await new Promise((resolve) => setTimeout(resolve, 5000)); + } + } + } + + return "TIMEOUT"; + } + + async runTests(): Promise { + console.log("SOCKET PROTOCOL CHAIN TESTING"); + console.log("=".repeat(80)); + console.log( + `Testing ${TEST_CHAINS.length} chains: ${TEST_CHAINS.join(", ")}` + ); + console.log(""); + + // Check balance first + await this.checkBalance(); + + console.log("=".repeat(80)); + console.log("TESTING CHAINS"); + console.log("=".repeat(80)); + + // Test each chain + for (const chainId of TEST_CHAINS) { + const result = await this.testChain(chainId); + this.results.push(result); + + // Check transaction status if we have a tx hash + if (result.txHash) { + console.log(` → Monitoring transaction status...`); + result.status = await this.checkTransactionStatus(result.txHash); + console.log(` → Final status: ${result.status}`); + } + + console.log(""); + } + + this.printSummary(); + } + + private printSummary(): void { + console.log("=".repeat(80)); + console.log("SUMMARY REPORT"); + console.log("=".repeat(80)); + + let successCount = 0; + let errorCount = 0; + let deployedCount = 0; + let incrementedCount = 0; + + console.log("Chain Results:"); + console.log("-".repeat(80)); + + for (const result of this.results) { + const statusIcon = result.error ? "✗" : "✓"; + const action = result.hasForwarder ? "INCREMENT" : "DEPLOY"; + const status = result.status || (result.error ? "ERROR" : "UNKNOWN"); + + console.log( + `${statusIcon} ${result.chainName.padEnd(20)} | ${action.padEnd( + 10 + )} | ${status.padEnd(12)} | ${result.txHash || "N/A"}` + ); + + if (!result.error) { + successCount++; + if (result.hasForwarder) { + incrementedCount++; + } else { + deployedCount++; + } + } else { + errorCount++; + } + } + + console.log("-".repeat(80)); + console.log(`Total Chains: ${this.results.length}`); + console.log(`Successful: ${successCount}`); + console.log(`Errors: ${errorCount}`); + console.log(`Deployments: ${deployedCount}`); + console.log(`Increments: ${incrementedCount}`); + + const completedTxs = this.results.filter( + (r) => r.status === "COMPLETED" + ).length; + const revertingTxs = this.results.filter( + (r) => r.status === "REVERTING" + ).length; + const timeoutTxs = this.results.filter( + (r) => r.status === "TIMEOUT" + ).length; + + console.log(`Completed Transactions: ${completedTxs}`); + console.log(`Reverting Transactions: ${revertingTxs}`); + console.log(`Timeout Transactions: ${timeoutTxs}`); + + console.log("=".repeat(80)); + + if (errorCount > 0) { + console.log("ERRORS:"); + for (const result of this.results.filter((r) => r.error)) { + console.log(` ${result.chainName}: ${result.error}`); + } + console.log("=".repeat(80)); + } + } +} + +// Main execution +async function main() { + try { + // Validate required environment variables + const requiredEnvVars = [ + "EVMX_RPC", + "PRIVATE_KEY", + "COUNTER_APP_GATEWAY", + "FEES_MANAGER", + "API_BASE_URL", + ]; + + for (const envVar of requiredEnvVars) { + if (!process.env[envVar]) { + throw new Error(`Missing required environment variable: ${envVar}`); + } + } + + const tester = new ChainTester(); + await tester.runTests(); + } catch (error) { + console.error("Fatal error:", error); + process.exit(1); + } +} + +if (require.main === module) { + main(); +} diff --git a/hardhat-scripts/test/gas-fees.ts b/hardhat-scripts/test/gas-fees.ts new file mode 100644 index 00000000..89742e36 --- /dev/null +++ b/hardhat-scripts/test/gas-fees.ts @@ -0,0 +1,64 @@ +import { ethers } from "ethers"; +import { config as dotenvConfig } from "dotenv"; +dotenvConfig(); +import { getChains } from "../config/config"; +import { getProviderFromChainSlug } from "../utils"; + +async function main() { + console.log("=".repeat(80)); + console.log("GAS FEE DATA ACROSS CHAINS"); + console.log("=".repeat(80)); + + const chains = getChains(); + console.log(chains); + for (const chainId of chains) { + try { + console.log(`\nChain: ${chainId}`); + console.log("-".repeat(40)); + + const provider = getProviderFromChainSlug(chainId); + + const feeData = await provider.getFeeData(); + const gasPrice = await provider.getGasPrice(); + console.log( + "Gas Price:", + ethers.utils.formatUnits(feeData.gasPrice || 0, "gwei"), + "gwei" + ); + console.log( + "Last Base Fee Per Gas:", + ethers.utils.formatUnits(feeData.lastBaseFeePerGas || 0, "gwei"), + "gwei" + ); + console.log( + "Max Fee Per Gas:", + ethers.utils.formatUnits(feeData.maxFeePerGas || 0, "gwei"), + "gwei" + ); + console.log( + "Max Priority Fee Per Gas:", + ethers.utils.formatUnits(feeData.maxPriorityFeePerGas || 0, "gwei"), + "gwei" + ); + + console.log( + "Gas Price:", + ethers.utils.formatUnits(gasPrice, "gwei"), + "gwei" + ); + } catch (error) { + console.log( + `Error fetching fee data for chain ${chainId}:`, + error.message + ); + } + } +} + +// Run if called directly +if (require.main === module) { + main().catch((error) => { + console.error("Error:", error); + process.exit(1); + }); +} diff --git a/hardhat-scripts/utils/appConfig.ts b/hardhat-scripts/utils/appConfig.ts index 5f2b4b9b..59497fcd 100644 --- a/hardhat-scripts/utils/appConfig.ts +++ b/hardhat-scripts/utils/appConfig.ts @@ -1,13 +1,18 @@ import { Contract } from "ethers"; import { toBytes32Format } from "./address"; +import { overrides } from "./overrides"; +import { EVMX_CHAIN_ID } from "../config"; export const isConfigSetOnSocket = async ( plug: Contract, socket: Contract, appGatewayId: string, - switchboardId: string + switchboardId: string, + chain: number ) => { - const plugConfigRegistered = await socket.getPlugConfig(plug.address); + const plugConfigRegistered = await socket.getPlugConfig(plug.address, { + ...(await overrides(chain)), + }); return ( plugConfigRegistered.appGatewayId.toLowerCase() === appGatewayId.toLowerCase() && @@ -22,9 +27,12 @@ export const isConfigSetOnEVMx = async ( appGatewayId: string, switchboardId: string ) => { - const plugConfigRegistered = await watcher.getPlugConfigs( + const plugConfigRegistered = await watcher.callStatic.getPlugConfigs( chain, - toBytes32Format(plug) + toBytes32Format(plug), + { + ...(await overrides(EVMX_CHAIN_ID)), + } ); return ( plugConfigRegistered[0].toLowerCase() === appGatewayId?.toLowerCase() && diff --git a/hardhat-scripts/utils/overrides.ts b/hardhat-scripts/utils/overrides.ts index bc073c19..85bbea63 100644 --- a/hardhat-scripts/utils/overrides.ts +++ b/hardhat-scripts/utils/overrides.ts @@ -24,7 +24,7 @@ export const chainOverrides: { }, [ChainSlug.BASE_SEPOLIA]: { type: 1, - gasLimit: 1_000_000, + gasLimit: 3_000_000, // gasPrice: 200_000_000, }, [ChainSlug.BSC]: { @@ -73,14 +73,14 @@ export const chainOverrides: { gasLimit: 1_000_000, }, [ChainSlug.MANTLE]: { - gasLimit: 1_000_551_690, + gasLimit: 3_000_551_690, gasPrice: parseUnits("0.03", "gwei"), }, [EVMX_CHAIN_ID as ChainSlug]: { // type: 0, // // gasLimit: 1_000_000_000, - // gasPrice: 0, + // gasPrice: parseUnits("0.1", "gwei"), }, }; diff --git a/package.json b/package.json index beb9caa4..d2e8bc41 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "lintContracts": "prettier \"./**\" --write --plugin=prettier-plugin-solidity", "compile": "forge build", "deploy": "bash setupInfraContracts.sh", + "test:counter": "npx hardhat run hardhat-scripts/test/chainTest.ts --no-compile", "publish-core": "yarn build && yarn publish --patch --no-git-tag-version", "trace": "source .env && bash trace.sh" }, diff --git a/src/chain-enums/native-tokens.ts b/src/chain-enums/native-tokens.ts index 4869ac28..48e8c3e7 100644 --- a/src/chain-enums/native-tokens.ts +++ b/src/chain-enums/native-tokens.ts @@ -21,4 +21,5 @@ export enum NativeTokens { PLUME = "plume", CAMP_NETWORK = "camp-network", FLOW = "flow", + SEI = "sei", } diff --git a/src/chain-enums/opStackChains.ts b/src/chain-enums/opStackChains.ts index d1e6aa3e..e1a96fbf 100644 --- a/src/chain-enums/opStackChains.ts +++ b/src/chain-enums/opStackChains.ts @@ -21,4 +21,6 @@ export const opStackL2Chain = [ ChainSlug.MANTA_PACIFIC, ChainSlug.POLTER_TESTNET, ChainSlug.OPBNB, + ChainSlug.INK, + ChainSlug.UNICHAIN, ]; From 1a2c0f259571d4e8c2834ded2b68fa41d80908b6 Mon Sep 17 00:00:00 2001 From: Akash Date: Wed, 17 Sep 2025 16:18:29 +0530 Subject: [PATCH 117/139] feat: dev deployments --- .../watcher/precompiles/WritePrecompile.sol | 7 +- deployments/dev_addresses.json | 31 ++- deployments/dev_verification.json | 216 +++++++----------- deployments/stage_addresses.json | 6 + deployments/stage_verification.json | 63 +++++ hardhat-scripts/admin/disconnect.ts | 4 +- hardhat-scripts/config/config.ts | 50 +++- hardhat-scripts/constants/constants.ts | 6 +- hardhat-scripts/constants/feeConstants.ts | 78 ++++++- hardhat-scripts/deploy/1.deploy.ts | 54 ++--- hardhat-scripts/deploy/3.configureChains.ts | 62 ++--- hardhat-scripts/deploy/deployTestUSDC.ts | 7 +- hardhat-scripts/s3Config/buildConfig.ts | 8 +- hardhat-scripts/test/chainTest.ts | 10 +- hardhat-scripts/test/gas-fees.ts | 4 +- hardhat-scripts/utils/overrides.ts | 2 +- package.json | 6 +- src/chain-enums/eventBlockRange.ts | 6 + src/chain-enums/gasPriceType.ts | 8 + src/enums.ts | 6 + src/types.ts | 4 +- test/SocketUSDC.sol | 30 +++ 22 files changed, 437 insertions(+), 231 deletions(-) create mode 100644 src/chain-enums/eventBlockRange.ts create mode 100644 src/chain-enums/gasPriceType.ts create mode 100644 test/SocketUSDC.sol diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index 2eea6870..e363497b 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -122,7 +122,12 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc // todo: can be changed to set the default gas limit for each chain if (queueParams_.overrideParams.gasLimit == 0) { - queueParams_.overrideParams.gasLimit = 10000000; + if (queueParams_.transaction.chainSlug == 5000) { + // Mantle default gas limit + queueParams_.overrideParams.gasLimit = 8_000_000_000; + } else { + queueParams_.overrideParams.gasLimit = 10_000_000; // other chains default gas limit + } } // For write precompile, encode the payload parameters diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 4bece330..7cdef477 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -77,6 +77,19 @@ "1": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" } }, + "169": { + "ContractFactoryPlug": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboardId": "1", + "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "startBlock": 6381187, + "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SwitchboardIdToAddressMap": { + "1": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + } + }, "484": { "ContractFactoryPlug": "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", "FastSwitchboard": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", @@ -130,16 +143,16 @@ } }, "5000": { - "ContractFactoryPlug": "0xeAb2e310A53FD3Fb34C2944690a79DFB2e834F20", - "FastSwitchboard": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "ContractFactoryPlug": "0xcFb68baF734daA2b5df3eE18F1fb45c99230A2A5", + "FastSwitchboard": "0x72e8aba972EEe812d6a5C6Ab13197e884C7D8FA9", "FastSwitchboardId": "1", - "FeesPlug": "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", - "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", - "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", - "startBlock": 84906616, - "SUSDC": "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "FeesPlug": "0x0D85b9835bD1E82baeFcdb12C4D171294c64Afd2", + "Socket": "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", + "SocketBatcher": "0xb5763dC91FD626786E17b43E8808062a87b037aF", + "startBlock": 84961430, + "SUSDC": "0x6C1d46856dc8e1Fe16B1A8d0caEc720F9A58A193", "SwitchboardIdToAddressMap": { - "1": "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450" + "1": "0x72e8aba972EEe812d6a5C6Ab13197e884C7D8FA9" } }, "8453": { @@ -181,7 +194,7 @@ "Watcher": "0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d", "WatcherImpl": "0xc7837f8dC93335d203DaBCb0c35dC401Ade9F1B3", "WritePrecompile": "0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15", - "WritePrecompileImpl": "0x52BfcB9bD0f1a387f28608C01cE8123310Ce3199" + "WritePrecompileImpl": "0xd50ca68c3d0f8341CC19B7eFE7e564971ba52A1D" }, "43114": { "CCTPSwitchboard": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index a33e82ad..78a1c32a 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -341,6 +341,63 @@ [146, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], + "169": [ + [ + "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 169, + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], + [ + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + ] + ], + [ + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "Socket", + "contracts/protocol/Socket.sol", + [169, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + ] + ], "484": [ [ "0xfE34ACE07836F7F05f485EAc7122D0CD58BAC047", @@ -571,144 +628,122 @@ ], "5000": [ [ - "0xeAb2e310A53FD3Fb34C2944690a79DFB2e834F20", + "0xcFb68baF734daA2b5df3eE18F1fb45c99230A2A5", "ContractFactoryPlug", "contracts/evmx/plugs/ContractFactoryPlug.sol", [ - "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" ] ], [ - "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", + "0x6C1d46856dc8e1Fe16B1A8d0caEc720F9A58A193", "SUSDC", "contracts/evmx/plugs/SUSDC.sol", [ 18, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", "SUSDC", "SUSDC" ] ], [ - "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", + "0x0D85b9835bD1E82baeFcdb12C4D171294c64Afd2", "FeesPlug", "contracts/evmx/plugs/FeesPlug.sol", [ - "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" ] ], [ - "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", + "0x72e8aba972EEe812d6a5C6Ab13197e884C7D8FA9", "FastSwitchboard", "contracts/protocol/switchboard/FastSwitchboard.sol", [ 5000, - "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" ] ], [ - "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", + "0xb5763dC91FD626786E17b43E8808062a87b037aF", "SocketBatcher", "contracts/protocol/SocketBatcher.sol", [ "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" + "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA" ] ], [ - "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", + "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", "Socket", "contracts/protocol/Socket.sol", [5000, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] - ] - ], - "8453": [ + ], [ - "0xfE555AD869ac24305471F0755976c556425E8D23", + "0xeAb2e310A53FD3Fb34C2944690a79DFB2e834F20", "ContractFactoryPlug", "contracts/evmx/plugs/ContractFactoryPlug.sol", [ - "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" ] ], [ - "0xbcaDE56f86a819994d0F66b98e921C484bE6FE4e", + "0x9EDfb162b725CF6d628D68af200cAe8b624111eD", "SUSDC", "contracts/evmx/plugs/SUSDC.sol", [ 18, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "SUSDC", "SUSDC" ] ], [ - "0x1eFD3AF2317B9E6E7492718878f69De747C9e7c3", + "0xee1Aef0b06f63Aa1c881838794Dd0876462c2B0d", "FeesPlug", "contracts/evmx/plugs/FeesPlug.sol", [ - "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0xdaE4538FbbEf41B2Feb5c79DD2fFC9720AF13d7b", - "MessageSwitchboard", - "contracts/protocol/switchboard/MessageSwitchboard.sol", - [ - 8453, - "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" ] ], [ - "0xae59BA0Bd0D92232B3B6304185448C9Fe5445f4d", - "CCTPSwitchboard", - "contracts/protocol/switchboard/CCTPSwitchboard.sol", - [ - 8453, - "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0xAD09780d193884d503182aD4588450C416D6F9D4" - ] - ], - [ - "0x0c17822dcC44F8202F176a4960EAC8da8FDbfCA5", + "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", "FastSwitchboard", "contracts/protocol/switchboard/FastSwitchboard.sol", [ - 8453, - "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + 5000, + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" ] ], [ - "0xfaf8a3f8f4221398F3eC765836e8BF4A3d975962", + "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", "SocketBatcher", "contracts/protocol/SocketBatcher.sol", [ "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d" + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" ] ], [ - "0x7E33B305e12aD0E73B3aedBE67A53B7818732d7d", + "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [8453, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [5000, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], + "8453": [], "14323": [ [ - "0xc7837f8dC93335d203DaBCb0c35dC401Ade9F1B3", - "Watcher", - "contracts/evmx/watcher/Watcher.sol", + "0x9b962E99fbc77aF1733CdE3bC65F1Cd621d4FDEF", + "WritePrecompile", + "contracts/evmx/watcher/precompiles/WritePrecompile.sol", [] ], [ @@ -988,84 +1023,7 @@ [80094, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] ] ], - "84532": [ - [ - "0xf8a9d637cd6fAf3d4C17277DceadbEE69d7752f0", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0x22B521c3610D373Ea29698215eB78907Ad98B644", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0x01bDCAB43c423D08BaCe87ED716280536dAB3eF3", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0x22B521c3610D373Ea29698215eB78907Ad98B644", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3D7515519beab77B541497626CFB7E764F6887CD", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0x22B521c3610D373Ea29698215eB78907Ad98B644", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0xe7858f1dc202f5E9C9B3ee6db052F45164a88534", - "MessageSwitchboard", - "contracts/protocol/switchboard/MessageSwitchboard.sol", - [ - 84532, - "0x22B521c3610D373Ea29698215eB78907Ad98B644", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0x9175d90706a2b17f0aE025ce5A6C76e64850c2f5", - "CCTPSwitchboard", - "contracts/protocol/switchboard/CCTPSwitchboard.sol", - [ - 84532, - "0x22B521c3610D373Ea29698215eB78907Ad98B644", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD" - ] - ], - [ - "0xE09CC429e77EE5DBeF68f3796b2A33BBDF39C03C", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 84532, - "0x22B521c3610D373Ea29698215eB78907Ad98B644", - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" - ] - ], - [ - "0x26565cAeA64c78Dc7cB4158e7612451Db436A0c6", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0x22B521c3610D373Ea29698215eB78907Ad98B644" - ] - ], - [ - "0x22B521c3610D373Ea29698215eB78907Ad98B644", - "Socket", - "contracts/protocol/Socket.sol", - [84532, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] - ] - ], + "84532": [], "98866": [ [ "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", diff --git a/deployments/stage_addresses.json b/deployments/stage_addresses.json index f75d720d..a5d95c93 100644 --- a/deployments/stage_addresses.json +++ b/deployments/stage_addresses.json @@ -68,9 +68,11 @@ "ContractFactoryPlug": "0x24A6Da9bAa5ba4AE8AF411546429b7eD2B29aA48", "FastSwitchboard": "0x7442C13842dC293fce94Bf86116068F8FF62Ecf9", "FastSwitchboardId": "1", + "FeesPlug": "0x5cdcD147A01Fc29C20c2061a89faF01F20363A20", "Socket": "0x4861c9EB83d8ba745a184E5a11a50B6be25e4dDb", "SocketBatcher": "0x5132751743cD59DB406A043d9983984E52Ca2cD5", "startBlock": 31095773, + "SUSDC": "0x99D946bB805adba0233956E475bf70ED09d50d40", "SwitchboardIdToAddressMap": { "1": "0x7442C13842dC293fce94Bf86116068F8FF62Ecf9" } @@ -79,9 +81,11 @@ "ContractFactoryPlug": "0x5B6ed8Aaa52643d1d2d3409398e30b4eAdC767f2", "FastSwitchboard": "0xE6be06b48c66BEbBa2114948a94cbE7eC7220a7e", "FastSwitchboardId": "1", + "FeesPlug": "0x946f1113f19CD1d20465e62D8F5480C49253EbA3", "Socket": "0x7aA47Ed012c185127edA67f533D91f44391bfC7C", "SocketBatcher": "0x163272Ec38a16193a22400799D242e381fecEB42", "startBlock": 194622586, + "SUSDC": "0xb5DbadA4f0F84420F0803089cD52Ef39876A061d", "SwitchboardIdToAddressMap": { "1": "0xE6be06b48c66BEbBa2114948a94cbE7eC7220a7e" } @@ -90,9 +94,11 @@ "ContractFactoryPlug": "0xfC6E8e1aC27b5d61A03a64f383F51d3669F82165", "FastSwitchboard": "0xbE5CB1cf4e049F124B868DebF15d9B04ce0817b3", "FastSwitchboardId": "1", + "FeesPlug": "0xf0A01453C34759588e2Ebd42183F4FF122cc73ee", "Socket": "0x26292db660fbeB0271E11aa4f1d2a2d0c57dc378", "SocketBatcher": "0xaA02a6FdA809cF11c4e26a82AcfE7666204736A0", "startBlock": 33078325, + "SUSDC": "0x3039AC5cC80C531c682045278f92439D740fa62B", "SwitchboardIdToAddressMap": { "1": "0xbE5CB1cf4e049F124B868DebF15d9B04ce0817b3" } diff --git a/deployments/stage_verification.json b/deployments/stage_verification.json index 31f41a06..f1a89c91 100644 --- a/deployments/stage_verification.json +++ b/deployments/stage_verification.json @@ -270,6 +270,27 @@ ] ], "84532": [ + [ + "0x99D946bB805adba0233956E475bf70ED09d50d40", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x4861c9EB83d8ba745a184E5a11a50B6be25e4dDb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x5cdcD147A01Fc29C20c2061a89faF01F20363A20", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x4861c9EB83d8ba745a184E5a11a50B6be25e4dDb", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], [ "0x24A6Da9bAa5ba4AE8AF411546429b7eD2B29aA48", "ContractFactoryPlug", @@ -306,6 +327,27 @@ ] ], "421614": [ + [ + "0xb5DbadA4f0F84420F0803089cD52Ef39876A061d", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x7aA47Ed012c185127edA67f533D91f44391bfC7C", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x946f1113f19CD1d20465e62D8F5480C49253EbA3", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x7aA47Ed012c185127edA67f533D91f44391bfC7C", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], [ "0x5B6ed8Aaa52643d1d2d3409398e30b4eAdC767f2", "ContractFactoryPlug", @@ -342,6 +384,27 @@ ] ], "11155420": [ + [ + "0x3039AC5cC80C531c682045278f92439D740fa62B", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "0x26292db660fbeB0271E11aa4f1d2a2d0c57dc378", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xf0A01453C34759588e2Ebd42183F4FF122cc73ee", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x26292db660fbeB0271E11aa4f1d2a2d0c57dc378", + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + ] + ], [ "0xfC6E8e1aC27b5d61A03a64f383F51d3669F82165", "ContractFactoryPlug", diff --git a/hardhat-scripts/admin/disconnect.ts b/hardhat-scripts/admin/disconnect.ts index 2a92d701..d7f195a9 100644 --- a/hardhat-scripts/admin/disconnect.ts +++ b/hardhat-scripts/admin/disconnect.ts @@ -51,7 +51,9 @@ async function disconnectPlug( checkIfAddressExists(switchboard, "Switchboard"); // Check if config is already set - if (await isConfigSetOnSocket(plug, socket, BYTES32_ZERO, switchboard)) { + if ( + await isConfigSetOnSocket(plug, socket, BYTES32_ZERO, switchboard, chain) + ) { console.log(`${plugContract} Socket Config on ${chain} already set!`); return; } diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 0e5bc87b..444aefd9 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -49,10 +49,10 @@ export const getChains = () => { ChainSlug.BERA, ChainSlug.UNICHAIN, ChainSlug.SEI, - // ChainSlug.MANTLE, + ChainSlug.MANTLE, ChainSlug.CAMP, ChainSlug.FLOW, - ChainSlug.RISE_TESTNET, + ChainSlug.MANTA_PACIFIC, ]; case DeploymentMode.STAGE: return [ @@ -100,13 +100,12 @@ export const getFeesPlugChains = (): Array => { return getChains(); case DeploymentMode.STAGE: return [ - ChainSlug.OPTIMISM, ChainSlug.ARBITRUM, - ChainSlug.BASE, ChainSlug.AVALANCHE, - ChainSlug.BSC, + ChainSlug.BASE, ChainSlug.MAINNET, - ChainSlug.LINEA, + ChainSlug.HYPEREVM, + ChainSlug.OPTIMISM, ChainSlug.POLYGON_MAINNET, ChainSlug.SEI, ChainSlug.SONIC, @@ -160,12 +159,17 @@ export const IndexerHighChains: Array = [ ChainSlug.BERA, ChainSlug.UNICHAIN, ChainSlug.SONIC, -]; +].filter((chain) => getChains().includes(chain)); export const IndexerLowChains: Array = getChains().filter( (chain) => !IndexerHighChains.includes(chain) ); +export const cronOnlyChains: Array = [ + ChainSlug.HYPEREVM, + ChainSlug.AVALANCHE, +]; + export const chains: Array = getChains(); export const EVM_CHAIN_ID_MAP: Record = { [DeploymentMode.LOCAL]: 7625382, @@ -176,9 +180,31 @@ export const EVM_CHAIN_ID_MAP: Record = { }; // Addresses -export const watcher = "0xb62505feacC486e809392c65614Ce4d7b051923b"; -export const transmitter = "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320"; -export const socketOwner = "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18"; +export const WATCHER_ADDRESS: Record = { + [DeploymentMode.LOCAL]: "0xb62505feacC486e809392c65614Ce4d7b051923b", + [DeploymentMode.DEV]: "0xb62505feacC486e809392c65614Ce4d7b051923b", + [DeploymentMode.STAGE]: "0xb62505feacC486e809392c65614Ce4d7b051923b", + [DeploymentMode.PROD]: "0xb62505feacC486e809392c65614Ce4d7b051923b" +}; + +export const TRANSMITTER_ADDRESS: Record = { + [DeploymentMode.LOCAL]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", + [DeploymentMode.DEV]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", + [DeploymentMode.STAGE]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", + [DeploymentMode.PROD]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320" +}; + +export const SOCKET_OWNER_ADDRESS: Record = { + [DeploymentMode.LOCAL]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + [DeploymentMode.DEV]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + [DeploymentMode.STAGE]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + [DeploymentMode.PROD]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" +}; + +export const watcher = WATCHER_ADDRESS[mode]; +export const transmitter = TRANSMITTER_ADDRESS[mode]; +export const socketOwner = SOCKET_OWNER_ADDRESS[mode]; + export const skipEVMXDeployment = false; // Chain config @@ -188,7 +214,9 @@ export const MAX_MSG_VALUE_LIMIT = ethers.utils.parseEther("0.001"); // Auction parameters export const AUCTION_END_DELAY_SECONDS = 0; export const BID_TIMEOUT = 600; // 10 minutes -export const EXPIRY_TIME = 3600; // 1 hour +export const WRITE_EXPIRY_TIME = 3600*24; // 1 hour +export const READ_EXPIRY_TIME = 3600; // 1 hour +export const SCHEDULE_EXPIRY_TIME = 3600; // 1 hour export const MAX_RE_AUCTION_COUNT = 5; // Fees Pool Funding Amount diff --git a/hardhat-scripts/constants/constants.ts b/hardhat-scripts/constants/constants.ts index a9467b10..47a9582d 100644 --- a/hardhat-scripts/constants/constants.ts +++ b/hardhat-scripts/constants/constants.ts @@ -1,5 +1,7 @@ import { constants, ethers } from "ethers"; import { id } from "ethers/lib/utils"; +import { ChainSlug } from "../../src/chain-enums"; +import { mainnetChains } from "../config"; export const ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; @@ -9,8 +11,8 @@ export const IMPLEMENTATION_SLOT = export const FAST_SWITCHBOARD_TYPE = id("FAST"); export const CCTP_SWITCHBOARD_TYPE = id("CCTP"); -export const BYTES32_ZERO = ethers.utils.hexZeroPad(constants.AddressZero, 32); +export const BYTES32_ZERO = ethers.constants.HashZero; export const MSG_SB_FEES = "100000000"; -export const WRITE_MAX_FEES = ethers.utils.parseEther("0.000001"); +export const FEE_MANAGER_WRITE_MAX_FEES = ethers.utils.parseEther("10"); diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index 1bc851fc..5febe364 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -4,7 +4,7 @@ import { TokenMap } from "../../src"; export const tokens: TokenMap = { [DeploymentMode.LOCAL]: { - 421614: [ + [ChainSlug.ARBITRUM_SEPOLIA]: [ { name: "USDC", symbol: "USDC", @@ -12,7 +12,7 @@ export const tokens: TokenMap = { decimals: 6, }, ], - 11155420: [ + [ChainSlug.OPTIMISM_SEPOLIA]: [ { name: "USDC", symbol: "USDC", @@ -22,7 +22,15 @@ export const tokens: TokenMap = { ], }, [DeploymentMode.DEV]: { - 421614: [ + [ChainSlug.MANTA_PACIFIC]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", + decimals: 6, + }, + ], + [ChainSlug.ARBITRUM_SEPOLIA]: [ { name: "USDC", symbol: "USDC", @@ -30,7 +38,7 @@ export const tokens: TokenMap = { decimals: 6, }, ], - 11155420: [ + [ChainSlug.OPTIMISM_SEPOLIA]: [ { name: "USDC", symbol: "USDC", @@ -192,31 +200,81 @@ export const tokens: TokenMap = { ], }, [DeploymentMode.STAGE]: { - 8453: [ + [ChainSlug.ARBITRUM_SEPOLIA]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x2321BF7AdFaf49b1338F1Cd474859dBc0D8dfA96", + decimals: 6, + }, + ], + [ChainSlug.OPTIMISM_SEPOLIA]: [ { name: "USDC", symbol: "USDC", - address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + address: "0x15dbE4B96306Cc9Eba15D834d6c1a895cF4e1697", + decimals: 6, + }, + ], + [ChainSlug.BASE_SEPOLIA]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x95Be4D8500e3e5C970802c64b0755027d4Fc5C9F", + decimals: 6, + }, + ], + [ChainSlug.BASE]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x8aAaa86d6a4A4bEC43d985D4eCdF9CA02386d583", decimals: 6, }, ], - 42161: [ + [ChainSlug.ARBITRUM]: [ { name: "USDC", symbol: "USDC", - address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + address: "0x0E0F673C9b34d08b99407F1947A10Fe73aa17928", decimals: 6, }, ], - 10: [ + [ChainSlug.OPTIMISM]: [ { name: "USDC", symbol: "USDC", - address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + address: "0xE90649F3BA488D91c7e8E3025F639F435Fa85243", decimals: 6, }, ], }, + // [DeploymentMode.STAGE]: { + // 8453: [ + // { + // name: "USDC", + // symbol: "USDC", + // address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + // decimals: 6, + // }, + // ], + // 42161: [ + // { + // name: "USDC", + // symbol: "USDC", + // address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + // decimals: 6, + // }, + // ], + // 10: [ + // { + // name: "USDC", + // symbol: "USDC", + // address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + // decimals: 6, + // }, + // ], + // }, }; export const feePools: { [key: string]: string } = { diff --git a/hardhat-scripts/deploy/1.deploy.ts b/hardhat-scripts/deploy/1.deploy.ts index 35db34d6..1ed55f34 100644 --- a/hardhat-scripts/deploy/1.deploy.ts +++ b/hardhat-scripts/deploy/1.deploy.ts @@ -13,7 +13,9 @@ import { BID_TIMEOUT, chains, EVMX_CHAIN_ID, - EXPIRY_TIME, + WRITE_EXPIRY_TIME, + READ_EXPIRY_TIME, + SCHEDULE_EXPIRY_TIME, getFeesPlugChains, logConfig, MAX_RE_AUCTION_COUNT, @@ -31,7 +33,7 @@ import { FAST_SWITCHBOARD_TYPE, getFeePool, IMPLEMENTATION_SLOT, - WRITE_MAX_FEES, + FEE_MANAGER_WRITE_MAX_FEES, } from "../constants"; import { DeployParams, @@ -151,7 +153,7 @@ const deployEVMxContracts = async () => { addressResolver.address, deployUtils.addresses[Contracts.FeesPool], EVMxOwner, - WRITE_MAX_FEES, + FEE_MANAGER_WRITE_MAX_FEES, FAST_SWITCHBOARD_TYPE, ], proxyFactory, @@ -230,7 +232,7 @@ const deployEVMxContracts = async () => { EVMxOwner, deployUtils.addresses[Contracts.Watcher], WRITE_FEES, - EXPIRY_TIME, + WRITE_EXPIRY_TIME, ], proxyFactory, deployUtils @@ -240,7 +242,7 @@ const deployEVMxContracts = async () => { Contracts.ReadPrecompile, Contracts.ReadPrecompile, "contracts/evmx/watcher/precompiles/ReadPrecompile.sol", - [deployUtils.addresses[Contracts.Watcher], READ_FEES, EXPIRY_TIME], + [deployUtils.addresses[Contracts.Watcher], READ_FEES, READ_EXPIRY_TIME], deployUtils ); deployUtils.addresses[Contracts.ReadPrecompile] = readPrecompile.address; @@ -254,7 +256,7 @@ const deployEVMxContracts = async () => { MAX_SCHEDULE_DELAY_SECONDS, SCHEDULE_FEES_PER_SECOND, SCHEDULE_CALLBACK_FEES, - EXPIRY_TIME, + SCHEDULE_EXPIRY_TIME, ], deployUtils ); @@ -359,27 +361,25 @@ const deploySocketContracts = async () => { // ); // deployUtils.addresses[contractName] = messageSwitchboard.address; - if (getFeesPlugChains().includes(chain as ChainSlug)) { - contractName = Contracts.FeesPlug; - const feesPlug: Contract = await getOrDeploy( - contractName, - contractName, - `contracts/evmx/plugs/${contractName}.sol`, - [socket.address, socketOwner], - deployUtils - ); - deployUtils.addresses[contractName] = feesPlug.address; - - contractName = Contracts.SUSDC; - const susdcPlug: Contract = await getOrDeploy( - contractName, - contractName, - `contracts/evmx/plugs/${contractName}.sol`, - [18, socketOwner, socket.address, "SUSDC", "SUSDC"], - deployUtils - ); - deployUtils.addresses[contractName] = susdcPlug.address; - } + contractName = Contracts.FeesPlug; + const feesPlug: Contract = await getOrDeploy( + contractName, + contractName, + `contracts/evmx/plugs/${contractName}.sol`, + [socket.address, socketOwner], + deployUtils + ); + deployUtils.addresses[contractName] = feesPlug.address; + + contractName = Contracts.SUSDC; + const susdcPlug: Contract = await getOrDeploy( + contractName, + contractName, + `contracts/evmx/plugs/${contractName}.sol`, + [18, socketOwner, socket.address, "SUSDC", "SUSDC"], + deployUtils + ); + deployUtils.addresses[contractName] = susdcPlug.address; contractName = Contracts.ContractFactoryPlug; const contractFactoryPlug: Contract = await getOrDeploy( diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 6e112bfe..354e69c3 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -1,27 +1,13 @@ import { config as dotenvConfig } from "dotenv"; dotenvConfig(); -import { Contract, Signer, Wallet } from "ethers"; +import { Contract, Signer, Wallet, constants, ethers } from "ethers"; +import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; +import { chains, EVMX_CHAIN_ID, getFeesPlugChains, MAX_MSG_VALUE_LIMIT, mode } from "../config"; import { - ChainAddressesObj, - ChainSlug, - Contracts, - CCTP_DOMAINS, -} from "../../src"; -import { - chains, - EVMX_CHAIN_ID, - mainnetChains, - MAX_MSG_VALUE_LIMIT, - mode, - testnetChains, -} from "../config"; -import { - CCTP_SWITCHBOARD_TYPE, DeploymentAddresses, FAST_SWITCHBOARD_TYPE, getFeeTokens, - MSG_SB_FEES, } from "../constants"; import { DeployParams, @@ -48,6 +34,7 @@ export const main = async () => { export const configureChains = async (addresses: DeploymentAddresses) => { for (const chain of chains) { + console.log("Configuring chain: ", chain); let chainAddresses: ChainAddressesObj = addresses[chain] ? (addresses[chain] as ChainAddressesObj) : ({} as ChainAddressesObj); @@ -407,7 +394,10 @@ export const whitelistToken = async ( signer: Signer ) => { console.log("Whitelisting token"); - + if (!getFeesPlugChains().includes(chain as ChainSlug)) { + console.log("Skipping whitelisting token for fees plug, not part of fees plug chains"); + return; + } const feesPlugContract = ( await getInstance(Contracts.FeesPlug, feesPlugAddress) ).connect(signer); @@ -425,8 +415,7 @@ export const whitelistToken = async ( ...(await overrides(chain)), }); console.log( - `Whitelisting token ${token} for ${feesPlugContract.address}`, - tx.hash + `Whitelisting token ${token} for ${feesPlugContract.address}, txHash: ${tx.hash}` ); await tx.wait(); } else { @@ -452,18 +441,31 @@ export const setSUSDCToken = async ( chain ); - if ( - forwarderAddress.toLowerCase() != toBytes32FormatHexString(susdcAddress) - ) { - const tx = await contractInstance.setSusdcToken( - chain, - toBytes32FormatHexString(susdcAddress) + if (forwarderAddress != constants.AddressZero) { + const forwarderABI = [ + "function getOnChainAddress() external view returns (bytes32)", + ]; + const forwarderContract = new ethers.Contract( + forwarderAddress, + forwarderABI, + getWatcherSigner() ); - console.log(`Setting SUSDC token to ${susdcAddress}: ${tx.hash}`); - await tx.wait(); - } else { - console.log(`SUSDC token is already set to ${susdcAddress}`); + const onChainAddress = await forwarderContract.getOnChainAddress(); + + if ( + onChainAddress.toLowerCase() == + toBytes32FormatHexString(susdcAddress).toLowerCase() + ) { + console.log(`SUSDC token is already set to ${susdcAddress}`); + return; + } } + const tx = await contractInstance.setSusdcToken( + chain, + toBytes32FormatHexString(susdcAddress) + ); + console.log(`Setting SUSDC token to ${susdcAddress}, txHash: ${tx.hash}`); + await tx.wait(); }; main() diff --git a/hardhat-scripts/deploy/deployTestUSDC.ts b/hardhat-scripts/deploy/deployTestUSDC.ts index ebd3ec08..b4348718 100644 --- a/hardhat-scripts/deploy/deployTestUSDC.ts +++ b/hardhat-scripts/deploy/deployTestUSDC.ts @@ -20,6 +20,9 @@ const main = async () => { await deployTestUSDC(); }; +const chainsToDeploy = [ChainSlug.MANTA_PACIFIC]; +// const chainsToDeploy = chains; + const logBalances = async () => { const evmxDeployer = await getWatcherSigner(); const evmxBalance = await evmxDeployer.provider.getBalance( @@ -30,7 +33,7 @@ const logBalances = async () => { formatEther(evmxBalance) ); await Promise.all( - chains.map(async (chain) => { + chainsToDeploy.map(async (chain) => { const socketDeployer = await getSocketSigner(chain as ChainSlug); const socketBalance = await socketDeployer.provider.getBalance( socketDeployer.address @@ -43,7 +46,7 @@ const logBalances = async () => { ); }; const deployTestUSDC = async () => { - for (const chain of chains) { + for (const chain of chainsToDeploy) { const signer = getSocketSigner(chain as ChainSlug); try { if ( diff --git a/hardhat-scripts/s3Config/buildConfig.ts b/hardhat-scripts/s3Config/buildConfig.ts index 43970a26..d8541a6b 100644 --- a/hardhat-scripts/s3Config/buildConfig.ts +++ b/hardhat-scripts/s3Config/buildConfig.ts @@ -12,6 +12,7 @@ import { IndexerHighChains, IndexerLowChains, chains, + cronOnlyChains, mainnetChains, mode, testnetChains, @@ -21,6 +22,9 @@ import { getChainName, rpcKeys, wssRpcKeys } from "../utils/networks"; import { getChainType } from "./utils"; import { version } from "./version"; import { tokens } from "../constants/feeConstants"; +import { ChainGasPriceType } from "../../src/chain-enums/gasPriceType"; +import { GasPriceType } from "../../src/enums"; +import { ChainEventBlockRange } from "../../src/chain-enums/eventBlockRange"; dotenvConfig(); const addresses = getAddresses(mode); @@ -36,6 +40,7 @@ export const getS3Config = () => { evmxChainSlug: EVMX_CHAIN_ID as ChainSlug, indexerHighChains: IndexerHighChains, indexerLowChains: IndexerLowChains, + cronOnlyChains: cronOnlyChains, }; supportedChainSlugs.forEach((chainSlug) => { config.chains[chainSlug] = getChainConfig(chainSlug); @@ -56,11 +61,12 @@ export const getChainConfig = (chainSlug: ChainSlug) => { rpc: process.env[rpcKey], wssRpc: process.env[wssRpcKey], confirmations: 0, - eventBlockRange: 5000, + eventBlockRange: ChainEventBlockRange[chainSlug] ?? 5000, addresses: addresses[chainSlug], chainType: getChainType(chainSlug), finalityBlocks: getFinalityBlocks(chainSlug), nativeToken: Currency[chainSlug] ?? NativeTokens.ETHEREUM, + gasPriceType: ChainGasPriceType[chainSlug] ?? GasPriceType.EIP1559, }; return chainConfig; }; diff --git a/hardhat-scripts/test/chainTest.ts b/hardhat-scripts/test/chainTest.ts index 235f3313..1407ec34 100644 --- a/hardhat-scripts/test/chainTest.ts +++ b/hardhat-scripts/test/chainTest.ts @@ -3,10 +3,16 @@ dotenvConfig(); import { ethers } from "ethers"; import axios from "axios"; import { chains } from "../config/config"; -import { chainSlugToHardhatChainName } from "../../src"; +import { ChainSlug, chainSlugToHardhatChainName } from "../../src"; // Chain IDs to test -const TEST_CHAINS = chains; +const TEST_CHAINS = [ + // ChainSlug.HYPEREVM, + ChainSlug.MANTLE, + // ChainSlug.MANTA_PACIFIC, + // ChainSlug.BSC, + // ChainSlug.LINEA +]; interface ChainTestResult { chainId: number; diff --git a/hardhat-scripts/test/gas-fees.ts b/hardhat-scripts/test/gas-fees.ts index 89742e36..33f7ea43 100644 --- a/hardhat-scripts/test/gas-fees.ts +++ b/hardhat-scripts/test/gas-fees.ts @@ -1,15 +1,15 @@ import { ethers } from "ethers"; import { config as dotenvConfig } from "dotenv"; dotenvConfig(); -import { getChains } from "../config/config"; import { getProviderFromChainSlug } from "../utils"; +import { ChainSlug } from "../../src"; async function main() { console.log("=".repeat(80)); console.log("GAS FEE DATA ACROSS CHAINS"); console.log("=".repeat(80)); - const chains = getChains(); + const chains = [ChainSlug.MANTLE]; console.log(chains); for (const chainId of chains) { try { diff --git a/hardhat-scripts/utils/overrides.ts b/hardhat-scripts/utils/overrides.ts index 85bbea63..84f4ebfd 100644 --- a/hardhat-scripts/utils/overrides.ts +++ b/hardhat-scripts/utils/overrides.ts @@ -73,7 +73,7 @@ export const chainOverrides: { gasLimit: 1_000_000, }, [ChainSlug.MANTLE]: { - gasLimit: 3_000_551_690, + gasLimit: 10_000_551_690, gasPrice: parseUnits("0.03", "gwei"), }, diff --git a/package.json b/package.json index d2e8bc41..c5cf18f0 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.1.45", + "version": "1.1.47", "description": "socket protocol", "scripts": { "build": "yarn abi && tsc --project lib.tsconfig.json", @@ -20,8 +20,10 @@ "compile": "forge build", "deploy": "bash setupInfraContracts.sh", "test:counter": "npx hardhat run hardhat-scripts/test/chainTest.ts --no-compile", + "test:gas": "npx hardhat run hardhat-scripts/test/gas-fees.ts --no-compile", "publish-core": "yarn build && yarn publish --patch --no-git-tag-version", - "trace": "source .env && bash trace.sh" + "trace": "source .env && bash trace.sh", + "add:chain": "npx hardhat run hardhat-scripts/addChain/index.ts --no-compile" }, "pre-commit": [], "author": "", diff --git a/src/chain-enums/eventBlockRange.ts b/src/chain-enums/eventBlockRange.ts new file mode 100644 index 00000000..7ce76d20 --- /dev/null +++ b/src/chain-enums/eventBlockRange.ts @@ -0,0 +1,6 @@ +import { ChainSlug } from "./chainSlug"; + +export const ChainEventBlockRange = { + [ChainSlug.HYPEREVM]: 1000, + [ChainSlug.SEI]: 1000, +}; diff --git a/src/chain-enums/gasPriceType.ts b/src/chain-enums/gasPriceType.ts new file mode 100644 index 00000000..8ca971e2 --- /dev/null +++ b/src/chain-enums/gasPriceType.ts @@ -0,0 +1,8 @@ +import { ChainSlug } from "./chainSlug"; +import { GasPriceType } from "../enums"; + +export const ChainGasPriceType = { + [ChainSlug.BSC]: GasPriceType.LEGACY, + [ChainSlug.LINEA]: GasPriceType.LEGACY, + [ChainSlug.MANTLE]: GasPriceType.LEGACY, +}; diff --git a/src/enums.ts b/src/enums.ts index 4c556eb0..487ad142 100644 --- a/src/enums.ts +++ b/src/enums.ts @@ -76,6 +76,7 @@ export enum Contracts { FeesPool = "FeesPool", AsyncDeployer = "AsyncDeployer", DeployForwarder = "DeployForwarder", + Forwarder = "Forwarder", } export enum CallTypeNames { @@ -95,3 +96,8 @@ export enum FinalityBucketNames { MEDIUM = "MEDIUM", HIGH = "HIGH", } + +export enum GasPriceType { + LEGACY = "LEGACY", + EIP1559 = "EIP1559", +} diff --git a/src/types.ts b/src/types.ts index ee5373f3..1a961484 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { FinalityBucket } from "./enums"; +import { FinalityBucket, GasPriceType } from "./enums"; export enum ChainType { opStackL2Chain = "opStackL2Chain", @@ -60,6 +60,7 @@ export type S3Config = { mainnetChainSlugs: number[]; indexerHighChains: number[]; indexerLowChains: number[]; + cronOnlyChains: number[]; }; export type ChainConfig = { @@ -72,6 +73,7 @@ export type ChainConfig = { finalityBlocks: ChainFinalityBlocks; chainType: ChainType; nativeToken: string; + gasPriceType: GasPriceType; }; export { FinalityBucket }; diff --git a/test/SocketUSDC.sol b/test/SocketUSDC.sol new file mode 100644 index 00000000..987d5705 --- /dev/null +++ b/test/SocketUSDC.sol @@ -0,0 +1,30 @@ +import {ERC20} from "solady/tokens/ERC20.sol"; + +contract SocketUSDC is ERC20 { + string public _name; + string public _symbol; + uint8 public _decimals; + + constructor() ERC20() { + _name = "SocketUSDC"; + _symbol = "SUSDC"; + _decimals = 18; + _mint(msg.sender, 1000000000 ether); + } + + function name() public view override returns (string memory) { + return _name; + } + + function symbol() public view override returns (string memory) { + return _symbol; + } + + function decimals() public view override returns (uint8) { + return _decimals; + } + + function mint(address to, uint256 amount) public { + _mint(to, amount); + } +} From 811a166946d1cde62f4e29963ec949470a41a722 Mon Sep 17 00:00:00 2001 From: Akash Date: Wed, 17 Sep 2025 16:20:13 +0530 Subject: [PATCH 118/139] chore: package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5cf18f0..c8fc7752 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.1.47", + "version": "1.1.48", "description": "socket protocol", "scripts": { "build": "yarn abi && tsc --project lib.tsconfig.json", From 8170c95ab2020db8fa0e2bce5b21e56c1a0e8b6c Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 17 Sep 2025 18:24:38 +0530 Subject: [PATCH 119/139] fix: per chain fees --- contracts/evmx/fees/Credit.sol | 16 ++++++++++++++-- contracts/evmx/fees/FeesManager.sol | 28 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index 39e7f8b7..c9234141 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -76,8 +76,12 @@ abstract contract FeesManagerStorage is IFeesManager { /// @dev receiver address => bool mapping(address => bool) public whitelistedReceivers; + /// @notice Mapping to track max fees per chain slug + /// @dev chainSlug => max fees + mapping(uint32 => uint256) public maxFeesPerChainSlug; + // slots [60-107] reserved for gap - uint256[48] _gap_after; + uint256[47] _gap_after; // slots [108-157] 50 slots reserved for address resolver util // 9 slots for app gateway base @@ -145,6 +149,13 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew emit WhitelistedReceiverSet(receiver_, isWhitelisted_); } + function getMaxFees(uint32 chainSlug_) public view returns (uint256) { + return + maxFeesPerChainSlug[chainSlug_] == 0 + ? maxFeesPerChainSlug[evmxSlug] + : maxFeesPerChainSlug[chainSlug_]; + } + function isApproved(address user_, address appGateway_) public view returns (bool) { return allowance(user_, appGateway_) > 0; } @@ -228,6 +239,7 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew } function burn(uint32 chainSlug_, address receiver_, uint256 amount_) external async { + _setMaxFees(getMaxFees(chainSlug_)); _burn(msg.sender, amount_); ISUSDCPlug(forwarderAddresses[susdcToken][chainSlug_]).mint(receiver_, amount_); } @@ -372,7 +384,7 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew uint256 maxFees_, bytes memory payload_ ) internal async { - _setMaxFees(maxFees_); + _setMaxFees(getMaxFees(chainSlug_)); _setOverrides(consumeFrom_); QueueParams memory queueParams; diff --git a/contracts/evmx/fees/FeesManager.sol b/contracts/evmx/fees/FeesManager.sol index 3636f8ed..8b26e810 100644 --- a/contracts/evmx/fees/FeesManager.sol +++ b/contracts/evmx/fees/FeesManager.sol @@ -24,6 +24,11 @@ contract FeesManager is Credit { uint256 amount ); + /// @notice Emitted when max fees per chain slug is set + /// @param chainSlug The chain slug + /// @param fees The max fees + event MaxFeesPerChainSlugSet(uint32 indexed chainSlug, uint256 fees); + /// @notice Emitted when fees are unblocked /// @param requestCount The batch identifier /// @param consumeFrom The consume from address @@ -54,12 +59,35 @@ contract FeesManager is Credit { sbType = sbType_; feesPool = IFeesPool(feesPool_); susdcToken = _createContractId("susdc token"); + maxFeesPerChainSlug[evmxSlug_] = fees_; _setMaxFees(fees_); _initializeOwner(owner_); _initializeAppGateway(addressResolver_); } + function setChainMaxFees( + uint32[] calldata chainSlugs_, + uint256[] calldata maxFees_ + ) external onlyOwner { + if (chainSlugs_.length != maxFees_.length) revert("Array length mismatch"); + + for (uint256 i = 0; i < chainSlugs_.length; i++) { + maxFeesPerChainSlug[chainSlugs_[i]] = maxFees_[i]; + emit MaxFeesPerChainSlugSet(chainSlugs_[i], maxFees_[i]); + } + } + + function getChainMaxFees( + uint32[] calldata chainSlugs_ + ) external view returns (uint256[] memory) { + uint256[] memory maxFeesArray = new uint256[](chainSlugs_.length); + for (uint256 i = 0; i < chainSlugs_.length; i++) { + maxFeesArray[i] = maxFeesPerChainSlug[chainSlugs_[i]]; + } + return maxFeesArray; + } + function setMaxFees(uint256 fees_) external onlyOwner { _setMaxFees(fees_); } From 86124e84cade7125060f0298da3795f522d6e4e0 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 17 Sep 2025 18:25:39 +0530 Subject: [PATCH 120/139] fix: setter scripts --- hardhat-scripts/config/config.ts | 13 ++++--- hardhat-scripts/constants/constants.ts | 5 +-- hardhat-scripts/constants/fee.ts | 21 +++++++++++ hardhat-scripts/deploy/4.configureEVMx.ts | 44 ++++++++++++++++++++++- src/chain-enums/ethLikeChains.ts | 2 +- 5 files changed, 72 insertions(+), 13 deletions(-) create mode 100644 hardhat-scripts/constants/fee.ts diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 444aefd9..1c001962 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -184,28 +184,27 @@ export const WATCHER_ADDRESS: Record = { [DeploymentMode.LOCAL]: "0xb62505feacC486e809392c65614Ce4d7b051923b", [DeploymentMode.DEV]: "0xb62505feacC486e809392c65614Ce4d7b051923b", [DeploymentMode.STAGE]: "0xb62505feacC486e809392c65614Ce4d7b051923b", - [DeploymentMode.PROD]: "0xb62505feacC486e809392c65614Ce4d7b051923b" + [DeploymentMode.PROD]: "0xb62505feacC486e809392c65614Ce4d7b051923b", }; export const TRANSMITTER_ADDRESS: Record = { [DeploymentMode.LOCAL]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", - [DeploymentMode.DEV]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", + [DeploymentMode.DEV]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", [DeploymentMode.STAGE]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", - [DeploymentMode.PROD]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320" + [DeploymentMode.PROD]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", }; export const SOCKET_OWNER_ADDRESS: Record = { [DeploymentMode.LOCAL]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", [DeploymentMode.DEV]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - [DeploymentMode.STAGE]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - [DeploymentMode.PROD]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18" + [DeploymentMode.STAGE]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + [DeploymentMode.PROD]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", }; export const watcher = WATCHER_ADDRESS[mode]; export const transmitter = TRANSMITTER_ADDRESS[mode]; export const socketOwner = SOCKET_OWNER_ADDRESS[mode]; - export const skipEVMXDeployment = false; // Chain config export const EVMX_CHAIN_ID = EVM_CHAIN_ID_MAP[mode]; @@ -214,7 +213,7 @@ export const MAX_MSG_VALUE_LIMIT = ethers.utils.parseEther("0.001"); // Auction parameters export const AUCTION_END_DELAY_SECONDS = 0; export const BID_TIMEOUT = 600; // 10 minutes -export const WRITE_EXPIRY_TIME = 3600*24; // 1 hour +export const WRITE_EXPIRY_TIME = 3600 * 24; // 1 hour export const READ_EXPIRY_TIME = 3600; // 1 hour export const SCHEDULE_EXPIRY_TIME = 3600; // 1 hour export const MAX_RE_AUCTION_COUNT = 5; diff --git a/hardhat-scripts/constants/constants.ts b/hardhat-scripts/constants/constants.ts index 47a9582d..da2495ec 100644 --- a/hardhat-scripts/constants/constants.ts +++ b/hardhat-scripts/constants/constants.ts @@ -1,7 +1,5 @@ -import { constants, ethers } from "ethers"; +import { ethers } from "ethers"; import { id } from "ethers/lib/utils"; -import { ChainSlug } from "../../src/chain-enums"; -import { mainnetChains } from "../config"; export const ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"; @@ -14,5 +12,4 @@ export const CCTP_SWITCHBOARD_TYPE = id("CCTP"); export const BYTES32_ZERO = ethers.constants.HashZero; export const MSG_SB_FEES = "100000000"; - export const FEE_MANAGER_WRITE_MAX_FEES = ethers.utils.parseEther("10"); diff --git a/hardhat-scripts/constants/fee.ts b/hardhat-scripts/constants/fee.ts new file mode 100644 index 00000000..aa29b9e2 --- /dev/null +++ b/hardhat-scripts/constants/fee.ts @@ -0,0 +1,21 @@ +import { ChainSlug } from "../../src"; +import { parseEther } from "ethers/lib/utils"; +import { mainnetChains } from "../config"; + +const CHAIN_MAX_FEES: { [key: number]: string } = { + [ChainSlug.MAINNET]: parseEther("3").toHexString(), + [ChainSlug.INK]: parseEther("1").toHexString(), + [ChainSlug.HYPEREVM]: parseEther("1").toHexString(), + [ChainSlug.BERA]: parseEther("1").toHexString(), + [ChainSlug.UNICHAIN]: parseEther("1").toHexString(), + [ChainSlug.SEI]: parseEther("1").toHexString(), + [ChainSlug.BSC]: parseEther("1").toHexString(), + [ChainSlug.ARBITRUM]: parseEther("0.2").toHexString(), + [ChainSlug.KATANA]: parseEther("1").toHexString(), +}; + +export const getMaxFees = (chainSlug: ChainSlug) => { + if (CHAIN_MAX_FEES[chainSlug]) return CHAIN_MAX_FEES[chainSlug]; + if (mainnetChains.includes(chainSlug)) return parseEther("1").toHexString(); + return parseEther("0.1").toHexString(); +}; diff --git a/hardhat-scripts/deploy/4.configureEVMx.ts b/hardhat-scripts/deploy/4.configureEVMx.ts index 1b05f542..4852e2a1 100644 --- a/hardhat-scripts/deploy/4.configureEVMx.ts +++ b/hardhat-scripts/deploy/4.configureEVMx.ts @@ -3,7 +3,7 @@ dotenvConfig(); import { Contracts, EVMxAddressesObj, READ, SCHEDULE, WRITE } from "../../src"; import { Wallet } from "ethers"; -import { EVMX_CHAIN_ID, mode } from "../config"; +import { chains, EVMX_CHAIN_ID, mode } from "../config"; import { DeploymentAddresses } from "../constants"; import { getAddresses, @@ -12,6 +12,8 @@ import { overrides, updateContractSettings, } from "../utils"; +import { getMaxFees } from "../constants/fee"; +import { formatEther } from "ethers/lib/utils"; export const main = async () => { let addresses: DeploymentAddresses; @@ -29,6 +31,8 @@ export const main = async () => { export const configureEVMx = async (evmxAddresses: EVMxAddressesObj) => { const signer: Wallet = getWatcherSigner(); + await checkAndSetMaxFees(evmxAddresses); + await updateContractSettings( EVMX_CHAIN_ID, Contracts.AddressResolver, @@ -120,6 +124,44 @@ export const configureEVMx = async (evmxAddresses: EVMxAddressesObj) => { await setWatcherCoreContracts(evmxAddresses); }; +const checkAndSetMaxFees = async (evmxAddresses: EVMxAddressesObj) => { + const feesManagerContract = ( + await getInstance( + Contracts.FeesManager, + evmxAddresses[Contracts.FeesManager] + ) + ).connect(getWatcherSigner()); + + const currentMaxFeesArray = await feesManagerContract.getChainMaxFees(chains); + const maxFeesUpdateArray: { chainSlug: number; maxFees: string }[] = []; + + for (let i = 0; i < chains.length; i++) { + const chain = chains[i]; + const fees = getMaxFees(chain); + console.log( + `Chain ${chain} New Max Fees: ${formatEther( + fees + )} USDC, Current fees: ${formatEther(currentMaxFeesArray[i])} USDC` + ); + if (!currentMaxFeesArray[i].eq(fees)) { + console.log(`Set Chain Max Fees for chain ${chain}`); + maxFeesUpdateArray.push({ chainSlug: chain, maxFees: fees }); + } + } + + if (maxFeesUpdateArray.length > 0) { + const chains = maxFeesUpdateArray.map((item) => item.chainSlug); + const maxFees = maxFeesUpdateArray.map((item) => item.maxFees); + let tx = await feesManagerContract.setChainMaxFees(chains, maxFees); + console.log( + `Setting Chain Max Fees for chains: ${chains.join(", ")} tx hash: ${ + tx.hash + }` + ); + await tx.wait(); + } +}; + export const setWatcherCoreContracts = async ( evmxAddresses: EVMxAddressesObj ) => { diff --git a/src/chain-enums/ethLikeChains.ts b/src/chain-enums/ethLikeChains.ts index 658c5663..6d899a07 100644 --- a/src/chain-enums/ethLikeChains.ts +++ b/src/chain-enums/ethLikeChains.ts @@ -30,4 +30,4 @@ export const ethLikeChains = [ ChainSlug.CAMP, ChainSlug.PLUME, ChainSlug.RISE_TESTNET, -]; \ No newline at end of file +]; From 26220fc698dbba4732afeffebca815501ecd0122 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 17 Sep 2025 18:43:18 +0530 Subject: [PATCH 121/139] feat: upgrade dev --- deployments/dev_addresses.json | 4 ++-- deployments/dev_verification.json | 12 ++++++++++++ hardhat-scripts/constants/fee.ts | 4 +++- hardhat-scripts/deploy/4.configureEVMx.ts | 9 ++++++--- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 7cdef477..0bba1199 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -183,12 +183,12 @@ "DeployForwarderImpl": "0x69e3Dc5667f7413039fE3bFd335660A99DA869A9", "ERC1967Factory": "0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79", "FeesManager": "0xbCFf8224d89f0b4e9B14c4356720439111BAC2bC", - "FeesManagerImpl": "0xaAd0858c5DC1a3fFE09E8C393c7EC00145997A3E", + "FeesManagerImpl": "0x5E0dF9484D5ACd94028459fA7E90F4c3280147CA", "FeesPool": "0x13A3018920c7b56B20dd34E29C298121025E6de4", "PromiseResolver": "0xed318668898303141EA6B9c2a9F97D0622b0a530", "ReadPrecompile": "0x7C82C3d2aE1bFB4b1D294e5181bCd7489EF554d1", "RequestHandler": "0xf053AB14323FF52e7e65D6Fb12f86896F0865a36", - "RequestHandlerImpl": "0xe75f36466466D1383AC98ecfC627Ab49440C46c9", + "RequestHandlerImpl": "0x751085cA028D2BCfC58Cee2514DeF1ed72c843cd", "SchedulePrecompile": "0x4660c5fF2762E688f8D0def828ad161AE4940F57", "startBlock": 46937, "Watcher": "0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d", diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 78a1c32a..d2308b60 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -740,6 +740,18 @@ ], "8453": [], "14323": [ + [ + "0x751085cA028D2BCfC58Cee2514DeF1ed72c843cd", + "RequestHandler", + "contracts/evmx/watcher/RequestHandler.sol", + [] + ], + [ + "0x5E0dF9484D5ACd94028459fA7E90F4c3280147CA", + "FeesManager", + "contracts/evmx/fees/FeesManager.sol", + [] + ], [ "0x9b962E99fbc77aF1733CdE3bC65F1Cd621d4FDEF", "WritePrecompile", diff --git a/hardhat-scripts/constants/fee.ts b/hardhat-scripts/constants/fee.ts index aa29b9e2..2b54717e 100644 --- a/hardhat-scripts/constants/fee.ts +++ b/hardhat-scripts/constants/fee.ts @@ -1,6 +1,7 @@ import { ChainSlug } from "../../src"; import { parseEther } from "ethers/lib/utils"; -import { mainnetChains } from "../config"; +import { EVMX_CHAIN_ID, mainnetChains } from "../config"; +import { FEE_MANAGER_WRITE_MAX_FEES } from "./constants"; const CHAIN_MAX_FEES: { [key: number]: string } = { [ChainSlug.MAINNET]: parseEther("3").toHexString(), @@ -12,6 +13,7 @@ const CHAIN_MAX_FEES: { [key: number]: string } = { [ChainSlug.BSC]: parseEther("1").toHexString(), [ChainSlug.ARBITRUM]: parseEther("0.2").toHexString(), [ChainSlug.KATANA]: parseEther("1").toHexString(), + [EVMX_CHAIN_ID]: FEE_MANAGER_WRITE_MAX_FEES.toHexString(), }; export const getMaxFees = (chainSlug: ChainSlug) => { diff --git a/hardhat-scripts/deploy/4.configureEVMx.ts b/hardhat-scripts/deploy/4.configureEVMx.ts index 4852e2a1..77b2ea27 100644 --- a/hardhat-scripts/deploy/4.configureEVMx.ts +++ b/hardhat-scripts/deploy/4.configureEVMx.ts @@ -132,11 +132,14 @@ const checkAndSetMaxFees = async (evmxAddresses: EVMxAddressesObj) => { ) ).connect(getWatcherSigner()); - const currentMaxFeesArray = await feesManagerContract.getChainMaxFees(chains); + const allChains = [...chains, EVMX_CHAIN_ID]; + const currentMaxFeesArray = await feesManagerContract.getChainMaxFees( + allChains + ); const maxFeesUpdateArray: { chainSlug: number; maxFees: string }[] = []; - for (let i = 0; i < chains.length; i++) { - const chain = chains[i]; + for (let i = 0; i < allChains.length; i++) { + const chain = allChains[i]; const fees = getMaxFees(chain); console.log( `Chain ${chain} New Max Fees: ${formatEther( From 712a3840c190e98356102e716edc33b1bcf67183 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 17 Sep 2025 18:44:56 +0530 Subject: [PATCH 122/139] fix: commented transmitter check --- contracts/evmx/watcher/RequestHandler.sol | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contracts/evmx/watcher/RequestHandler.sol b/contracts/evmx/watcher/RequestHandler.sol index 02aec79e..a5d793e0 100644 --- a/contracts/evmx/watcher/RequestHandler.sol +++ b/contracts/evmx/watcher/RequestHandler.sol @@ -194,8 +194,11 @@ contract RequestHandler is RequestHandlerStorage, Initializable, Ownable, Addres if (r.writeCount == 0) revert NoWriteRequest(); // If same transmitter is reassigned, revert - if (r.requestFeesDetails.winningBid.transmitter == bid_.transmitter) - revert AlreadyAssigned(); + // todo: remove after game + // also this overrides a payload deadline hence an unexecuted payload can + // be executed by new added transmitters. need to fix this by marking req deadline or something. + // if (r.requestFeesDetails.winningBid.transmitter == bid_.transmitter) + // revert AlreadyAssigned(); // If a transmitter was already assigned previously, unblock the credits if (r.requestFeesDetails.winningBid.transmitter != address(0)) { From 039c2085c420a349a5b24542c6f211dd2891269c Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 17 Sep 2025 19:09:07 +0530 Subject: [PATCH 123/139] feat: mark katana legacy --- EventTopics.md | 1 + foundry.toml | 8 ++++---- hardhat-scripts/deploy/3.configureChains.ts | 12 ++++++++++-- setupInfraContracts.sh | 7 +++---- src/chain-enums/gasPriceType.ts | 1 + 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/EventTopics.md b/EventTopics.md index bad36f04..9c39c004 100644 --- a/EventTopics.md +++ b/EventTopics.md @@ -76,6 +76,7 @@ | `FeesPlugSet` | `(chainSlug: uint32, feesPlug: bytes32)` | `0x677a00737c8099aa9e6c554104ca7941deb59125335cfb3d0d9f604f178db59c` | | `FeesPoolSet` | `(feesPool: address)` | `0xd07af3fd70b48ab3c077a8d45c3a288498d905d0e3d1e65bc171f6c2e890d8ef` | | `Initialized` | `(version: uint64)` | `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` | +| `MaxFeesPerChainSlugSet` | `(chainSlug: uint32, fees: uint256)` | `0x555c0e83b1803127d009074a9b66632defb06a95449961404b3d454d6181b137` | | `OwnershipHandoverCanceled` | `(pendingOwner: address)` | `0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92` | | `OwnershipHandoverRequested` | `(pendingOwner: address)` | `0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d` | | `OwnershipTransferred` | `(oldOwner: address, newOwner: address)` | `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` | diff --git a/foundry.toml b/foundry.toml index 64ee9359..520bdc0c 100644 --- a/foundry.toml +++ b/foundry.toml @@ -22,15 +22,15 @@ via_ir = false 0x69e3Dc5667f7413039fE3bFd335660A99DA869A9 = "DeployForwarderImpl" 0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79 = "ERC1967Factory" 0xbCFf8224d89f0b4e9B14c4356720439111BAC2bC = "FeesManager" -0xaAd0858c5DC1a3fFE09E8C393c7EC00145997A3E = "FeesManagerImpl" +0x5E0dF9484D5ACd94028459fA7E90F4c3280147CA = "FeesManagerImpl" 0x13A3018920c7b56B20dd34E29C298121025E6de4 = "FeesPool" 0xed318668898303141EA6B9c2a9F97D0622b0a530 = "PromiseResolver" 0x7C82C3d2aE1bFB4b1D294e5181bCd7489EF554d1 = "ReadPrecompile" 0xf053AB14323FF52e7e65D6Fb12f86896F0865a36 = "RequestHandler" -0xe75f36466466D1383AC98ecfC627Ab49440C46c9 = "RequestHandlerImpl" +0x751085cA028D2BCfC58Cee2514DeF1ed72c843cd = "RequestHandlerImpl" 0x4660c5fF2762E688f8D0def828ad161AE4940F57 = "SchedulePrecompile" 0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d = "Watcher" 0xc7837f8dC93335d203DaBCb0c35dC401Ade9F1B3 = "WatcherImpl" 0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15 = "WritePrecompile" -0x52BfcB9bD0f1a387f28608C01cE8123310Ce3199 = "WritePrecompileImpl" -0xE776ef8fcE29F8E232692C133867fBcBaEB52DbD = "APP_GATEWAY" +0xd50ca68c3d0f8341CC19B7eFE7e564971ba52A1D = "WritePrecompileImpl" +0x075A9bD30ce5E0Bb08994774bD55Afcadd96950A = "APP_GATEWAY" diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 354e69c3..0d758e9e 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -3,7 +3,13 @@ dotenvConfig(); import { Contract, Signer, Wallet, constants, ethers } from "ethers"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; -import { chains, EVMX_CHAIN_ID, getFeesPlugChains, MAX_MSG_VALUE_LIMIT, mode } from "../config"; +import { + chains, + EVMX_CHAIN_ID, + getFeesPlugChains, + MAX_MSG_VALUE_LIMIT, + mode, +} from "../config"; import { DeploymentAddresses, FAST_SWITCHBOARD_TYPE, @@ -395,7 +401,9 @@ export const whitelistToken = async ( ) => { console.log("Whitelisting token"); if (!getFeesPlugChains().includes(chain as ChainSlug)) { - console.log("Skipping whitelisting token for fees plug, not part of fees plug chains"); + console.log( + "Skipping whitelisting token for fees plug, not part of fees plug chains" + ); return; } const feesPlugContract = ( diff --git a/setupInfraContracts.sh b/setupInfraContracts.sh index 064d5b50..88195f52 100644 --- a/setupInfraContracts.sh +++ b/setupInfraContracts.sh @@ -1,4 +1,4 @@ -if [ "$1" = "skip-compile" ]; then +if [ "$1" = "skip" ]; then time npx hardhat run hardhat-scripts/deploy/1.deploy.ts --no-compile else time npx hardhat run hardhat-scripts/deploy/1.deploy.ts @@ -15,8 +15,7 @@ time npx hardhat run hardhat-scripts/misc-scripts/errorCodes.ts --no-compile time npx hardhat run hardhat-scripts/misc-scripts/eventTopics.ts --no-compile time npx hardhat run hardhat-scripts/misc-scripts/functionSigs.ts --no-compile time npx ts-node hardhat-scripts/misc-scripts/createLabels.ts +yarn lint time npx hardhat run hardhat-scripts/verify/verify.ts --no-compile -# time npx hardhat run hardhat-scripts/deploy/deployTestUSDC.ts --no-compile - -yarn lint \ No newline at end of file +# time npx hardhat run hardhat-scripts/deploy/deployTestUSDC.ts --no-compile \ No newline at end of file diff --git a/src/chain-enums/gasPriceType.ts b/src/chain-enums/gasPriceType.ts index 8ca971e2..ac41cafd 100644 --- a/src/chain-enums/gasPriceType.ts +++ b/src/chain-enums/gasPriceType.ts @@ -5,4 +5,5 @@ export const ChainGasPriceType = { [ChainSlug.BSC]: GasPriceType.LEGACY, [ChainSlug.LINEA]: GasPriceType.LEGACY, [ChainSlug.MANTLE]: GasPriceType.LEGACY, + [ChainSlug.KATANA]: GasPriceType.LEGACY, }; From e7322848d39db1e0ac9d5d3305d028dd979fc260 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Wed, 17 Sep 2025 19:27:52 +0530 Subject: [PATCH 124/139] fix: update supported chains --- hardhat-scripts/config/config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 1c001962..16f330b9 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -53,6 +53,8 @@ export const getChains = () => { ChainSlug.CAMP, ChainSlug.FLOW, ChainSlug.MANTA_PACIFIC, + ChainSlug.MAINNET, + ChainSlug.PLUME, ]; case DeploymentMode.STAGE: return [ From 3c41419c8bc64283a565de2068846a088b9fc64b Mon Sep 17 00:00:00 2001 From: arthcp Date: Thu, 18 Sep 2025 01:33:26 +0400 Subject: [PATCH 125/139] feat: sei gas limit --- contracts/evmx/watcher/precompiles/WritePrecompile.sol | 3 +++ deployments/dev_addresses.json | 2 +- deployments/dev_verification.json | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index e363497b..638caaf2 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -125,6 +125,9 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc if (queueParams_.transaction.chainSlug == 5000) { // Mantle default gas limit queueParams_.overrideParams.gasLimit = 8_000_000_000; + } else if (queueParams_.transaction.chainSlug == 1329) { + // Sei default gas limit + queueParams_.overrideParams.gasLimit = 8_000_000; } else { queueParams_.overrideParams.gasLimit = 10_000_000; // other chains default gas limit } diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 0bba1199..e8ffaaf3 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -194,7 +194,7 @@ "Watcher": "0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d", "WatcherImpl": "0xc7837f8dC93335d203DaBCb0c35dC401Ade9F1B3", "WritePrecompile": "0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15", - "WritePrecompileImpl": "0xd50ca68c3d0f8341CC19B7eFE7e564971ba52A1D" + "WritePrecompileImpl": "0x2Bc1E6d31B1eabe4a11286c08aa67eCA29A55cc3" }, "43114": { "CCTPSwitchboard": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index d2308b60..5b635ceb 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -740,6 +740,12 @@ ], "8453": [], "14323": [ + [ + "0x2Bc1E6d31B1eabe4a11286c08aa67eCA29A55cc3", + "WritePrecompile", + "contracts/evmx/watcher/precompiles/WritePrecompile.sol", + [] + ], [ "0x751085cA028D2BCfC58Cee2514DeF1ed72c843cd", "RequestHandler", From 55ba9cc8fc20f76ced3bf8b7571acf88b33cdd90 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 18 Sep 2025 13:34:39 +0530 Subject: [PATCH 126/139] feat: test dev upgrades --- deployments/dev_addresses.json | 2 +- deployments/dev_verification.json | 143 +++++++++++++++++++++++++----- foundry.toml | 2 +- 3 files changed, 122 insertions(+), 25 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index e8ffaaf3..7029e274 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -192,7 +192,7 @@ "SchedulePrecompile": "0x4660c5fF2762E688f8D0def828ad161AE4940F57", "startBlock": 46937, "Watcher": "0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d", - "WatcherImpl": "0xc7837f8dC93335d203DaBCb0c35dC401Ade9F1B3", + "WatcherImpl": "0x2996bD0DCB7C349340715472518E76342AC31b1a", "WritePrecompile": "0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15", "WritePrecompileImpl": "0x2Bc1E6d31B1eabe4a11286c08aa67eCA29A55cc3" }, diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 5b635ceb..963776a0 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -53,7 +53,11 @@ "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", "Socket", "contracts/protocol/Socket.sol", - [1, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 1, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "56": [ @@ -110,7 +114,11 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [56, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 56, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "100": [ @@ -167,7 +175,11 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [100, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 100, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "130": [ @@ -224,7 +236,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [130, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 130, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "137": [ @@ -281,7 +297,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [137, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 137, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "146": [ @@ -338,7 +358,11 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [146, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 146, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "169": [ @@ -395,7 +419,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [169, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 169, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "484": [ @@ -452,7 +480,11 @@ "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", "Socket", "contracts/protocol/Socket.sol", - [484, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 484, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "747": [ @@ -509,7 +541,11 @@ "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", "Socket", "contracts/protocol/Socket.sol", - [747, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 747, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "999": [ @@ -566,7 +602,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [999, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 999, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "1329": [ @@ -623,7 +663,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [1329, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 1329, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "5000": [ @@ -680,7 +724,11 @@ "0xd8afBbB32706E7544f075151D4666D5B0B1F22CA", "Socket", "contracts/protocol/Socket.sol", - [5000, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 5000, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ], [ "0xeAb2e310A53FD3Fb34C2944690a79DFB2e834F20", @@ -735,7 +783,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [5000, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 5000, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "8453": [], @@ -750,12 +802,29 @@ "0x751085cA028D2BCfC58Cee2514DeF1ed72c843cd", "RequestHandler", "contracts/evmx/watcher/RequestHandler.sol", + "0x2996bD0DCB7C349340715472518E76342AC31b1a", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", [] ], [ - "0x5E0dF9484D5ACd94028459fA7E90F4c3280147CA", - "FeesManager", - "contracts/evmx/fees/FeesManager.sol", + "0xEd2a3cd034D873096E40C7E2EfB0e5BE99bBbF7a", + "PromiseResolver", + "contracts/evmx/watcher/PromiseResolver.sol", + [ + "0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d" + ] + ], + [ + "0x2ECF118De0d747980c5d934E78a5746B6b6fD441", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], + [ + "0x751085cA028D2BCfC58Cee2514DeF1ed72c843cd", + "RequestHandler", + "contracts/evmx/watcher/RequestHandler.sol", [] ], [ @@ -852,7 +921,11 @@ "0x5F77550E3072c913A20B2fbdAb14026fe0E8B450", "Socket", "contracts/protocol/Socket.sol", - [43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 43114, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ], [ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", @@ -867,7 +940,11 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [43114, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 43114, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "57073": [ @@ -924,7 +1001,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [57073, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 57073, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "59144": [ @@ -981,7 +1062,11 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [59144, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 59144, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "80094": [ @@ -1038,7 +1123,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [80094, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 80094, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "84532": [], @@ -1056,7 +1145,11 @@ "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", "Socket", "contracts/protocol/Socket.sol", - [98866, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 98866, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "421614": [], @@ -1114,7 +1207,11 @@ "0x5e1641B190B71ECCc85b1ECe934F31cD9b3dcF7a", "Socket", "contracts/protocol/Socket.sol", - [747474, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 747474, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "11155420": [] diff --git a/foundry.toml b/foundry.toml index 520bdc0c..9ac8bc70 100644 --- a/foundry.toml +++ b/foundry.toml @@ -30,7 +30,7 @@ via_ir = false 0x751085cA028D2BCfC58Cee2514DeF1ed72c843cd = "RequestHandlerImpl" 0x4660c5fF2762E688f8D0def828ad161AE4940F57 = "SchedulePrecompile" 0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d = "Watcher" -0xc7837f8dC93335d203DaBCb0c35dC401Ade9F1B3 = "WatcherImpl" +0x2996bD0DCB7C349340715472518E76342AC31b1a = "WatcherImpl" 0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15 = "WritePrecompile" 0xd50ca68c3d0f8341CC19B7eFE7e564971ba52A1D = "WritePrecompileImpl" 0x075A9bD30ce5E0Bb08994774bD55Afcadd96950A = "APP_GATEWAY" From a218a618e34db8d59c4cd8a5ccc5f266a6c6dafb Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Thu, 18 Sep 2025 15:03:44 +0530 Subject: [PATCH 127/139] feat: remove plume --- deployments/dev_addresses.json | 4 ---- deployments/dev_verification.json | 21 --------------------- hardhat-scripts/config/config.ts | 4 +--- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 7029e274..816370cc 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -265,10 +265,6 @@ "1": "0xE09CC429e77EE5DBeF68f3796b2A33BBDF39C03C" } }, - "98866": { - "Socket": "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", - "SocketBatcher": "0xbDE0D2da12F703Ccd275d721214745BccDCAD124" - }, "421614": { "CCTPSwitchboard": "0x0355064bBb553A3765af498004749fB2e19284c0", "CCTPSwitchboardId": "2", diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 963776a0..8ebf6a1d 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -1131,27 +1131,6 @@ ] ], "84532": [], - "98866": [ - [ - "0xbDE0D2da12F703Ccd275d721214745BccDCAD124", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38" - ] - ], - [ - "0xaC61f5696e0E2636dA7bD69827380f2Ab41A3C38", - "Socket", - "contracts/protocol/Socket.sol", - [ - 98866, - "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - "EVMX" - ] - ] - ], "421614": [], "747474": [ [ diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 16f330b9..b1df1e34 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -53,8 +53,7 @@ export const getChains = () => { ChainSlug.CAMP, ChainSlug.FLOW, ChainSlug.MANTA_PACIFIC, - ChainSlug.MAINNET, - ChainSlug.PLUME, + ChainSlug.MAINNET ]; case DeploymentMode.STAGE: return [ @@ -144,7 +143,6 @@ export const mainnetChains: Array = [ ChainSlug.BERA, ChainSlug.UNICHAIN, ChainSlug.SEI, - ChainSlug.PLUME, ChainSlug.MANTLE, ChainSlug.ZKSYNC, ChainSlug.FLOW, From 0d21aa208bc84419475114c657b2dbbdeaa1438e Mon Sep 17 00:00:00 2001 From: Akash Date: Fri, 19 Sep 2025 18:31:54 +0530 Subject: [PATCH 128/139] feat: prod deployment --- contracts/evmx/watcher/PromiseResolver.sol | 2 +- deployments/prod_addresses.json | 262 ++++ deployments/prod_verification.json | 1277 +++++++++++++++++++ hardhat-scripts/config/config.ts | 353 ++--- hardhat-scripts/constants/feeConstants.ts | 111 +- hardhat-scripts/deploy/2.roles.ts | 4 +- hardhat-scripts/deploy/3.configureChains.ts | 20 +- hardhat-scripts/deploy/7.upload.ts | 2 +- hardhat-scripts/test/chainTest.ts | 21 +- hardhat-scripts/utils/address.ts | 4 + hardhat-scripts/utils/appConfig.ts | 6 +- hardhat-scripts/utils/deployUtils.ts | 4 +- hardhat-scripts/utils/overrides.ts | 18 +- hardhat-scripts/verify/verify.ts | 3 + setupInfraContracts.sh | 20 +- 15 files changed, 1896 insertions(+), 211 deletions(-) create mode 100644 deployments/prod_addresses.json create mode 100644 deployments/prod_verification.json diff --git a/contracts/evmx/watcher/PromiseResolver.sol b/contracts/evmx/watcher/PromiseResolver.sol index 82367c13..21172725 100644 --- a/contracts/evmx/watcher/PromiseResolver.sol +++ b/contracts/evmx/watcher/PromiseResolver.sol @@ -82,7 +82,7 @@ contract PromiseResolver is IPromiseResolver, WatcherBase { // Get payload params from Watcher bytes32 payloadId = resolvedPromise_.payloadId; PayloadParams memory payloadParams = watcher__.getPayloadParams(payloadId); - if (payloadParams.deadline > block.timestamp) revert DeadlineNotPassedForOnChainRevert(); + // if (payloadParams.deadline > block.timestamp) revert DeadlineNotPassedForOnChainRevert(); // marks the request as cancelled and settles the fees requestHandler__().cancelRequestForReverts(uint40(payloadParams.payloadPointer >> 120)); diff --git a/deployments/prod_addresses.json b/deployments/prod_addresses.json new file mode 100644 index 00000000..e0140c7c --- /dev/null +++ b/deployments/prod_addresses.json @@ -0,0 +1,262 @@ +{ + "1": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 23384432, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "10": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 141266670, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "56": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 61510453, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "130": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 27383897, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "137": { + "ContractFactoryPlug": "0x9e95545a13351aA79096839738d0B09434804D03", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 76569494, + "SUSDC": "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "146": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 47181499, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "169": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 6390809, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "484": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 6737511, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "747": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 40559259, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "999": { + "ContractFactoryPlug": "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "FastSwitchboard": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FastSwitchboardId": "1", + "FeesPlug": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "Socket": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "startBlock": 14120257, + "SUSDC": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "SwitchboardIdToAddressMap": { + "1": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15" + } + }, + "1329": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 168597971, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "5000": { + "ContractFactoryPlug": "0xaeCC411d7230e4dAFa6dB9931a3bEf37764476a1", + "FastSwitchboard": "0x2277CF90Ce1cfE33b9576Ec06D9C4d053ee5f882", + "FastSwitchboardId": "1", + "FeesPlug": "0xFB349dcc5A1cB87Ff3A2b91C343814647AE820FC", + "Socket": "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", + "SocketBatcher": "0x334A27A9aBe4413CD3fE7EF777196eE0568b29D4", + "startBlock": 85006520, + "SUSDC": "0xe03f198c6Abee720b1a344d6624f7014c0F663E1", + "SwitchboardIdToAddressMap": { + "1": "0x2277CF90Ce1cfE33b9576Ec06D9C4d053ee5f882" + } + }, + "8453": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 35670115, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "12921": { + "AddressResolver": "0x3d6EB76db49BF4b9aAf01DBB79fCEC2Ee71e44e2", + "AddressResolverImpl": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "AsyncDeployer": "0xFA19dDA03A79f8Aef83C0505BF70ECa0Ac42608E", + "AsyncDeployerImpl": "0xb3A5132Df72F1597ab474d73d387ecF8647af669", + "AuctionManager": "0xcd5e9029a73890A5A3146bAddd272D65ac11521c", + "AuctionManagerImpl": "0xB604FBcA01897315D2d62A346DBf29796A4825D9", + "Configurations": "0x71B89bA78B9431d4E984893cD6885d39AD6c3c7A", + "ConfigurationsImpl": "0x117c63A8c9a980ddC60B2bF2b4701C9267f66394", + "DeployForwarder": "0xb6E6e6FCd2636B83C443628f3f5e42cB5Fcd44fD", + "DeployForwarderImpl": "0xf05f680E0611b81eD0255A1Cd829540504765711", + "ERC1967Factory": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FeesManager": "0xB63ab15c208A16a0480036C06e8828A4682E0B34", + "FeesManagerImpl": "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "FeesPool": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "PromiseResolver": "0xFB349dcc5A1cB87Ff3A2b91C343814647AE820FC", + "ReadPrecompile": "0x74D52027137a450b68315478AAE4528Ba839ea13", + "RequestHandler": "0x3C183Ad26A11A6691d43D031Fae3D51DaDC643Df", + "RequestHandlerImpl": "0x334A27A9aBe4413CD3fE7EF777196eE0568b29D4", + "SchedulePrecompile": "0xEE7b72D53FeC4Bed9F56CcEaD49217d152A22aC5", + "startBlock": 41, + "Watcher": "0x2566Bef2e914c7482d6FCB4955403fb0865951A5", + "WatcherImpl": "0x6d5B9B5aeC995F0CeE2dfbba3bdCc70698F2600d", + "WritePrecompile": "0xc6506b1C3f34297B4de32f08d8d50CB0E9e64842", + "WritePrecompileImpl": "0xe03f198c6Abee720b1a344d6624f7014c0F663E1" + }, + "42161": { + "ContractFactoryPlug": "0x176C18F871b9b0F363cBDF3b5a1872F6069CF538", + "FastSwitchboard": "0xb3A5132Df72F1597ab474d73d387ecF8647af669", + "FastSwitchboardId": "1", + "FeesPlug": "0x168d7bAb883a6430F0200bcaaFAf080371477B3D", + "Socket": "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "SocketBatcher": "0x9e95545a13351aA79096839738d0B09434804D03", + "startBlock": 380165474, + "SUSDC": "0x6d5B9B5aeC995F0CeE2dfbba3bdCc70698F2600d", + "SwitchboardIdToAddressMap": { + "1": "0xb3A5132Df72F1597ab474d73d387ecF8647af669" + } + }, + "43114": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 68887506, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "57073": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 24633467, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, + "80094": { + "ContractFactoryPlug": "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "FastSwitchboard": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FastSwitchboardId": "1", + "FeesPlug": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "startBlock": 10646345, + "SUSDC": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "SwitchboardIdToAddressMap": { + "1": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15" + } + }, + "747474": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 11389173, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + } +} diff --git a/deployments/prod_verification.json b/deployments/prod_verification.json new file mode 100644 index 00000000..9c51ef07 --- /dev/null +++ b/deployments/prod_verification.json @@ -0,0 +1,1277 @@ +{ + "1": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 1, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 1, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "10": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 10, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 10, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "56": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 56, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 56, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "130": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 130, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 130, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "137": [ + [ + "0x9e95545a13351aA79096839738d0B09434804D03", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 137, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 137, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "146": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 146, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 146, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "169": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 169, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 169, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "484": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 484, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 484, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "747": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 747, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 747, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "999": [ + [ + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 999, + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "Socket", + "contracts/protocol/Socket.sol", + [ + 999, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "1329": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 1329, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 1329, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "5000": [ + [ + "0xaeCC411d7230e4dAFa6dB9931a3bEf37764476a1", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe03f198c6Abee720b1a344d6624f7014c0F663E1", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xFB349dcc5A1cB87Ff3A2b91C343814647AE820FC", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x2277CF90Ce1cfE33b9576Ec06D9C4d053ee5f882", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 5000, + "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x334A27A9aBe4413CD3fE7EF777196eE0568b29D4", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2" + ] + ], + [ + "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", + "Socket", + "contracts/protocol/Socket.sol", + [ + 5000, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ], + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 5000, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 5000, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "8453": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 8453, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 8453, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "12921": [ + [ + "0xEE7b72D53FeC4Bed9F56CcEaD49217d152A22aC5", + "SchedulePrecompile", + "contracts/evmx/watcher/precompiles/SchedulePrecompile.sol", + [ + "0x2566Bef2e914c7482d6FCB4955403fb0865951A5", + 86400, + { + "type": "BigNumber", + "hex": "0x02540be400" + }, + { + "type": "BigNumber", + "hex": "0xe8d4a51000" + }, + 3600 + ] + ], + [ + "0x74D52027137a450b68315478AAE4528Ba839ea13", + "ReadPrecompile", + "contracts/evmx/watcher/precompiles/ReadPrecompile.sol", + [ + "0x2566Bef2e914c7482d6FCB4955403fb0865951A5", + { + "type": "BigNumber", + "hex": "0xe8d4a51000" + }, + 3600 + ] + ], + [ + "0xe03f198c6Abee720b1a344d6624f7014c0F663E1", + "WritePrecompile", + "contracts/evmx/watcher/precompiles/WritePrecompile.sol", + [] + ], + [ + "0xFB349dcc5A1cB87Ff3A2b91C343814647AE820FC", + "PromiseResolver", + "contracts/evmx/watcher/PromiseResolver.sol", + [ + "0x2566Bef2e914c7482d6FCB4955403fb0865951A5" + ] + ], + [ + "0x334A27A9aBe4413CD3fE7EF777196eE0568b29D4", + "RequestHandler", + "contracts/evmx/watcher/RequestHandler.sol", + [] + ], + [ + "0x117c63A8c9a980ddC60B2bF2b4701C9267f66394", + "Configurations", + "contracts/evmx/watcher/Configurations.sol", + [] + ], + [ + "0xf05f680E0611b81eD0255A1Cd829540504765711", + "DeployForwarder", + "contracts/evmx/helpers/DeployForwarder.sol", + [] + ], + [ + "0xB604FBcA01897315D2d62A346DBf29796A4825D9", + "AuctionManager", + "contracts/evmx/AuctionManager.sol", + [] + ], + [ + "0x6d5B9B5aeC995F0CeE2dfbba3bdCc70698F2600d", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], + [ + "0xb3A5132Df72F1597ab474d73d387ecF8647af669", + "AsyncDeployer", + "contracts/evmx/helpers/AsyncDeployer.sol", + [] + ], + [ + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "FeesManager", + "contracts/evmx/fees/FeesManager.sol", + [] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "AddressResolver", + "contracts/evmx/helpers/AddressResolver.sol", + [] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPool", + "contracts/evmx/fees/FeesPool.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "ERC1967Factory", + "lib/solady/src/utils/ERC1967Factory.sol", + [] + ] + ], + "42161": [ + [ + "0x176C18F871b9b0F363cBDF3b5a1872F6069CF538", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x6d5B9B5aeC995F0CeE2dfbba3bdCc70698F2600d", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x168d7bAb883a6430F0200bcaaFAf080371477B3D", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xb3A5132Df72F1597ab474d73d387ecF8647af669", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 42161, + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x9e95545a13351aA79096839738d0B09434804D03", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b" + ] + ], + [ + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "Socket", + "contracts/protocol/Socket.sol", + [ + 42161, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "43114": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 43114, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 43114, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "57073": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 57073, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 57073, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "80094": [ + [ + "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 80094, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 80094, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ], + "747474": [ + [ + "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "ContractFactoryPlug", + "contracts/evmx/plugs/ContractFactoryPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SUSDC", + "contracts/evmx/plugs/SUSDC.sol", + [ + 18, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SUSDC", + "SUSDC" + ] + ], + [ + "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "FeesPlug", + "contracts/evmx/plugs/FeesPlug.sol", + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboard", + "contracts/protocol/switchboard/FastSwitchboard.sol", + [ + 747474, + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" + ] + ], + [ + "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "SocketBatcher", + "contracts/protocol/SocketBatcher.sol", + [ + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + ] + ], + [ + "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "Socket", + "contracts/protocol/Socket.sol", + [ + 747474, + "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + "EVMX" + ] + ] + ] +} diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 16f330b9..a28333a2 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -3,129 +3,194 @@ dotenvConfig(); import { ethers, utils } from "ethers"; import { ChainSlug, DeploymentMode } from "../../src"; +// ============================================================================ +// DEPLOYMENT MODE CONFIGURATION +// ============================================================================ + export const mode = process.env.DEPLOYMENT_MODE as | DeploymentMode | DeploymentMode.DEV; -export const logConfig = () => { - console.log( - "================================================================================================================" - ); - console.log(""); - console.log(`Mode: ${mode}`); - console.log(""); - console.log( - `Make sure ${mode}_addresses.json and ${mode}_verification.json is cleared for given networks if redeploying!!` - ); - console.log(""); - console.log( - "================================================================================================================" - ); +// Mode-specific configuration interface +interface ModeConfig { + chains: ChainSlug[]; + feesPlugChains: ChainSlug[]; + evmChainId: number; + addresses: { + watcher: string; + transmitter: string; + socketOwner: string; + }; +} + +// Configuration for each deployment mode +const MODE_CONFIGS: Record = { + [DeploymentMode.LOCAL]: { + chains: [ + ChainSlug.ARBITRUM_SEPOLIA, + ChainSlug.OPTIMISM_SEPOLIA, + // ChainSlug.BASE_SEPOLIA, + ], + feesPlugChains: [], // Will use chains by default + evmChainId: 7625382, + addresses: { + watcher: "0xb62505feacC486e809392c65614Ce4d7b051923b", + transmitter: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", + socketOwner: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + }, + }, + [DeploymentMode.DEV]: { + chains: [ + ChainSlug.ARBITRUM_SEPOLIA, + ChainSlug.OPTIMISM_SEPOLIA, + ChainSlug.BASE_SEPOLIA, + ChainSlug.BSC, + ChainSlug.BASE, + ChainSlug.POLYGON_MAINNET, + ChainSlug.AVALANCHE, + ChainSlug.GNOSIS, + ChainSlug.LINEA, + ChainSlug.SONIC, + ChainSlug.KATANA, + ChainSlug.INK, + ChainSlug.HYPEREVM, + ChainSlug.BERA, + ChainSlug.UNICHAIN, + ChainSlug.SEI, + ChainSlug.MANTLE, + ChainSlug.CAMP, + ChainSlug.FLOW, + ChainSlug.MANTA_PACIFIC, + ChainSlug.MAINNET, + ChainSlug.PLUME, + ], + feesPlugChains: [], // Will use chains by default + evmChainId: 14323, + addresses: { + watcher: "0xb62505feacC486e809392c65614Ce4d7b051923b", + transmitter: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", + socketOwner: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + }, + }, + [DeploymentMode.STAGE]: { + chains: [ + // ChainSlug.MAINNET, + ChainSlug.ARBITRUM, + ChainSlug.ARBITRUM_SEPOLIA, + ChainSlug.OPTIMISM, + ChainSlug.OPTIMISM_SEPOLIA, + ChainSlug.BASE, + ChainSlug.BASE_SEPOLIA, + // ChainSlug.BSC, + // ChainSlug.POLYGON_MAINNET, + // ChainSlug.AVALANCHE, + // ChainSlug.GNOSIS, + // ChainSlug.LINEA, + // ChainSlug.SONIC, + // ChainSlug.KATANA, + // ChainSlug.CAMP, + // ChainSlug.INK, + // ChainSlug.HYPEREVM, + // ChainSlug.BERA, + // ChainSlug.UNICHAIN, + // ChainSlug.SEI, + // ChainSlug.MANTLE, + // ChainSlug.FLOW, + // ChainSlug.RISE_TESTNET, + ], + feesPlugChains: [], // Will use chains by default + evmChainId: 14323, // dummy stage + // evmChainId: 12921, + addresses: { + watcher: "0xb62505feacC486e809392c65614Ce4d7b051923b", + transmitter: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", + socketOwner: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + }, + }, + [DeploymentMode.PROD]: { + chains: [ + ChainSlug.ARBITRUM, + ChainSlug.AVALANCHE, + ChainSlug.BASE, + ChainSlug.BERA, + ChainSlug.BSC, + ChainSlug.CAMP, + ChainSlug.MAINNET, + ChainSlug.FLOW, + ChainSlug.HYPEREVM, + ChainSlug.INK, + ChainSlug.KATANA, + ChainSlug.MANTA_PACIFIC, + ChainSlug.MANTLE, + ChainSlug.OPTIMISM, + ChainSlug.POLYGON_MAINNET, + ChainSlug.SEI, + ChainSlug.SONIC, + ChainSlug.UNICHAIN + ], + feesPlugChains: [ + ChainSlug.ARBITRUM, + ChainSlug.AVALANCHE, + ChainSlug.BASE, + ChainSlug.MAINNET, + ChainSlug.HYPEREVM, + ChainSlug.OPTIMISM, + ChainSlug.POLYGON_MAINNET, + ChainSlug.SEI, + ChainSlug.SONIC, + ChainSlug.UNICHAIN, + ], + evmChainId: 12921, + addresses: { + watcher: "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + transmitter: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", + socketOwner: "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", + }, + }, }; -export const getChains = () => { - switch (mode) { - case DeploymentMode.LOCAL: - return [ - ChainSlug.ARBITRUM_SEPOLIA, - ChainSlug.OPTIMISM_SEPOLIA, - // ChainSlug.BASE_SEPOLIA, - ]; - case DeploymentMode.DEV: - return [ - ChainSlug.ARBITRUM_SEPOLIA, - ChainSlug.OPTIMISM_SEPOLIA, - ChainSlug.BASE_SEPOLIA, - ChainSlug.BSC, - ChainSlug.BASE, - ChainSlug.POLYGON_MAINNET, - ChainSlug.AVALANCHE, - ChainSlug.GNOSIS, - ChainSlug.LINEA, - ChainSlug.SONIC, - ChainSlug.KATANA, - ChainSlug.INK, - ChainSlug.HYPEREVM, - ChainSlug.BERA, - ChainSlug.UNICHAIN, - ChainSlug.SEI, - ChainSlug.MANTLE, - ChainSlug.CAMP, - ChainSlug.FLOW, - ChainSlug.MANTA_PACIFIC, - ChainSlug.MAINNET, - ChainSlug.PLUME, - ]; - case DeploymentMode.STAGE: - return [ - // ChainSlug.MAINNET, - ChainSlug.ARBITRUM, - ChainSlug.ARBITRUM_SEPOLIA, - ChainSlug.OPTIMISM, - ChainSlug.OPTIMISM_SEPOLIA, - ChainSlug.BASE, - ChainSlug.BASE_SEPOLIA, - // ChainSlug.BSC, - // ChainSlug.POLYGON_MAINNET, - // ChainSlug.AVALANCHE, - // ChainSlug.GNOSIS, - // ChainSlug.LINEA, - // ChainSlug.SONIC, - // ChainSlug.KATANA, - // ChainSlug.CAMP, - // ChainSlug.INK, - // ChainSlug.HYPEREVM, - // ChainSlug.BERA, - // ChainSlug.UNICHAIN, - // ChainSlug.SEI, - // ChainSlug.MANTLE, - // ChainSlug.FLOW, - // ChainSlug.RISE_TESTNET, - ]; - case DeploymentMode.PROD: - return [ - ChainSlug.OPTIMISM_SEPOLIA, - ChainSlug.ARBITRUM_SEPOLIA, - ChainSlug.BASE_SEPOLIA, - ChainSlug.SEPOLIA, - ]; - default: - throw new Error(`Invalid deployment mode: ${mode}`); +// Get current mode configuration +const getCurrentModeConfig = (): ModeConfig => { + const config = MODE_CONFIGS[mode]; + if (!config) { + throw new Error(`Invalid deployment mode: ${mode}`); } + return config; }; -export const getFeesPlugChains = (): Array => { - switch (mode) { - case DeploymentMode.LOCAL: - return getChains(); - case DeploymentMode.DEV: - return getChains(); - case DeploymentMode.STAGE: - return [ - ChainSlug.ARBITRUM, - ChainSlug.AVALANCHE, - ChainSlug.BASE, - ChainSlug.MAINNET, - ChainSlug.HYPEREVM, - ChainSlug.OPTIMISM, - ChainSlug.POLYGON_MAINNET, - ChainSlug.SEI, - ChainSlug.SONIC, - ChainSlug.UNICHAIN, - ]; - case DeploymentMode.PROD: - return getChains(); - default: - throw new Error(`Invalid deployment mode: ${mode}`); - } +// ============================================================================ +// MODE-DEPENDENT FUNCTIONS AND VALUES +// ============================================================================ + +export const getChains = (): ChainSlug[] => { + return getCurrentModeConfig().chains; }; +export const getFeesPlugChains = (): ChainSlug[] => { + const config = getCurrentModeConfig(); + return config.feesPlugChains.length > 0 ? config.feesPlugChains : config.chains; +}; + +// Current mode configuration values +export const chains: Array = getChains(); +export const EVMX_CHAIN_ID = getCurrentModeConfig().evmChainId; +export const watcher = getCurrentModeConfig().addresses.watcher; +export const transmitter = getCurrentModeConfig().addresses.transmitter; +export const socketOwner = getCurrentModeConfig().addresses.socketOwner; + + + +// ============================================================================ +// STATIC CHAIN DEFINITIONS +// ============================================================================ + export const testnetChains: Array = [ ChainSlug.OPTIMISM_SEPOLIA, ChainSlug.ARBITRUM_SEPOLIA, ChainSlug.BASE_SEPOLIA, ChainSlug.RISE_TESTNET, ]; + export const mainnetChains: Array = [ ChainSlug.MAINNET, ChainSlug.OPTIMISM, @@ -150,6 +215,12 @@ export const mainnetChains: Array = [ ChainSlug.FLOW, ]; +export const cronOnlyChains: Array = [ + ChainSlug.HYPEREVM, + ChainSlug.AVALANCHE, +]; + +// Derived chain lists (depend on current mode) export const IndexerHighChains: Array = [ ChainSlug.MAINNET, ChainSlug.OPTIMISM, @@ -167,55 +238,40 @@ export const IndexerLowChains: Array = getChains().filter( (chain) => !IndexerHighChains.includes(chain) ); -export const cronOnlyChains: Array = [ - ChainSlug.HYPEREVM, - ChainSlug.AVALANCHE, -]; - -export const chains: Array = getChains(); -export const EVM_CHAIN_ID_MAP: Record = { - [DeploymentMode.LOCAL]: 7625382, - [DeploymentMode.DEV]: 14323, - [DeploymentMode.STAGE]: 14323, // dummy stage - // [DeploymentMode.STAGE]: 12921, - [DeploymentMode.PROD]: 3605, -}; +// ============================================================================ +// UTILITY FUNCTIONS +// ============================================================================ -// Addresses -export const WATCHER_ADDRESS: Record = { - [DeploymentMode.LOCAL]: "0xb62505feacC486e809392c65614Ce4d7b051923b", - [DeploymentMode.DEV]: "0xb62505feacC486e809392c65614Ce4d7b051923b", - [DeploymentMode.STAGE]: "0xb62505feacC486e809392c65614Ce4d7b051923b", - [DeploymentMode.PROD]: "0xb62505feacC486e809392c65614Ce4d7b051923b", -}; - -export const TRANSMITTER_ADDRESS: Record = { - [DeploymentMode.LOCAL]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", - [DeploymentMode.DEV]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", - [DeploymentMode.STAGE]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", - [DeploymentMode.PROD]: "0x138e9840861C983DC0BB9b3e941FB7C0e9Ade320", +export const logConfig = () => { + console.log( + "================================================================================================================" + ); + console.log(""); + console.log(`Mode: ${mode}`); + console.log(""); + console.log( + `Make sure ${mode}_addresses.json and ${mode}_verification.json is cleared for given networks if redeploying!!` + ); + console.log(""); + console.log( + "================================================================================================================" + ); }; -export const SOCKET_OWNER_ADDRESS: Record = { - [DeploymentMode.LOCAL]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - [DeploymentMode.DEV]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - [DeploymentMode.STAGE]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", - [DeploymentMode.PROD]: "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", -}; +// ============================================================================ +// STATIC CONSTANTS (MODE-INDEPENDENT) +// ============================================================================ -export const watcher = WATCHER_ADDRESS[mode]; -export const transmitter = TRANSMITTER_ADDRESS[mode]; -export const socketOwner = SOCKET_OWNER_ADDRESS[mode]; +// Deployment flags +export const skipEVMXDeployment = true; -export const skipEVMXDeployment = false; -// Chain config -export const EVMX_CHAIN_ID = EVM_CHAIN_ID_MAP[mode]; +// Value limits export const MAX_MSG_VALUE_LIMIT = ethers.utils.parseEther("0.001"); // Auction parameters export const AUCTION_END_DELAY_SECONDS = 0; export const BID_TIMEOUT = 600; // 10 minutes -export const WRITE_EXPIRY_TIME = 3600 * 24; // 1 hour +export const WRITE_EXPIRY_TIME = 3600 * 24; // 24 hours export const READ_EXPIRY_TIME = 3600; // 1 hour export const SCHEDULE_EXPIRY_TIME = 3600; // 1 hour export const MAX_RE_AUCTION_COUNT = 5; @@ -230,13 +286,14 @@ export const TRIGGER_FEES = utils.parseEther("0.000001"); export const WRITE_FEES = utils.parseEther("0.000001"); export const SCHEDULE_FEES_PER_SECOND = utils.parseEther("0.00000001"); export const SCHEDULE_CALLBACK_FEES = utils.parseEther("0.000001"); -export const MAX_SCHEDULE_DELAY_SECONDS = 60 * 60 * 24; +export const MAX_SCHEDULE_DELAY_SECONDS = 60 * 60 * 24; // 24 hours -// Other constants +// Versioning export const UPGRADE_VERSION = 1; -// Transmitter constants +// Transmitter thresholds export const TRANSMITTER_CREDIT_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold export const TRANSMITTER_NATIVE_THRESHOLD = ethers.utils.parseEther("100"); // 100 ETH threshold +// Performance settings export const CONCURRENCY_LIMIT = 5; diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index 5febe364..5fbb94d7 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -249,39 +249,95 @@ export const tokens: TokenMap = { }, ], }, - // [DeploymentMode.STAGE]: { - // 8453: [ - // { - // name: "USDC", - // symbol: "USDC", - // address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", - // decimals: 6, - // }, - // ], - // 42161: [ - // { - // name: "USDC", - // symbol: "USDC", - // address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", - // decimals: 6, - // }, - // ], - // 10: [ - // { - // name: "USDC", - // symbol: "USDC", - // address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", - // decimals: 6, - // }, - // ], - // }, + [DeploymentMode.PROD]: { + [ChainSlug.ARBITRUM]: [ + { + name: "USDC", + symbol: "USDC", + address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", + decimals: 6, + }, + ], + [ChainSlug.AVALANCHE]: [ + { + name: "USDC", + symbol: "USDC", + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + decimals: 6, + }, + ], + [ChainSlug.BASE]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", + decimals: 6, + }, + ], + [ChainSlug.MAINNET]: [ + { + name: "USDC", + symbol: "USDC", + address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + decimals: 6, + }, + ], + [ChainSlug.HYPEREVM]: [ + { + name: "USDC", + symbol: "USDC", + address: "0xb88339CB7199b77E23DB6E890353E22632Ba630f", + decimals: 6, + }, + ], + [ChainSlug.OPTIMISM]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", + decimals: 6, + }, + ], + [ChainSlug.POLYGON_MAINNET]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", + decimals: 6, + }, + ], + [ChainSlug.SEI]: [ + { + name: "USDC", + symbol: "USDC", + address: "0xe15fC38F6D8c56aF07bbCBe3BAf5708A2Bf42392", + decimals: 6, + }, + ], + [ChainSlug.SONIC]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x29219dd400f2Bf60E5a23d13Be72B486D4038894", + decimals: 6, + }, + ], + [ChainSlug.UNICHAIN]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x078D782b760474a361dDA0AF3839290b0EF57AD6", + decimals: 6, + }, + ], + }, }; export const feePools: { [key: string]: string } = { [DeploymentMode.LOCAL]: "0x9De353dD1131aB4e502590D3a1832652FA316268", [DeploymentMode.DEV]: "0x13A3018920c7b56B20dd34E29C298121025E6de4", [DeploymentMode.STAGE]: "0xC8d803B7c1719cdF21392405879D1B56398045C4", - // [DeploymentMode.STAGE]: "0xC8d803B7c1719cdF21392405879D1B56398045C4", + [DeploymentMode.PROD]: "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", }; export const getFeeTokens = (chainSlug: number): string[] => { @@ -291,3 +347,4 @@ export const getFeeTokens = (chainSlug: number): string[] => { export const getFeePool = (): string => { return feePools[mode]; }; + diff --git a/hardhat-scripts/deploy/2.roles.ts b/hardhat-scripts/deploy/2.roles.ts index c60e4462..22941e37 100644 --- a/hardhat-scripts/deploy/2.roles.ts +++ b/hardhat-scripts/deploy/2.roles.ts @@ -12,7 +12,7 @@ import { CONCURRENCY_LIMIT, } from "../config"; import { DeploymentAddresses } from "../constants"; -import { getAddresses, getInstance, getRoleHash, overrides } from "../utils"; +import { getAddresses, getInstance, getReadOverrides, getRoleHash, overrides } from "../utils"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; import { ROLES } from "../constants/roles"; import { getWatcherSigner, getSocketSigner } from "../utils/sign"; @@ -53,7 +53,7 @@ async function setRoleForContract( roleHash, targetAddress, { - ...(await overrides(chain as ChainSlug)), + ...(await getReadOverrides(chain as ChainSlug)), from: signer.address, } ); diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index 0d758e9e..cb32b9c9 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -3,13 +3,7 @@ dotenvConfig(); import { Contract, Signer, Wallet, constants, ethers } from "ethers"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; -import { - chains, - EVMX_CHAIN_ID, - getFeesPlugChains, - MAX_MSG_VALUE_LIMIT, - mode, -} from "../config"; +import { chains, EVMX_CHAIN_ID, getFeesPlugChains, MAX_MSG_VALUE_LIMIT, mode } from "../config"; import { DeploymentAddresses, FAST_SWITCHBOARD_TYPE, @@ -19,6 +13,7 @@ import { DeployParams, getAddresses, getInstance, + getReadOverrides, getSocketSigner, getWatcherSigner, overrides, @@ -401,21 +396,22 @@ export const whitelistToken = async ( ) => { console.log("Whitelisting token"); if (!getFeesPlugChains().includes(chain as ChainSlug)) { - console.log( - "Skipping whitelisting token for fees plug, not part of fees plug chains" - ); + console.log("Skipping whitelisting token for fees plug, not part of fees plug chains"); return; } + console.log("feesPlugAddress: ", feesPlugAddress); const feesPlugContract = ( await getInstance(Contracts.FeesPlug, feesPlugAddress) ).connect(signer); - + // console.log("feesPlugContract: ", feesPlugContract); const tokens = getFeeTokens(chain); + console.log("tokens: ", tokens); if (tokens.length == 0) return; for (const token of tokens) { + console.log("token: ", token); const isWhitelisted = await feesPlugContract.whitelistedTokens(token, { - ...(await overrides(chain)), + ...(await getReadOverrides(chain as ChainSlug)), }); if (!isWhitelisted) { diff --git a/hardhat-scripts/deploy/7.upload.ts b/hardhat-scripts/deploy/7.upload.ts index f5f83811..02e5e462 100644 --- a/hardhat-scripts/deploy/7.upload.ts +++ b/hardhat-scripts/deploy/7.upload.ts @@ -15,7 +15,7 @@ const getBucketName = () => { case DeploymentMode.STAGE: return "socket-stage"; case DeploymentMode.PROD: - return "socket-prod"; + return "socket-stage"; default: throw new Error(`Invalid deployment mode: ${mode}`); } diff --git a/hardhat-scripts/test/chainTest.ts b/hardhat-scripts/test/chainTest.ts index 1407ec34..a243c257 100644 --- a/hardhat-scripts/test/chainTest.ts +++ b/hardhat-scripts/test/chainTest.ts @@ -7,11 +7,24 @@ import { ChainSlug, chainSlugToHardhatChainName } from "../../src"; // Chain IDs to test const TEST_CHAINS = [ - // ChainSlug.HYPEREVM, - ChainSlug.MANTLE, - // ChainSlug.MANTA_PACIFIC, + // ChainSlug.ARBITRUM, + // ChainSlug.AVALANCHE, + ChainSlug.BASE, + // ChainSlug.BERA, // ChainSlug.BSC, - // ChainSlug.LINEA + ChainSlug.CAMP, + ChainSlug.MAINNET, + ChainSlug.FLOW, + ChainSlug.HYPEREVM, + ChainSlug.INK, + // ChainSlug.KATANA, + ChainSlug.MANTA_PACIFIC, + ChainSlug.MANTLE, + ChainSlug.OPTIMISM, + ChainSlug.POLYGON_MAINNET, + ChainSlug.SEI, + // ChainSlug.SONIC, + // ChainSlug.UNICHAIN ]; interface ChainTestResult { diff --git a/hardhat-scripts/utils/address.ts b/hardhat-scripts/utils/address.ts index 254facbb..e87c4e3e 100644 --- a/hardhat-scripts/utils/address.ts +++ b/hardhat-scripts/utils/address.ts @@ -1,6 +1,7 @@ import dev_addresses from "../../deployments/dev_addresses.json"; import stage_addresses from "../../deployments/stage_addresses.json"; import local_addresses from "../../deployments/local_addresses.json"; +import prod_addresses from "../../deployments/prod_addresses.json"; import { ChainAddressesObj, EVMxAddressesObj } from "../../src/types"; import { DeploymentMode } from "../../src/enums"; @@ -17,6 +18,9 @@ export const getAddresses = ( case DeploymentMode.STAGE: // @ts-ignore return stage_addresses; + case DeploymentMode.PROD: + // @ts-ignore + return prod_addresses; default: throw new Error(`Invalid deployment mode: ${mode}`); } diff --git a/hardhat-scripts/utils/appConfig.ts b/hardhat-scripts/utils/appConfig.ts index 59497fcd..ddd74a28 100644 --- a/hardhat-scripts/utils/appConfig.ts +++ b/hardhat-scripts/utils/appConfig.ts @@ -1,6 +1,6 @@ import { Contract } from "ethers"; import { toBytes32Format } from "./address"; -import { overrides } from "./overrides"; +import { getReadOverrides, overrides } from "./overrides"; import { EVMX_CHAIN_ID } from "../config"; export const isConfigSetOnSocket = async ( @@ -11,7 +11,7 @@ export const isConfigSetOnSocket = async ( chain: number ) => { const plugConfigRegistered = await socket.getPlugConfig(plug.address, { - ...(await overrides(chain)), + ...(await getReadOverrides(chain)), }); return ( plugConfigRegistered.appGatewayId.toLowerCase() === @@ -31,7 +31,7 @@ export const isConfigSetOnEVMx = async ( chain, toBytes32Format(plug), { - ...(await overrides(EVMX_CHAIN_ID)), + ...(await getReadOverrides(EVMX_CHAIN_ID)), } ); return ( diff --git a/hardhat-scripts/utils/deployUtils.ts b/hardhat-scripts/utils/deployUtils.ts index dd71525e..fc1eaccd 100644 --- a/hardhat-scripts/utils/deployUtils.ts +++ b/hardhat-scripts/utils/deployUtils.ts @@ -11,6 +11,7 @@ import { getAddresses, overrides } from "../utils"; import { VerifyArgs } from "../verify"; import { DeploymentAddresses } from "../constants"; import { EVMX_CHAIN_ID, mode } from "../config"; +import { parseUnits } from "ethers/lib/utils"; export const deploymentsPath = path.join(__dirname, `/../../deployments/`); @@ -87,9 +88,10 @@ export async function deployContractWithArgs( const Contract: ContractFactory = await ethers.getContractFactory( contractName ); + const override = await overrides(chainSlug); // gasLimit is set to undefined to not use the value set in overrides const contract: Contract = await Contract.connect(signer).deploy(...args, { - ...(await overrides(chainSlug)), + ...override, }); await contract.deployed(); return contract; diff --git a/hardhat-scripts/utils/overrides.ts b/hardhat-scripts/utils/overrides.ts index 84f4ebfd..c947441e 100644 --- a/hardhat-scripts/utils/overrides.ts +++ b/hardhat-scripts/utils/overrides.ts @@ -11,6 +11,8 @@ type ChainOverride = { type?: number; gasLimit?: number; gasPrice?: BigNumberish; + maxPriorityFeePerGas?: BigNumberish; + maxFeePerGas?: BigNumberish; gasPriceMultiplier?: number; }; @@ -51,7 +53,12 @@ export const chainOverrides: { // gasPrice: 212_000_000_000, }, [ChainSlug.BASE]: { - // gasLimit: 2_000_000, + gasLimit: 2_000_000, + }, + [ChainSlug.BERA]: { + gasPrice: parseUnits("3", "gwei"), + gasLimit: 10_000_000, + gasPriceMultiplier: 2, }, [ChainSlug.AVALANCHE]: { gasLimit: 3_000_000, @@ -64,7 +71,7 @@ export const chainOverrides: { gasLimit: 10_000_000, }, [ChainSlug.ARBITRUM]: { - gasPrice: 100_629_157, + // gasPrice: 100_629_157, }, [ChainSlug.SEI]: { gasLimit: 3_000_000, @@ -128,3 +135,10 @@ export const getGasPrice = async ( } return gasPrice; }; + + +export const getReadOverrides = async ( + chainSlug: ChainSlug +) => { + return chainSlug==ChainSlug.MANTLE ? await overrides(chainSlug as ChainSlug) : {}; +}; \ No newline at end of file diff --git a/hardhat-scripts/verify/verify.ts b/hardhat-scripts/verify/verify.ts index d40709cd..9348ed87 100644 --- a/hardhat-scripts/verify/verify.ts +++ b/hardhat-scripts/verify/verify.ts @@ -12,6 +12,7 @@ import pLimit from "p-limit"; import local_addresses from "../../deployments/local_addresses.json"; import dev_verification from "../../deployments/dev_verification.json"; import stage_verification from "../../deployments/stage_verification.json"; +import prod_verification from "../../deployments/prod_verification.json"; const getVerificationParams = (mode: DeploymentMode) => { switch (mode) { @@ -22,6 +23,8 @@ const getVerificationParams = (mode: DeploymentMode) => { return dev_verification; case DeploymentMode.STAGE: return stage_verification; + case DeploymentMode.PROD: + return prod_verification; default: throw new Error(`Invalid deployment mode: ${mode}`); } diff --git a/setupInfraContracts.sh b/setupInfraContracts.sh index 88195f52..0cfdd483 100644 --- a/setupInfraContracts.sh +++ b/setupInfraContracts.sh @@ -8,14 +8,14 @@ time npx hardhat run hardhat-scripts/deploy/3.configureChains.ts --no-compile time npx hardhat run hardhat-scripts/deploy/4.configureEVMx.ts --no-compile time npx hardhat run hardhat-scripts/deploy/5.fundTransfers.ts --no-compile time npx hardhat run hardhat-scripts/deploy/6.connect.ts --no-compile -time npx ts-node hardhat-scripts/deploy/7.upload.ts -time npx ts-node hardhat-scripts/deploy/8.setupEnv.ts -time npx hardhat run hardhat-scripts/deploy/9.setupTransmitter.ts --no-compile -time npx hardhat run hardhat-scripts/misc-scripts/errorCodes.ts --no-compile -time npx hardhat run hardhat-scripts/misc-scripts/eventTopics.ts --no-compile -time npx hardhat run hardhat-scripts/misc-scripts/functionSigs.ts --no-compile -time npx ts-node hardhat-scripts/misc-scripts/createLabels.ts -yarn lint -time npx hardhat run hardhat-scripts/verify/verify.ts --no-compile +# time npx ts-node hardhat-scripts/deploy/7.upload.ts +# time npx ts-node hardhat-scripts/deploy/8.setupEnv.ts +# time npx hardhat run hardhat-scripts/deploy/9.setupTransmitter.ts --no-compile +# time npx hardhat run hardhat-scripts/misc-scripts/errorCodes.ts --no-compile +# time npx hardhat run hardhat-scripts/misc-scripts/eventTopics.ts --no-compile +# time npx hardhat run hardhat-scripts/misc-scripts/functionSigs.ts --no-compile +# time npx ts-node hardhat-scripts/misc-scripts/createLabels.ts +# yarn lint +# time npx hardhat run hardhat-scripts/verify/verify.ts --no-compile -# time npx hardhat run hardhat-scripts/deploy/deployTestUSDC.ts --no-compile \ No newline at end of file +# time npx hardhat run hardhat-scripts/deploy/deployTestUSDC.ts --no-compile From ac33353fc98726d24e545005980a050a8713c0c7 Mon Sep 17 00:00:00 2001 From: arthcp Date: Fri, 19 Sep 2025 19:41:14 +0400 Subject: [PATCH 129/139] feat: hyper gas limti --- .../evmx/watcher/precompiles/WritePrecompile.sol | 3 +++ deployments/dev_addresses.json | 2 +- deployments/dev_verification.json | 12 ++++++++++++ src/chain-enums/mainnetIds.ts | 1 - 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index 638caaf2..49409261 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -128,6 +128,9 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc } else if (queueParams_.transaction.chainSlug == 1329) { // Sei default gas limit queueParams_.overrideParams.gasLimit = 8_000_000; + } else if (queueParams_.transaction.chainSlug == 999) { + // HyperEVM default gas limit + queueParams_.overrideParams.gasLimit = 1_500_000; } else { queueParams_.overrideParams.gasLimit = 10_000_000; // other chains default gas limit } diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 816370cc..4d70b3cc 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -194,7 +194,7 @@ "Watcher": "0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d", "WatcherImpl": "0x2996bD0DCB7C349340715472518E76342AC31b1a", "WritePrecompile": "0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15", - "WritePrecompileImpl": "0x2Bc1E6d31B1eabe4a11286c08aa67eCA29A55cc3" + "WritePrecompileImpl": "0x41882aff9F7575473e5B6E613B371d04bdCCC728" }, "43114": { "CCTPSwitchboard": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 8ebf6a1d..c9dd2b2e 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -792,6 +792,18 @@ ], "8453": [], "14323": [ + [ + "0x41882aff9F7575473e5B6E613B371d04bdCCC728", + "WritePrecompile", + "contracts/evmx/watcher/precompiles/WritePrecompile.sol", + [] + ], + [ + "0xdBDA5D873b120f1C5E0966BFA3C588dDBECc9072", + "WritePrecompile", + "contracts/evmx/watcher/precompiles/WritePrecompile.sol", + [] + ], [ "0x2Bc1E6d31B1eabe4a11286c08aa67eCA29A55cc3", "WritePrecompile", diff --git a/src/chain-enums/mainnetIds.ts b/src/chain-enums/mainnetIds.ts index e61c0448..573761af 100644 --- a/src/chain-enums/mainnetIds.ts +++ b/src/chain-enums/mainnetIds.ts @@ -49,5 +49,4 @@ export const MainnetIds: ChainSlug[] = [ ChainSlug.WORLD_CHAIN, ChainSlug.FLOW, ChainSlug.CAMP, - ChainSlug.PLUME, ]; From 5e841f6e4b69318872912794cca23f8db2ce6b27 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 22 Sep 2025 19:57:09 +0530 Subject: [PATCH 130/139] feat: eth gas price and finality --- hardhat-scripts/config/config.ts | 8 ++++---- hardhat-scripts/test/gas-fees.ts | 7 +++---- src/chain-enums/gasPriceType.ts | 1 + src/finality.ts | 2 +- tsconfig.json | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 9f41a376..5dcbb521 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -41,9 +41,9 @@ const MODE_CONFIGS: Record = { }, [DeploymentMode.DEV]: { chains: [ - ChainSlug.ARBITRUM_SEPOLIA, - ChainSlug.OPTIMISM_SEPOLIA, - ChainSlug.BASE_SEPOLIA, + // ChainSlug.ARBITRUM_SEPOLIA, + // ChainSlug.OPTIMISM_SEPOLIA, + // ChainSlug.BASE_SEPOLIA, ChainSlug.BSC, ChainSlug.BASE, ChainSlug.POLYGON_MAINNET, @@ -62,7 +62,7 @@ const MODE_CONFIGS: Record = { ChainSlug.FLOW, ChainSlug.MANTA_PACIFIC, ChainSlug.MAINNET, - ChainSlug.PLUME, + // ChainSlug.PLUME, ], feesPlugChains: [], // Will use chains by default evmChainId: 14323, diff --git a/hardhat-scripts/test/gas-fees.ts b/hardhat-scripts/test/gas-fees.ts index 33f7ea43..52543211 100644 --- a/hardhat-scripts/test/gas-fees.ts +++ b/hardhat-scripts/test/gas-fees.ts @@ -1,7 +1,6 @@ import { ethers } from "ethers"; import { config as dotenvConfig } from "dotenv"; dotenvConfig(); -import { getProviderFromChainSlug } from "../utils"; import { ChainSlug } from "../../src"; async function main() { @@ -9,14 +8,14 @@ async function main() { console.log("GAS FEE DATA ACROSS CHAINS"); console.log("=".repeat(80)); - const chains = [ChainSlug.MANTLE]; + const chains = [ChainSlug.MAINNET]; console.log(chains); for (const chainId of chains) { try { console.log(`\nChain: ${chainId}`); console.log("-".repeat(40)); - const provider = getProviderFromChainSlug(chainId); + const provider = new ethers.providers.JsonRpcProvider(process.env.MAINNET_RPC); const feeData = await provider.getFeeData(); const gasPrice = await provider.getGasPrice(); @@ -46,7 +45,7 @@ async function main() { ethers.utils.formatUnits(gasPrice, "gwei"), "gwei" ); - } catch (error) { + } catch (error:any) { console.log( `Error fetching fee data for chain ${chainId}:`, error.message diff --git a/src/chain-enums/gasPriceType.ts b/src/chain-enums/gasPriceType.ts index ac41cafd..f79bb803 100644 --- a/src/chain-enums/gasPriceType.ts +++ b/src/chain-enums/gasPriceType.ts @@ -6,4 +6,5 @@ export const ChainGasPriceType = { [ChainSlug.LINEA]: GasPriceType.LEGACY, [ChainSlug.MANTLE]: GasPriceType.LEGACY, [ChainSlug.KATANA]: GasPriceType.LEGACY, + [ChainSlug.MAINNET]: GasPriceType.LEGACY, }; diff --git a/src/finality.ts b/src/finality.ts index 82a6d194..ef6cd5f1 100644 --- a/src/finality.ts +++ b/src/finality.ts @@ -19,7 +19,7 @@ export const finalityBlockOverrides: { [chainSlug in ChainSlug]?: ChainFinalityBlocks; } = { [ChainSlug.MAINNET]: { - [FinalityBucket.LOW]: 6, + [FinalityBucket.LOW]: 2, [FinalityBucket.MEDIUM]: "safe", [FinalityBucket.HIGH]: "finalized", }, diff --git a/tsconfig.json b/tsconfig.json index 7356b140..5afc3d90 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,17 +12,17 @@ "sourceMap": true, "declaration": true, - "alwaysStrict": true, + "alwaysStrict": false, "forceConsistentCasingInFileNames": true, "removeComments": true, - "noImplicitAny": true, - "strictNullChecks": true, - "strictFunctionTypes": true, + "noImplicitAny": false, + "strictNullChecks": false, + "strictFunctionTypes": false, "noImplicitThis": true, "noUnusedLocals": false, "noUnusedParameters": false, "noImplicitReturns": true, - "strict": true, + "strict": false, "noFallthroughCasesInSwitch": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, From 7c5bdb4ae0a626973b37a0c9c678907d94b3659f Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 22 Sep 2025 20:30:49 +0530 Subject: [PATCH 131/139] fix: max fees fees manager --- hardhat-scripts/constants/fee.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hardhat-scripts/constants/fee.ts b/hardhat-scripts/constants/fee.ts index 2b54717e..52fe2d39 100644 --- a/hardhat-scripts/constants/fee.ts +++ b/hardhat-scripts/constants/fee.ts @@ -4,15 +4,7 @@ import { EVMX_CHAIN_ID, mainnetChains } from "../config"; import { FEE_MANAGER_WRITE_MAX_FEES } from "./constants"; const CHAIN_MAX_FEES: { [key: number]: string } = { - [ChainSlug.MAINNET]: parseEther("3").toHexString(), - [ChainSlug.INK]: parseEther("1").toHexString(), - [ChainSlug.HYPEREVM]: parseEther("1").toHexString(), - [ChainSlug.BERA]: parseEther("1").toHexString(), - [ChainSlug.UNICHAIN]: parseEther("1").toHexString(), - [ChainSlug.SEI]: parseEther("1").toHexString(), - [ChainSlug.BSC]: parseEther("1").toHexString(), - [ChainSlug.ARBITRUM]: parseEther("0.2").toHexString(), - [ChainSlug.KATANA]: parseEther("1").toHexString(), + [ChainSlug.MAINNET]: parseEther("5").toHexString(), [EVMX_CHAIN_ID]: FEE_MANAGER_WRITE_MAX_FEES.toHexString(), }; From 992f7669e88efc9ce6c3ba70029dfc1f7516d078 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 22 Sep 2025 21:05:57 +0530 Subject: [PATCH 132/139] fix: uncomment bash --- setupInfraContracts.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/setupInfraContracts.sh b/setupInfraContracts.sh index 0cfdd483..9ccfe59b 100644 --- a/setupInfraContracts.sh +++ b/setupInfraContracts.sh @@ -8,14 +8,14 @@ time npx hardhat run hardhat-scripts/deploy/3.configureChains.ts --no-compile time npx hardhat run hardhat-scripts/deploy/4.configureEVMx.ts --no-compile time npx hardhat run hardhat-scripts/deploy/5.fundTransfers.ts --no-compile time npx hardhat run hardhat-scripts/deploy/6.connect.ts --no-compile -# time npx ts-node hardhat-scripts/deploy/7.upload.ts -# time npx ts-node hardhat-scripts/deploy/8.setupEnv.ts -# time npx hardhat run hardhat-scripts/deploy/9.setupTransmitter.ts --no-compile -# time npx hardhat run hardhat-scripts/misc-scripts/errorCodes.ts --no-compile -# time npx hardhat run hardhat-scripts/misc-scripts/eventTopics.ts --no-compile -# time npx hardhat run hardhat-scripts/misc-scripts/functionSigs.ts --no-compile -# time npx ts-node hardhat-scripts/misc-scripts/createLabels.ts -# yarn lint -# time npx hardhat run hardhat-scripts/verify/verify.ts --no-compile +time npx ts-node hardhat-scripts/deploy/7.upload.ts +time npx ts-node hardhat-scripts/deploy/8.setupEnv.ts +time npx hardhat run hardhat-scripts/deploy/9.setupTransmitter.ts --no-compile +time npx hardhat run hardhat-scripts/misc-scripts/errorCodes.ts --no-compile +time npx hardhat run hardhat-scripts/misc-scripts/eventTopics.ts --no-compile +time npx hardhat run hardhat-scripts/misc-scripts/functionSigs.ts --no-compile +time npx ts-node hardhat-scripts/misc-scripts/createLabels.ts +yarn lint +time npx hardhat run hardhat-scripts/verify/verify.ts --no-compile -# time npx hardhat run hardhat-scripts/deploy/deployTestUSDC.ts --no-compile +time npx hardhat run hardhat-scripts/deploy/deployTestUSDC.ts --no-compile From 15ce8b1a6d47128b27d09c89164fa485a865afc6 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 22 Sep 2025 22:11:11 +0530 Subject: [PATCH 133/139] fix: upgrade evmx contracts --- deployments/prod_addresses.json | 6 +++--- deployments/prod_verification.json | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/deployments/prod_addresses.json b/deployments/prod_addresses.json index e0140c7c..0471cf78 100644 --- a/deployments/prod_addresses.json +++ b/deployments/prod_addresses.json @@ -181,18 +181,18 @@ "DeployForwarderImpl": "0xf05f680E0611b81eD0255A1Cd829540504765711", "ERC1967Factory": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", "FeesManager": "0xB63ab15c208A16a0480036C06e8828A4682E0B34", - "FeesManagerImpl": "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", + "FeesManagerImpl": "0x9f3CDba2262DF94e415E092A4228ee7E6846ea1b", "FeesPool": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", "PromiseResolver": "0xFB349dcc5A1cB87Ff3A2b91C343814647AE820FC", "ReadPrecompile": "0x74D52027137a450b68315478AAE4528Ba839ea13", "RequestHandler": "0x3C183Ad26A11A6691d43D031Fae3D51DaDC643Df", - "RequestHandlerImpl": "0x334A27A9aBe4413CD3fE7EF777196eE0568b29D4", + "RequestHandlerImpl": "0x0303B6f54afA36B0808FDE6aaE9c3eD271b01119", "SchedulePrecompile": "0xEE7b72D53FeC4Bed9F56CcEaD49217d152A22aC5", "startBlock": 41, "Watcher": "0x2566Bef2e914c7482d6FCB4955403fb0865951A5", "WatcherImpl": "0x6d5B9B5aeC995F0CeE2dfbba3bdCc70698F2600d", "WritePrecompile": "0xc6506b1C3f34297B4de32f08d8d50CB0E9e64842", - "WritePrecompileImpl": "0xe03f198c6Abee720b1a344d6624f7014c0F663E1" + "WritePrecompileImpl": "0xcd460687fe2a74ddEE8f2E3d791e1df306713353" }, "42161": { "ContractFactoryPlug": "0x176C18F871b9b0F363cBDF3b5a1872F6069CF538", diff --git a/deployments/prod_verification.json b/deployments/prod_verification.json index 9c51ef07..7f88328e 100644 --- a/deployments/prod_verification.json +++ b/deployments/prod_verification.json @@ -861,6 +861,24 @@ ] ], "12921": [ + [ + "0xcd460687fe2a74ddEE8f2E3d791e1df306713353", + "WritePrecompile", + "contracts/evmx/watcher/precompiles/WritePrecompile.sol", + [] + ], + [ + "0x0303B6f54afA36B0808FDE6aaE9c3eD271b01119", + "RequestHandler", + "contracts/evmx/watcher/RequestHandler.sol", + [] + ], + [ + "0x9f3CDba2262DF94e415E092A4228ee7E6846ea1b", + "FeesManager", + "contracts/evmx/fees/FeesManager.sol", + [] + ], [ "0xEE7b72D53FeC4Bed9F56CcEaD49217d152A22aC5", "SchedulePrecompile", From bf7e4be0e1eae5f4ea62da1c048c143a0e0f3242 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 22 Sep 2025 22:33:51 +0530 Subject: [PATCH 134/139] fix: lint --- hardhat-scripts/config/config.ts | 10 +++++----- hardhat-scripts/constants/feeConstants.ts | 1 - hardhat-scripts/deploy/2.roles.ts | 8 +++++++- hardhat-scripts/deploy/3.configureChains.ts | 12 ++++++++++-- hardhat-scripts/test/gas-fees.ts | 6 ++++-- hardhat-scripts/utils/overrides.ts | 11 +++++------ 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 5dcbb521..8b177c43 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -126,7 +126,7 @@ const MODE_CONFIGS: Record = { ChainSlug.POLYGON_MAINNET, ChainSlug.SEI, ChainSlug.SONIC, - ChainSlug.UNICHAIN + ChainSlug.UNICHAIN, ], feesPlugChains: [ ChainSlug.ARBITRUM, @@ -168,7 +168,9 @@ export const getChains = (): ChainSlug[] => { export const getFeesPlugChains = (): ChainSlug[] => { const config = getCurrentModeConfig(); - return config.feesPlugChains.length > 0 ? config.feesPlugChains : config.chains; + return config.feesPlugChains.length > 0 + ? config.feesPlugChains + : config.chains; }; // Current mode configuration values @@ -178,8 +180,6 @@ export const watcher = getCurrentModeConfig().addresses.watcher; export const transmitter = getCurrentModeConfig().addresses.transmitter; export const socketOwner = getCurrentModeConfig().addresses.socketOwner; - - // ============================================================================ // STATIC CHAIN DEFINITIONS // ============================================================================ @@ -262,7 +262,7 @@ export const logConfig = () => { // ============================================================================ // Deployment flags -export const skipEVMXDeployment = true; +export const skipEVMXDeployment = false; // Value limits export const MAX_MSG_VALUE_LIMIT = ethers.utils.parseEther("0.001"); diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index 5fbb94d7..abec5b0f 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -347,4 +347,3 @@ export const getFeeTokens = (chainSlug: number): string[] => { export const getFeePool = (): string => { return feePools[mode]; }; - diff --git a/hardhat-scripts/deploy/2.roles.ts b/hardhat-scripts/deploy/2.roles.ts index 22941e37..0f43c4d3 100644 --- a/hardhat-scripts/deploy/2.roles.ts +++ b/hardhat-scripts/deploy/2.roles.ts @@ -12,7 +12,13 @@ import { CONCURRENCY_LIMIT, } from "../config"; import { DeploymentAddresses } from "../constants"; -import { getAddresses, getInstance, getReadOverrides, getRoleHash, overrides } from "../utils"; +import { + getAddresses, + getInstance, + getReadOverrides, + getRoleHash, + overrides, +} from "../utils"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; import { ROLES } from "../constants/roles"; import { getWatcherSigner, getSocketSigner } from "../utils/sign"; diff --git a/hardhat-scripts/deploy/3.configureChains.ts b/hardhat-scripts/deploy/3.configureChains.ts index cb32b9c9..7c6a65de 100644 --- a/hardhat-scripts/deploy/3.configureChains.ts +++ b/hardhat-scripts/deploy/3.configureChains.ts @@ -3,7 +3,13 @@ dotenvConfig(); import { Contract, Signer, Wallet, constants, ethers } from "ethers"; import { ChainAddressesObj, ChainSlug, Contracts } from "../../src"; -import { chains, EVMX_CHAIN_ID, getFeesPlugChains, MAX_MSG_VALUE_LIMIT, mode } from "../config"; +import { + chains, + EVMX_CHAIN_ID, + getFeesPlugChains, + MAX_MSG_VALUE_LIMIT, + mode, +} from "../config"; import { DeploymentAddresses, FAST_SWITCHBOARD_TYPE, @@ -396,7 +402,9 @@ export const whitelistToken = async ( ) => { console.log("Whitelisting token"); if (!getFeesPlugChains().includes(chain as ChainSlug)) { - console.log("Skipping whitelisting token for fees plug, not part of fees plug chains"); + console.log( + "Skipping whitelisting token for fees plug, not part of fees plug chains" + ); return; } console.log("feesPlugAddress: ", feesPlugAddress); diff --git a/hardhat-scripts/test/gas-fees.ts b/hardhat-scripts/test/gas-fees.ts index 52543211..00cecc30 100644 --- a/hardhat-scripts/test/gas-fees.ts +++ b/hardhat-scripts/test/gas-fees.ts @@ -15,7 +15,9 @@ async function main() { console.log(`\nChain: ${chainId}`); console.log("-".repeat(40)); - const provider = new ethers.providers.JsonRpcProvider(process.env.MAINNET_RPC); + const provider = new ethers.providers.JsonRpcProvider( + process.env.MAINNET_RPC + ); const feeData = await provider.getFeeData(); const gasPrice = await provider.getGasPrice(); @@ -45,7 +47,7 @@ async function main() { ethers.utils.formatUnits(gasPrice, "gwei"), "gwei" ); - } catch (error:any) { + } catch (error: any) { console.log( `Error fetching fee data for chain ${chainId}:`, error.message diff --git a/hardhat-scripts/utils/overrides.ts b/hardhat-scripts/utils/overrides.ts index c947441e..dc4c17d2 100644 --- a/hardhat-scripts/utils/overrides.ts +++ b/hardhat-scripts/utils/overrides.ts @@ -136,9 +136,8 @@ export const getGasPrice = async ( return gasPrice; }; - -export const getReadOverrides = async ( - chainSlug: ChainSlug -) => { - return chainSlug==ChainSlug.MANTLE ? await overrides(chainSlug as ChainSlug) : {}; -}; \ No newline at end of file +export const getReadOverrides = async (chainSlug: ChainSlug) => { + return chainSlug == ChainSlug.MANTLE + ? await overrides(chainSlug as ChainSlug) + : {}; +}; From 8decf3bf827dd54fcf40262bb562b36e08bbc3b4 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Mon, 22 Sep 2025 22:36:37 +0530 Subject: [PATCH 135/139] fix: upgrade contracts and fix expiry --- deployments/dev_addresses.json | 8 +- deployments/dev_verification.json | 36 ++++++++ deployments/prod_addresses.json | 2 +- deployments/prod_verification.json | 128 ++++++---------------------- deployments/stage_addresses.json | 8 +- deployments/stage_verification.json | 64 ++++++++++++-- 6 files changed, 129 insertions(+), 117 deletions(-) diff --git a/deployments/dev_addresses.json b/deployments/dev_addresses.json index 816370cc..080bace4 100644 --- a/deployments/dev_addresses.json +++ b/deployments/dev_addresses.json @@ -183,18 +183,18 @@ "DeployForwarderImpl": "0x69e3Dc5667f7413039fE3bFd335660A99DA869A9", "ERC1967Factory": "0x4f1Cd0CdBc7EA445b8B34Af8844fA4D4B5f48b79", "FeesManager": "0xbCFf8224d89f0b4e9B14c4356720439111BAC2bC", - "FeesManagerImpl": "0x5E0dF9484D5ACd94028459fA7E90F4c3280147CA", + "FeesManagerImpl": "0x62FB943442E577901Ad42Da5c64aaf850B43049c", "FeesPool": "0x13A3018920c7b56B20dd34E29C298121025E6de4", "PromiseResolver": "0xed318668898303141EA6B9c2a9F97D0622b0a530", "ReadPrecompile": "0x7C82C3d2aE1bFB4b1D294e5181bCd7489EF554d1", "RequestHandler": "0xf053AB14323FF52e7e65D6Fb12f86896F0865a36", - "RequestHandlerImpl": "0x751085cA028D2BCfC58Cee2514DeF1ed72c843cd", + "RequestHandlerImpl": "0x4904A0f8E054f2cd6594a0e1BAB4583DF43d2e49", "SchedulePrecompile": "0x4660c5fF2762E688f8D0def828ad161AE4940F57", "startBlock": 46937, "Watcher": "0xCeEc354B7784C667Bd661483Ae30C8d4eBA96e1d", - "WatcherImpl": "0x2996bD0DCB7C349340715472518E76342AC31b1a", + "WatcherImpl": "0xce594728977675546d5da6152a076179982F1D39", "WritePrecompile": "0x9a580f1A4AE6A37CCEe73261B796F85EFbE55B15", - "WritePrecompileImpl": "0x2Bc1E6d31B1eabe4a11286c08aa67eCA29A55cc3" + "WritePrecompileImpl": "0xE62b0f1398F97653Cb1F7C4bA8F214953982c587" }, "43114": { "CCTPSwitchboard": "0xa33ACE59E4b0d9a45Cd4a3F0DBAB86D87BDd67e2", diff --git a/deployments/dev_verification.json b/deployments/dev_verification.json index 8ebf6a1d..2e84b9cb 100644 --- a/deployments/dev_verification.json +++ b/deployments/dev_verification.json @@ -792,6 +792,42 @@ ], "8453": [], "14323": [ + [ + "0xce594728977675546d5da6152a076179982F1D39", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], + [ + "0x7eDeACd66E2F6f5E57Da0EA0D5Ab4f45c74D64af", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], + [ + "0xE62b0f1398F97653Cb1F7C4bA8F214953982c587", + "WritePrecompile", + "contracts/evmx/watcher/precompiles/WritePrecompile.sol", + [] + ], + [ + "0x4904A0f8E054f2cd6594a0e1BAB4583DF43d2e49", + "RequestHandler", + "contracts/evmx/watcher/RequestHandler.sol", + [] + ], + [ + "0x6908d3Ad5Bc4E6640BF4ed9D6D230F1aF0E3c0f9", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], + [ + "0x62FB943442E577901Ad42Da5c64aaf850B43049c", + "FeesManager", + "contracts/evmx/fees/FeesManager.sol", + [] + ], [ "0x2Bc1E6d31B1eabe4a11286c08aa67eCA29A55cc3", "WritePrecompile", diff --git a/deployments/prod_addresses.json b/deployments/prod_addresses.json index 0471cf78..8666d305 100644 --- a/deployments/prod_addresses.json +++ b/deployments/prod_addresses.json @@ -190,7 +190,7 @@ "SchedulePrecompile": "0xEE7b72D53FeC4Bed9F56CcEaD49217d152A22aC5", "startBlock": 41, "Watcher": "0x2566Bef2e914c7482d6FCB4955403fb0865951A5", - "WatcherImpl": "0x6d5B9B5aeC995F0CeE2dfbba3bdCc70698F2600d", + "WatcherImpl": "0x03029500B038980745c5a671f271340CF9AF5830", "WritePrecompile": "0xc6506b1C3f34297B4de32f08d8d50CB0E9e64842", "WritePrecompileImpl": "0xcd460687fe2a74ddEE8f2E3d791e1df306713353" }, diff --git a/deployments/prod_verification.json b/deployments/prod_verification.json index 7f88328e..c6071758 100644 --- a/deployments/prod_verification.json +++ b/deployments/prod_verification.json @@ -53,11 +53,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 1, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [1, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "10": [ @@ -114,11 +110,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 10, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [10, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "56": [ @@ -175,11 +167,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 56, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [56, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "130": [ @@ -236,11 +224,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 130, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [130, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "137": [ @@ -306,11 +290,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 137, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [137, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "146": [ @@ -367,11 +347,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 146, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [146, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "169": [ @@ -428,11 +404,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 169, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [169, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "484": [ @@ -489,11 +461,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 484, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [484, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "747": [ @@ -550,11 +518,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 747, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [747, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "999": [ @@ -611,11 +575,7 @@ "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", "Socket", "contracts/protocol/Socket.sol", - [ - 999, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [999, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "1329": [ @@ -672,11 +632,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 1329, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [1329, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "5000": [ @@ -733,11 +689,7 @@ "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", "Socket", "contracts/protocol/Socket.sol", - [ - 5000, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [5000, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ], [ "0xd90a33b0414F5C0De5F315428190598945BbEde2", @@ -792,11 +744,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 5000, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [5000, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "8453": [ @@ -853,14 +801,16 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 8453, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [8453, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "12921": [ + [ + "0x03029500B038980745c5a671f271340CF9AF5830", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], [ "0xcd460687fe2a74ddEE8f2E3d791e1df306713353", "WritePrecompile", @@ -920,9 +870,7 @@ "0xFB349dcc5A1cB87Ff3A2b91C343814647AE820FC", "PromiseResolver", "contracts/evmx/watcher/PromiseResolver.sol", - [ - "0x2566Bef2e914c7482d6FCB4955403fb0865951A5" - ] + ["0x2566Bef2e914c7482d6FCB4955403fb0865951A5"] ], [ "0x334A27A9aBe4413CD3fE7EF777196eE0568b29D4", @@ -976,9 +924,7 @@ "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", "FeesPool", "contracts/evmx/fees/FeesPool.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] + ["0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C"] ], [ "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", @@ -1041,11 +987,7 @@ "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", "Socket", "contracts/protocol/Socket.sol", - [ - 42161, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [42161, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "43114": [ @@ -1102,11 +1044,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 43114, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [43114, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "57073": [ @@ -1163,11 +1101,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 57073, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [57073, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "80094": [ @@ -1224,11 +1158,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 80094, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [80094, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], "747474": [ @@ -1285,11 +1215,7 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [ - 747474, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "EVMX" - ] + [747474, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ] } diff --git a/deployments/stage_addresses.json b/deployments/stage_addresses.json index a5d95c93..48240cc0 100644 --- a/deployments/stage_addresses.json +++ b/deployments/stage_addresses.json @@ -38,18 +38,18 @@ "DeployForwarderImpl": "0xD4DB3AB70EBA19586132686fBD4928809c3e42B4", "ERC1967Factory": "0x945300e92aA450A9aEf1d9FBA7b7Aee45622a082", "FeesManager": "0xB3a34AB69B538d48311656a4b5df56A1423C0075", - "FeesManagerImpl": "0xBe2153E78cc02F87a2652390Bd49481dBc1ccd2E", + "FeesManagerImpl": "0xF31EF92126D4f20799dEb3b2F17Cc64B3272DEc8", "FeesPool": "0xC8d803B7c1719cdF21392405879D1B56398045C4", "PromiseResolver": "0xD5225A5BC7ef3eAc6eb5255776fF5F007C95D03E", "ReadPrecompile": "0xD059D6D64B9dbAE2e56F70CBEc9Af03fd41DaE35", "RequestHandler": "0xEd8f50ddf6ba832c699b019Ed62f86e511b72d53", - "RequestHandlerImpl": "0x994DA55f4295B073f1D60B5074cc7f6cD7b11753", + "RequestHandlerImpl": "0x4f4655Bf2aDf5Ce1b58205942c77C9549bafbEd7", "SchedulePrecompile": "0x62Be6a0eabce7Efb1B9BB065e36b85C63B2101c6", "startBlock": 50623, "Watcher": "0xdd4B3431472573dB6dB988E8746a118005328589", - "WatcherImpl": "0x529d72181F1FFDA70aD62737f348d4913D5826F6", + "WatcherImpl": "0x8BB97CaF2B6C94d4f3988cdBC2db6e9eeF12D857", "WritePrecompile": "0xE786f01425718D52F7C0753FbDF743b56704D31f", - "WritePrecompileImpl": "0x01aDAb65E88b931860E63928096B16dA717b0f99" + "WritePrecompileImpl": "0xD3E77f10D63031111599CB32C957CA703ec479b8" }, "42161": { "ContractFactoryPlug": "0xae59BA0Bd0D92232B3B6304185448C9Fe5445f4d", diff --git a/deployments/stage_verification.json b/deployments/stage_verification.json index f1a89c91..757bd77d 100644 --- a/deployments/stage_verification.json +++ b/deployments/stage_verification.json @@ -53,7 +53,11 @@ "0xA944BBe5D4F67a242C9e92d539fF2d55616283a7", "Socket", "contracts/protocol/Socket.sol", - [10, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 10, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "8453": [ @@ -110,10 +114,38 @@ "0x6EF9c18c1A69417625f4Cb3c634124a71025C3A9", "Socket", "contracts/protocol/Socket.sol", - [8453, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 8453, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "14323": [ + [ + "0x8BB97CaF2B6C94d4f3988cdBC2db6e9eeF12D857", + "Watcher", + "contracts/evmx/watcher/Watcher.sol", + [] + ], + [ + "0xD3E77f10D63031111599CB32C957CA703ec479b8", + "WritePrecompile", + "contracts/evmx/watcher/precompiles/WritePrecompile.sol", + [] + ], + [ + "0x4f4655Bf2aDf5Ce1b58205942c77C9549bafbEd7", + "RequestHandler", + "contracts/evmx/watcher/RequestHandler.sol", + [] + ], + [ + "0xF31EF92126D4f20799dEb3b2F17Cc64B3272DEc8", + "FeesManager", + "contracts/evmx/fees/FeesManager.sol", + [] + ], [ "0x62Be6a0eabce7Efb1B9BB065e36b85C63B2101c6", "SchedulePrecompile", @@ -155,7 +187,9 @@ "0xD5225A5BC7ef3eAc6eb5255776fF5F007C95D03E", "PromiseResolver", "contracts/evmx/watcher/PromiseResolver.sol", - ["0xdd4B3431472573dB6dB988E8746a118005328589"] + [ + "0xdd4B3431472573dB6dB988E8746a118005328589" + ] ], [ "0x994DA55f4295B073f1D60B5074cc7f6cD7b11753", @@ -266,7 +300,11 @@ "0x693bcDb114a57302Cd687b8Af1bD7583ee56748C", "Socket", "contracts/protocol/Socket.sol", - [42161, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 42161, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "84532": [ @@ -323,7 +361,11 @@ "0x4861c9EB83d8ba745a184E5a11a50B6be25e4dDb", "Socket", "contracts/protocol/Socket.sol", - [84532, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 84532, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "421614": [ @@ -380,7 +422,11 @@ "0x7aA47Ed012c185127edA67f533D91f44391bfC7C", "Socket", "contracts/protocol/Socket.sol", - [421614, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 421614, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ], "11155420": [ @@ -437,7 +483,11 @@ "0x26292db660fbeB0271E11aa4f1d2a2d0c57dc378", "Socket", "contracts/protocol/Socket.sol", - [11155420, "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", "EVMX"] + [ + 11155420, + "0x3339Cf48f1F9cf31b6F8c2664d144c7444eBBB18", + "EVMX" + ] ] ] } From df2db6e11539d7cab90c3319e94fae87a16ee680 Mon Sep 17 00:00:00 2001 From: Akash Date: Tue, 23 Sep 2025 00:25:23 +0530 Subject: [PATCH 136/139] fix: verify --- deployments/prod_addresses.json | 26 + deployments/prod_verification.json | 1131 +-------------------- hardhat-scripts/config/config.ts | 3 + hardhat-scripts/constants/feeConstants.ts | 8 + hardhat-scripts/utils/deployUtils.ts | 30 +- hardhat-scripts/verify/verify.ts | 36 +- hardhat.config.ts | 183 ++-- package.json | 2 +- src/chain-enums/chainSlugToId.ts | 16 + src/chain-enums/chainSlugToKey.ts | 10 +- yarn.lock | 8 +- 11 files changed, 267 insertions(+), 1186 deletions(-) diff --git a/deployments/prod_addresses.json b/deployments/prod_addresses.json index 8666d305..468e3a76 100644 --- a/deployments/prod_addresses.json +++ b/deployments/prod_addresses.json @@ -38,6 +38,19 @@ "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" } }, + "100": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 42253473, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, "130": { "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", @@ -233,6 +246,19 @@ "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" } }, + "59144": { + "ContractFactoryPlug": "0xd90a33b0414F5C0De5F315428190598945BbEde2", + "FastSwitchboard": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", + "FastSwitchboardId": "1", + "FeesPlug": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", + "Socket": "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "SocketBatcher": "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", + "startBlock": 23661748, + "SUSDC": "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", + "SwitchboardIdToAddressMap": { + "1": "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA" + } + }, "80094": { "ContractFactoryPlug": "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", "FastSwitchboard": "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", diff --git a/deployments/prod_verification.json b/deployments/prod_verification.json index c6071758..f95b60e8 100644 --- a/deployments/prod_verification.json +++ b/deployments/prod_verification.json @@ -1,753 +1,12 @@ { - "1": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 1, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [1, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "10": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 10, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [10, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "56": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 56, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [56, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "130": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 130, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [130, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "137": [ - [ - "0x9e95545a13351aA79096839738d0B09434804D03", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 137, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [137, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "146": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 146, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [146, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "169": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 169, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [169, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "484": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 484, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [484, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "747": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 747, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [747, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "999": [ - [ - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SUSDC", - "SUSDC" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 999, - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "Socket", - "contracts/protocol/Socket.sol", - [999, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "1329": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 1329, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [1329, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "5000": [ - [ - "0xaeCC411d7230e4dAFa6dB9931a3bEf37764476a1", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe03f198c6Abee720b1a344d6624f7014c0F663E1", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", - "SUSDC", - "SUSDC" - ] - ], - [ - "0xFB349dcc5A1cB87Ff3A2b91C343814647AE820FC", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x2277CF90Ce1cfE33b9576Ec06D9C4d053ee5f882", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 5000, - "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x334A27A9aBe4413CD3fE7EF777196eE0568b29D4", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2" - ] - ], - [ - "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", - "Socket", - "contracts/protocol/Socket.sol", - [5000, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ], - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 5000, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [5000, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "8453": [ + "1": [], + "10": [], + "56": [], + "100": [], + "130": [], + "137": [], + "146": [], + "169": [ [ "0xd90a33b0414F5C0De5F315428190598945BbEde2", "ContractFactoryPlug", @@ -783,7 +42,7 @@ "FastSwitchboard", "contracts/protocol/switchboard/FastSwitchboard.sol", [ - 8453, + 169, "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" ] @@ -801,196 +60,11 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [8453, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "12921": [ - [ - "0x03029500B038980745c5a671f271340CF9AF5830", - "Watcher", - "contracts/evmx/watcher/Watcher.sol", - [] - ], - [ - "0xcd460687fe2a74ddEE8f2E3d791e1df306713353", - "WritePrecompile", - "contracts/evmx/watcher/precompiles/WritePrecompile.sol", - [] - ], - [ - "0x0303B6f54afA36B0808FDE6aaE9c3eD271b01119", - "RequestHandler", - "contracts/evmx/watcher/RequestHandler.sol", - [] - ], - [ - "0x9f3CDba2262DF94e415E092A4228ee7E6846ea1b", - "FeesManager", - "contracts/evmx/fees/FeesManager.sol", - [] - ], - [ - "0xEE7b72D53FeC4Bed9F56CcEaD49217d152A22aC5", - "SchedulePrecompile", - "contracts/evmx/watcher/precompiles/SchedulePrecompile.sol", - [ - "0x2566Bef2e914c7482d6FCB4955403fb0865951A5", - 86400, - { - "type": "BigNumber", - "hex": "0x02540be400" - }, - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - 3600 - ] - ], - [ - "0x74D52027137a450b68315478AAE4528Ba839ea13", - "ReadPrecompile", - "contracts/evmx/watcher/precompiles/ReadPrecompile.sol", - [ - "0x2566Bef2e914c7482d6FCB4955403fb0865951A5", - { - "type": "BigNumber", - "hex": "0xe8d4a51000" - }, - 3600 - ] - ], - [ - "0xe03f198c6Abee720b1a344d6624f7014c0F663E1", - "WritePrecompile", - "contracts/evmx/watcher/precompiles/WritePrecompile.sol", - [] - ], - [ - "0xFB349dcc5A1cB87Ff3A2b91C343814647AE820FC", - "PromiseResolver", - "contracts/evmx/watcher/PromiseResolver.sol", - ["0x2566Bef2e914c7482d6FCB4955403fb0865951A5"] - ], - [ - "0x334A27A9aBe4413CD3fE7EF777196eE0568b29D4", - "RequestHandler", - "contracts/evmx/watcher/RequestHandler.sol", - [] - ], - [ - "0x117c63A8c9a980ddC60B2bF2b4701C9267f66394", - "Configurations", - "contracts/evmx/watcher/Configurations.sol", - [] - ], - [ - "0xf05f680E0611b81eD0255A1Cd829540504765711", - "DeployForwarder", - "contracts/evmx/helpers/DeployForwarder.sol", - [] - ], - [ - "0xB604FBcA01897315D2d62A346DBf29796A4825D9", - "AuctionManager", - "contracts/evmx/AuctionManager.sol", - [] - ], - [ - "0x6d5B9B5aeC995F0CeE2dfbba3bdCc70698F2600d", - "Watcher", - "contracts/evmx/watcher/Watcher.sol", - [] - ], - [ - "0xb3A5132Df72F1597ab474d73d387ecF8647af669", - "AsyncDeployer", - "contracts/evmx/helpers/AsyncDeployer.sol", - [] - ], - [ - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", - "FeesManager", - "contracts/evmx/fees/FeesManager.sol", - [] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "AddressResolver", - "contracts/evmx/helpers/AddressResolver.sol", - [] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPool", - "contracts/evmx/fees/FeesPool.sol", - ["0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C"] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "ERC1967Factory", - "lib/solady/src/utils/ERC1967Factory.sol", - [] - ] - ], - "42161": [ - [ - "0x176C18F871b9b0F363cBDF3b5a1872F6069CF538", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x6d5B9B5aeC995F0CeE2dfbba3bdCc70698F2600d", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x168d7bAb883a6430F0200bcaaFAf080371477B3D", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xb3A5132Df72F1597ab474d73d387ecF8647af669", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 42161, - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x9e95545a13351aA79096839738d0B09434804D03", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b" - ] - ], - [ - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", - "Socket", - "contracts/protocol/Socket.sol", - [42161, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] + [169, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], - "43114": [ + "484": [], + "747": [ [ "0xd90a33b0414F5C0De5F315428190598945BbEde2", "ContractFactoryPlug", @@ -1026,7 +100,7 @@ "FastSwitchboard", "contracts/protocol/switchboard/FastSwitchboard.sol", [ - 43114, + 747, "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" ] @@ -1044,178 +118,29 @@ "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", "Socket", "contracts/protocol/Socket.sol", - [43114, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] + [747, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], - "57073": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 57073, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], + "999": [], + "1329": [], + "5000": [ [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", + "0xb8Bd628646BFfE5632B462F213F97DE038dBD8b2", "Socket", "contracts/protocol/Socket.sol", - [57073, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ], - "80094": [ - [ - "0xdb6d9dB6e4190a63FD3c50Af51785a9c3BB4080b", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 80094, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", [ + 5000, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" + "EVMX" ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [80094, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] ] ], - "747474": [ - [ - "0xd90a33b0414F5C0De5F315428190598945BbEde2", - "ContractFactoryPlug", - "contracts/evmx/plugs/ContractFactoryPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0xe37aFa3Aa95E153B8dD0FE8456CBF345cB4C51F7", - "SUSDC", - "contracts/evmx/plugs/SUSDC.sol", - [ - 18, - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "SUSDC", - "SUSDC" - ] - ], - [ - "0x3B1f4ABA1667EeB992B623E7c6d119728cEd3b15", - "FeesPlug", - "contracts/evmx/plugs/FeesPlug.sol", - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x4023941D9AB563b1c4d447B3f2A9dd2F1eF19fCA", - "FastSwitchboard", - "contracts/protocol/switchboard/FastSwitchboard.sol", - [ - 747474, - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C" - ] - ], - [ - "0x20BB708875C3E99cbBD7239CeeB2670b795F4829", - "SocketBatcher", - "contracts/protocol/SocketBatcher.sol", - [ - "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb" - ] - ], - [ - "0xB94742B094f89A8D53e15A45CdBf9810a5B090Eb", - "Socket", - "contracts/protocol/Socket.sol", - [747474, "0x7BD61c667f869FB21b77626f0Ac0ACEE51e4BE7C", "EVMX"] - ] - ] + "8453": [], + "12921": [], + "42161": [], + "43114": [], + "57073": [], + "59144": [], + "80094": [], + "747474": [] } diff --git a/hardhat-scripts/config/config.ts b/hardhat-scripts/config/config.ts index 8b177c43..f6eb1e45 100644 --- a/hardhat-scripts/config/config.ts +++ b/hardhat-scripts/config/config.ts @@ -117,9 +117,11 @@ const MODE_CONFIGS: Record = { ChainSlug.CAMP, ChainSlug.MAINNET, ChainSlug.FLOW, + ChainSlug.GNOSIS, ChainSlug.HYPEREVM, ChainSlug.INK, ChainSlug.KATANA, + ChainSlug.LINEA, ChainSlug.MANTA_PACIFIC, ChainSlug.MANTLE, ChainSlug.OPTIMISM, @@ -134,6 +136,7 @@ const MODE_CONFIGS: Record = { ChainSlug.BASE, ChainSlug.MAINNET, ChainSlug.HYPEREVM, + ChainSlug.LINEA, ChainSlug.OPTIMISM, ChainSlug.POLYGON_MAINNET, ChainSlug.SEI, diff --git a/hardhat-scripts/constants/feeConstants.ts b/hardhat-scripts/constants/feeConstants.ts index abec5b0f..b570ddc5 100644 --- a/hardhat-scripts/constants/feeConstants.ts +++ b/hardhat-scripts/constants/feeConstants.ts @@ -290,6 +290,14 @@ export const tokens: TokenMap = { decimals: 6, }, ], + [ChainSlug.LINEA]: [ + { + name: "USDC", + symbol: "USDC", + address: "0x176211869cA2b568f2A7D4EE941E073a821EE1ff", + decimals: 6, + }, + ], [ChainSlug.OPTIMISM]: [ { name: "USDC", diff --git a/hardhat-scripts/utils/deployUtils.ts b/hardhat-scripts/utils/deployUtils.ts index fc1eaccd..f96cc872 100644 --- a/hardhat-scripts/utils/deployUtils.ts +++ b/hardhat-scripts/utils/deployUtils.ts @@ -113,12 +113,12 @@ export const verify = async ( await run("verify:verify", { address, contract: `${path}:${contractName}`, - constructorArguments: args, + constructorArguments: args }); return true; } catch (error) { - console.log("Error during verification", error); - if (error.toString().includes("Contract source code already verified")) + console.log("Error during verification", error.toString()); + if (error.toString().includes("Contract source code already verified") || error.toString().includes("already verified")) return true; } @@ -132,9 +132,27 @@ export const getInstance = async ( (await ethers.getContractFactory(contractName)).attach(address); export const getChainSlug = async (): Promise => { - if (network.config.chainId === undefined) - throw new Error("chain id not found"); - return Number(network.config.chainId); + // Try to get chain ID from network config first + if (network.config.chainId !== undefined) { + return Number(network.config.chainId); + } + + // If network config doesn't have chainId, try to get it from the provider + try { + const provider = network.provider; + if (provider && 'url' in network.config && network.config.url) { + // Try to get chain ID using ethers provider + const ethersProvider = new ethers.providers.JsonRpcProvider(network.config.url); + const networkDetails = await ethersProvider.getNetwork(); + if (networkDetails && networkDetails.chainId) { + return Number(networkDetails.chainId); + } + } + } catch (error) { + console.warn("Could not get chain ID from provider:", error); + } + + throw new Error("chain id not found in network config or provider"); }; export const integrationType = (integrationName: string) => diff --git a/hardhat-scripts/verify/verify.ts b/hardhat-scripts/verify/verify.ts index 9348ed87..211a69d8 100644 --- a/hardhat-scripts/verify/verify.ts +++ b/hardhat-scripts/verify/verify.ts @@ -5,6 +5,7 @@ import { ChainSlugToKey, } from "../../src"; import hre from "hardhat"; +import { ethers } from "ethers"; import { CONCURRENCY_LIMIT, EVMX_CHAIN_ID, mode } from "../config/config"; import { storeUnVerifiedParams, verify } from "../utils"; import pLimit from "p-limit"; @@ -66,10 +67,11 @@ export const verifyChain = async ( ) => { try { let chainName: string; - if ([56, 100, 137].includes(chain)) { - console.log(`Skipping chain: ${chain}`); - return; - } + // if (chain!=999) return; + // if ([130, 5000, 1329, 57073, 747, 169].includes(chain)) { + // console.log(`Skipping chain: ${chain}`); + // return; + // } if (chain == (EVMX_CHAIN_ID as ChainSlug)) { chainName = "EVMX"; @@ -81,12 +83,34 @@ export const verifyChain = async ( console.log(`Invalid chain: ${chain}`); return; } - hre.changeNetwork(chainName); + console.log("Changing network to", chainName); + + try { + hre.changeNetwork(chainName); + // Wait a bit for network change to complete + await new Promise(resolve => setTimeout(resolve, 1000)); + + // Verify the network change was successful + try { + if ('url' in hre.network.config && hre.network.config.url) { + const ethersProvider = new ethers.providers.JsonRpcProvider(hre.network.config.url); + const currentChainId = await ethersProvider.getNetwork().then(n => n.chainId); + console.log(`Successfully changed to network ${chainName} with chain ID ${currentChainId}`); + } else { + console.log(`Successfully changed to network ${chainName}`); + } + } catch (error) { + console.log(`Successfully changed to network ${chainName}`); + } + } catch (networkError) { + console.error(`Failed to change network to ${chainName}:`, networkError); + return; + } const chainParams: VerifyArgs[] = verificationParams as VerifyArgs[]; let retryCount = 0; - while (retryCount < 5) { + while (retryCount < 1) { const unverifiedChainParams: VerifyArgs[] = []; if (chainParams.length) { const len = chainParams.length; diff --git a/hardhat.config.ts b/hardhat.config.ts index 3e409160..b005a364 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -61,6 +61,7 @@ let liveNetworks = { [HardhatChainName.SEPOLIA]: getChainConfig(ChainSlug.SEPOLIA), [HardhatChainName.BASE_SEPOLIA]: getChainConfig(ChainSlug.BASE_SEPOLIA), [HardhatChainName.BASE]: getChainConfig(ChainSlug.BASE), + [HardhatChainName.BSC]: getChainConfig(ChainSlug.BSC), [HardhatChainName.ARBITRUM]: getChainConfig(ChainSlug.ARBITRUM), [HardhatChainName.OPTIMISM]: getChainConfig(ChainSlug.OPTIMISM), [HardhatChainName.KATANA]: getChainConfig(ChainSlug.KATANA), @@ -69,6 +70,17 @@ let liveNetworks = { [HardhatChainName.AVALANCHE]: getChainConfig(ChainSlug.AVALANCHE), [HardhatChainName.GNOSIS]: getChainConfig(ChainSlug.GNOSIS), [HardhatChainName.POLYGON_MAINNET]: getChainConfig(ChainSlug.POLYGON_MAINNET), + [HardhatChainName.MAINNET]: getChainConfig(ChainSlug.MAINNET), + [HardhatChainName.HYPEREVM]: getChainConfig(ChainSlug.HYPEREVM), + [HardhatChainName.FLOW]: getChainConfig(ChainSlug.FLOW), + [HardhatChainName.MANTA_PACIFIC]: getChainConfig(ChainSlug.MANTA_PACIFIC), + [HardhatChainName.MANTLE]: getChainConfig(ChainSlug.MANTLE), + [HardhatChainName.CAMP]: getChainConfig(ChainSlug.CAMP), + [HardhatChainName.INK]: getChainConfig(ChainSlug.INK), + [HardhatChainName.SEI]: getChainConfig(ChainSlug.SEI), + [HardhatChainName.UNICHAIN]: getChainConfig(ChainSlug.UNICHAIN), + [HardhatChainName.BERA]: getChainConfig(ChainSlug.BERA), + EVMX: { accounts: [`0x${privateKey}`], chainId: EVMX_CHAIN_ID, @@ -95,108 +107,157 @@ const config: HardhatUserConfig = { }, etherscan: { apiKey: { - arbitrumOne: process.env.ARBISCAN_API_KEY || "", - arbitrumTestnet: process.env.ARBISCAN_API_KEY || "", - baseTestnet: process.env.BASESCAN_API_KEY || "", - base: process.env.BASESCAN_API_KEY || "", - bsc: process.env.BSCSCAN_API_KEY || "", - bscTestnet: process.env.BSCSCAN_API_KEY || "", - goerli: process.env.ETHERSCAN_API_KEY || "", + // Etherscan API v2 - single key for all Etherscan-based explorers mainnet: process.env.ETHERSCAN_API_KEY || "", sepolia: process.env.ETHERSCAN_API_KEY || "", - optimisticEthereum: process.env.OPTIMISM_API_KEY || "", - optimisticTestnet: process.env.OPTIMISM_API_KEY || "", - EVMX: "none", + goerli: process.env.ETHERSCAN_API_KEY || "", + arbitrum: process.env.ETHERSCAN_API_KEY || "", + arbitrumSepolia: process.env.ETHERSCAN_API_KEY || "", + optimism: process.env.ETHERSCAN_API_KEY || "", + optimismSepolia: process.env.ETHERSCAN_API_KEY || "", + polygon: process.env.ETHERSCAN_API_KEY || "", + polygonAmoy: process.env.ETHERSCAN_API_KEY || "", + base: process.env.ETHERSCAN_API_KEY || "", + baseSepolia: process.env.ETHERSCAN_API_KEY || "", + bsc: process.env.ETHERSCAN_API_KEY || "", + bscTestnet: process.env.ETHERSCAN_API_KEY || "", + avalanche: process.env.ETHERSCAN_API_KEY || "", + gnosis: process.env.ETHERSCAN_API_KEY || "", + linea: process.env.ETHERSCAN_API_KEY || "", + zkSync: process.env.ETHERSCAN_API_KEY || "", + scroll: process.env.ETHERSCAN_API_KEY || "", + // Blockscout-based explorers + mantle: process.env.BLOCKSCOUT_API_KEY || process.env.ETHERSCAN_API_KEY || "", + camp: process.env.BLOCKSCOUT_API_KEY || process.env.ETHERSCAN_API_KEY || "", + flow: process.env.BLOCKSCOUT_API_KEY || process.env.ETHERSCAN_API_KEY || "", + manta_pacific: process.env.BLOCKSCOUT_API_KEY || process.env.ETHERSCAN_API_KEY || "", + + // Other custom explorers + sonic: process.env.ETHERSCAN_API_KEY || "", + katana: process.env.ETHERSCAN_API_KEY || "", + hyperevm: process.env.ETHERSCAN_API_KEY || "", + ink: process.env.ETHERSCAN_API_KEY || "", + bera: process.env.ETHERSCAN_API_KEY || "", + unichain: process.env.ETHERSCAN_API_KEY || "", + sei: process.env.ETHERSCAN_API_KEY || "", + zero: process.env.ETHERSCAN_API_KEY || "", + arenaZ: process.env.ETHERSCAN_API_KEY || "", + b3: process.env.ETHERSCAN_API_KEY || "", + monadTestnet: process.env.ETHERSCAN_API_KEY || "", + soneium: process.env.ETHERSCAN_API_KEY || "", + swellchain: process.env.ETHERSCAN_API_KEY || "", + worldChain: process.env.ETHERSCAN_API_KEY || "", + plume: process.env.ETHERSCAN_API_KEY || "", + riseTestnet: process.env.ETHERSCAN_API_KEY || "", }, customChains: [ { - network: "katana", - chainId: ChainId.KATANA, + network:HardhatChainName.BSC, + chainId: ChainSlugToId[ChainSlug.BSC], urls: { - apiURL: "https://api-katana.etherscan.io/api", - browserURL: "https://katana.etherscan.io/", + apiURL: "https://api.etherscan.io/v2/api?chainid=56", + browserURL: "https://bscscan.com/", }, }, { - network: "sonic", - chainId: ChainId.SONIC, + network:HardhatChainName.MANTLE, + chainId: ChainSlugToId[ChainSlug.MANTLE], urls: { - apiURL: "https://api-sonic.etherscan.io/api", - browserURL: "https://sonic.etherscan.io/", + apiURL: "https://api.etherscan.io/v2/api?chainid=5000", + browserURL: "https://explorer.mantle.xyz/", }, }, { - network: "linea", - chainId: ChainId.LINEA, + network:HardhatChainName.UNICHAIN, + chainId: ChainSlugToId[ChainSlug.UNICHAIN], urls: { - apiURL: "https://api-linea.etherscan.io/api", - browserURL: "https://linea.etherscan.io/", + apiURL: "https://api.etherscan.io/v2/api?chainid=130", + browserURL: "https://uniscan.xyz/", }, }, { - network: "avalanche", - chainId: ChainId.AVALANCHE, + network:HardhatChainName.SONIC, + chainId: ChainId.SONIC, urls: { - apiURL: "https://api-avalanche.etherscan.io/api", - browserURL: "https://avalanche.etherscan.io/", - }, + apiURL: "https://api.etherscan.io/v2/api?chainid=146", + browserURL: "https://sonicscan.org" + } }, { - network: "gnosis", - chainId: ChainId.GNOSIS, + network:HardhatChainName.BERA, + chainId: ChainId.BERA, urls: { - apiURL: "https://api-gnosis.etherscan.io/api", - browserURL: "https://gnosis.etherscan.io/", - }, + apiURL: "https://api.etherscan.io/v2/api?chainid=80094", + browserURL: "https://berascan.com/" + } }, { - network: "polygonMainnet", - chainId: ChainId.POLYGON_MAINNET, + network:HardhatChainName.KATANA, + chainId: ChainId.KATANA, urls: { - apiURL: "https://api-polygon.etherscan.io/api", - browserURL: "https://polygon.etherscan.io/", - }, + apiURL: "https://api.etherscan.io/v2/api?chainid=747474", + browserURL: "https://katanascan.com/" + } }, { - network: "optimisticTestnet", - chainId: ChainId.OPTIMISM_SEPOLIA, + network:HardhatChainName.INK, + chainId: ChainId.INK, urls: { - apiURL: "https://api-sepolia-optimistic.etherscan.io/api", - browserURL: "https://sepolia-optimism.etherscan.io/", - }, + apiURL: "https://explorer.inkonchain.com/api", + browserURL: "https://explorer.inkonchain.com/" + } }, { - network: "arbitrumTestnet", - chainId: ChainId.ARBITRUM_SEPOLIA, + network: "hyperevm", + chainId: ChainId.HYPEREVM, urls: { - apiURL: "https://api-sepolia.arbiscan.io/api", - browserURL: "https://sepolia.arbiscan.io/", - }, + apiURL: "https://api.etherscan.io/v2/api?chainid=999", + browserURL: "https://hyperevmscan.io/" + } }, { - network: "baseTestnet", - chainId: ChainId.BASE_SEPOLIA, + network:HardhatChainName.SEI, + chainId: ChainId.SEI, urls: { - apiURL: "https://api-sepolia.basescan.org/api", - browserURL: "https://sepolia.basescan.org/", - }, + apiURL: "https://api.etherscan.io/v2/api?chainid=1329", + browserURL: "https://seiscan.io/" + } }, { - network: "base", - chainId: ChainId.BASE, + network: "EVMX", + chainId: EVMX_CHAIN_ID, urls: { - apiURL: "https://api.basescan.org/api", - browserURL: "https://basescan.org/", + apiURL: "https://explorer-evmx-testnet.socket.tech/api", + browserURL: "https://explorer-evmx-testnet.socket.tech/", }, }, { - network: "EVMX", - chainId: EVMX_CHAIN_ID, + network: HardhatChainName.CAMP, + chainId: ChainId.CAMP, urls: { - apiURL: "https://explorer-evmx-1dpy1f56o4.t.conduit.xyz/api", - browserURL: "https://explorer-evmx-1dpy1f56o4.t.conduit.xyz/", - }, + apiURL: "https://camp.cloud.blockscout.com/api", + browserURL: "https://camp.cloud.blockscout.com/" + } + }, + { + network: HardhatChainName.MANTA_PACIFIC, + chainId: ChainId.MANTA_PACIFIC, + urls: { + apiURL: "https://pacific-explorer.manta.network/api", + browserURL: "https://pacific-explorer.manta.network/", + } }, + { + network: HardhatChainName.FLOW, + chainId: ChainId.FLOW, + urls: { + apiURL: "https://evm.flowscan.io/api", + browserURL: "https://evm.flowscan.io/" + } + }, + + + ], }, // This fully resolves paths for imports in the ./lib directory for Hardhat diff --git a/package.json b/package.json index c8fc7752..6732c0a5 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "license": "ISC", "devDependencies": { "@aws-sdk/client-s3": "^3.670.0", - "@nomicfoundation/hardhat-verify": "^2.0.12", + "@nomicfoundation/hardhat-verify": "^2.0.14", "@nomiclabs/hardhat-ethers": "2.2.3", "@socket.tech/socket-protocol-common": "1.1.44", "@typechain/ethers-v5": "^10.0.0", diff --git a/src/chain-enums/chainSlugToId.ts b/src/chain-enums/chainSlugToId.ts index 2b16dd4a..a8e1fe2d 100644 --- a/src/chain-enums/chainSlugToId.ts +++ b/src/chain-enums/chainSlugToId.ts @@ -64,4 +64,20 @@ export const ChainSlugToId = { [ChainSlug.CAMP]: ChainId.CAMP, [ChainSlug.PLUME]: ChainId.PLUME, [ChainSlug.RISE_TESTNET]: ChainId.RISE_TESTNET, + [ChainSlug.KATANA]: ChainId.KATANA, + [ChainSlug.SONIC]: ChainId.SONIC, + [ChainSlug.ZERO]: ChainId.ZERO, + [ChainSlug.ZKSYNC]: ChainId.ZKSYNC, + [ChainSlug.ARENA_Z]: ChainId.ARENA_Z, + [ChainSlug.B3]: ChainId.B3, + [ChainSlug.MONAD_TESTNET]: ChainId.MONAD_TESTNET, + [ChainSlug.SCROLL]: ChainId.SCROLL, + [ChainSlug.SONEIUM]: ChainId.SONEIUM, + [ChainSlug.SWELLCHAIN]: ChainId.SWELLCHAIN, + [ChainSlug.WORLD_CHAIN]: ChainId.WORLD_CHAIN, + [ChainSlug.HYPEREVM]: ChainId.HYPEREVM, + [ChainSlug.SEI]: ChainId.SEI, + [ChainSlug.BERA]: ChainId.BERA, + [ChainSlug.INK]: ChainId.INK, + [ChainSlug.UNICHAIN]: ChainId.UNICHAIN, }; diff --git a/src/chain-enums/chainSlugToKey.ts b/src/chain-enums/chainSlugToKey.ts index 4f5918e1..7ffbbda2 100644 --- a/src/chain-enums/chainSlugToKey.ts +++ b/src/chain-enums/chainSlugToKey.ts @@ -68,11 +68,6 @@ export const ChainSlugToKey = { [ChainSlug.BERA]: HardhatChainName.BERA, [ChainSlug.B3]: HardhatChainName.B3, [ChainSlug.UNICHAIN]: HardhatChainName.UNICHAIN, - [ChainSlug.MONAD_TESTNET]: HardhatChainName.MONAD_TESTNET, - [ChainSlug.SCROLL]: HardhatChainName.SCROLL, - [ChainSlug.SONEIUM]: HardhatChainName.SONEIUM, - [ChainSlug.SWELLCHAIN]: HardhatChainName.SWELLCHAIN, - [ChainSlug.WORLD_CHAIN]: HardhatChainName.WORLD_CHAIN, [ChainSlug.KATANA]: HardhatChainName.KATANA, [ChainSlug.HYPEREVM]: HardhatChainName.HYPEREVM, [ChainSlug.SEI]: HardhatChainName.SEI, @@ -80,4 +75,9 @@ export const ChainSlugToKey = { [ChainSlug.CAMP]: HardhatChainName.CAMP, [ChainSlug.PLUME]: HardhatChainName.PLUME, [ChainSlug.RISE_TESTNET]: HardhatChainName.RISE_TESTNET, + [ChainSlug.MONAD_TESTNET]: HardhatChainName.MONAD_TESTNET, + [ChainSlug.SCROLL]: HardhatChainName.SCROLL, + [ChainSlug.SONEIUM]: HardhatChainName.SONEIUM, + [ChainSlug.SWELLCHAIN]: HardhatChainName.SWELLCHAIN, + [ChainSlug.WORLD_CHAIN]: HardhatChainName.WORLD_CHAIN, }; diff --git a/yarn.lock b/yarn.lock index 3e8a4232..3f01d8df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1428,10 +1428,10 @@ mcl-wasm "^0.7.1" rustbn.js "~0.2.0" -"@nomicfoundation/hardhat-verify@^2.0.12": - version "2.0.13" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.13.tgz#41691adc32e01dc5cf6b725615f64958fba2100b" - integrity sha512-i57GX1sC0kYGyRVnbQrjjyBTpWTKgrvKC+jH8CMKV6gHp959Upb8lKaZ58WRHIU0espkulTxLnacYeUDirwJ2g== +"@nomicfoundation/hardhat-verify@^2.0.14": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.1.1.tgz#0af5fc4228df860062865fcafb4a01bc0b89f8a3" + integrity sha512-K1plXIS42xSHDJZRkrE2TZikqxp9T4y6jUMUNI/imLgN5uCcEQokmfU0DlyP9zzHncYK92HlT5IWP35UVCLrPw== dependencies: "@ethersproject/abi" "^5.1.2" "@ethersproject/address" "^5.0.2" From 493b4724771d78471093c807cca41b4c8a809045 Mon Sep 17 00:00:00 2001 From: Ameesha Agrawal Date: Fri, 26 Sep 2025 17:53:17 +0530 Subject: [PATCH 137/139] fix: surge protocol fees --- hardhat-scripts/constants/fee.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hardhat-scripts/constants/fee.ts b/hardhat-scripts/constants/fee.ts index 52fe2d39..25a1855e 100644 --- a/hardhat-scripts/constants/fee.ts +++ b/hardhat-scripts/constants/fee.ts @@ -4,12 +4,12 @@ import { EVMX_CHAIN_ID, mainnetChains } from "../config"; import { FEE_MANAGER_WRITE_MAX_FEES } from "./constants"; const CHAIN_MAX_FEES: { [key: number]: string } = { - [ChainSlug.MAINNET]: parseEther("5").toHexString(), + [ChainSlug.MAINNET]: parseEther("1").toHexString(), [EVMX_CHAIN_ID]: FEE_MANAGER_WRITE_MAX_FEES.toHexString(), }; export const getMaxFees = (chainSlug: ChainSlug) => { if (CHAIN_MAX_FEES[chainSlug]) return CHAIN_MAX_FEES[chainSlug]; - if (mainnetChains.includes(chainSlug)) return parseEther("1").toHexString(); + if (mainnetChains.includes(chainSlug)) return parseEther("0.1").toHexString(); return parseEther("0.1").toHexString(); }; From 613467d1dae0ba004f1f2f405a03745feb676093 Mon Sep 17 00:00:00 2001 From: Gregory The Dev Date: Sat, 27 Sep 2025 10:26:18 +0200 Subject: [PATCH 138/139] Add comments and small rename in FeesPlug --- contracts/evmx/fees/Credit.sol | 12 ++++++++-- contracts/evmx/interfaces/IConfigurations.sol | 5 ++-- contracts/evmx/plugs/FeesPlug.sol | 24 ++++++++++--------- .../watcher/precompiles/WritePrecompile.sol | 4 ++-- contracts/protocol/base/PlugBase.sol | 3 +++ .../protocol/switchboard/SwitchboardBase.sol | 1 + 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/contracts/evmx/fees/Credit.sol b/contracts/evmx/fees/Credit.sol index dc4af589..93a0c55e 100644 --- a/contracts/evmx/fees/Credit.sol +++ b/contracts/evmx/fees/Credit.sol @@ -40,6 +40,7 @@ abstract contract FeesManagerStorage is IFeesManager { // slot 52 /// @notice Mapping to track blocked credits for each user /// @dev address => userBlockedCredits + // TODO: this will have to be bytes32 (for solana addresses) mapping(address => uint256) public userBlockedCredits; // slot 53 @@ -53,12 +54,14 @@ abstract contract FeesManagerStorage is IFeesManager { // slot 55 // token pool balances // chainSlug => token address => amount + // TODO: this will have to be bytes32 (for solana tokens) mapping(uint32 => mapping(address => uint256)) public tokenOnChainBalances; // slot 56 /// @notice Mapping to track nonce to whether it has been used /// @dev address => signatureNonce => isNonceUsed /// @dev used by watchers or other users in signatures + // TODO: how about this, do we need to change it to bytes32 ? - how nonces are used here ? mapping(address => mapping(uint256 => bool)) public isNonceUsed; // slot 57 @@ -140,13 +143,17 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew } /// @notice Deposits credits and native tokens to a user - /// @param depositTo_ The address to deposit the credits to + /// @param depositTo_ The EVMx address to deposit the credits to (it serves as accounting contract that mirrors real on-chain balances) /// @param chainSlug_ The chain slug /// @param token_ The token address /// @param nativeAmount_ The native amount /// @param creditAmount_ The credit amount + // TODO:4: for Solana handling we will need to have separate function deposit_solana() so that we do not have to change - (?) + // existing function on EVM UserVault which will refer to this one + // - also different handling on transmitter and indexer function deposit( uint32 chainSlug_, + // TODO: token will have to be bytes32 (for solana tokens) - this is the address of token on native chain (could be Solana) address token_, address depositTo_, uint256 nativeAmount_, @@ -155,10 +162,11 @@ abstract contract Credit is FeesManagerStorage, Initializable, Ownable, AppGatew ) external override onlyWatcher { tokenOnChainBalances[chainSlug_][token_] += creditAmount_ + nativeAmount_; - // Mint tokens to the user + // Mint tokens to the some evmx accounting contract _mint(depositTo_, creditAmount_); if (nativeAmount_ > 0) { + // TODO: ask: what are native tokens in this context ? - native to real blockchains or to EVMx itself ? // if native transfer fails, add to credit bool success = feesPool.withdraw(depositTo_, nativeAmount_); diff --git a/contracts/evmx/interfaces/IConfigurations.sol b/contracts/evmx/interfaces/IConfigurations.sol index 227a18f3..49cc0bbf 100644 --- a/contracts/evmx/interfaces/IConfigurations.sol +++ b/contracts/evmx/interfaces/IConfigurations.sol @@ -33,9 +33,10 @@ interface IConfigurations { /// @return The socket function sockets(uint32 chainSlug_) external view returns (bytes32); - /// @notice Returns the socket for a given chain slug + /// @notice Returns the switchboardId for a given chain slug and switchboard type (1:1 mapping) /// @param chainSlug_ The chain slug - /// @return The socket + /// @param sbType_ The type of switchboard + /// @return switchboardId function switchboards(uint32 chainSlug_, bytes32 sbType_) external view returns (uint64); /// @notice Sets the switchboard for a network diff --git a/contracts/evmx/plugs/FeesPlug.sol b/contracts/evmx/plugs/FeesPlug.sol index b46baab1..e0b2d654 100644 --- a/contracts/evmx/plugs/FeesPlug.sol +++ b/contracts/evmx/plugs/FeesPlug.sol @@ -40,52 +40,54 @@ contract FeesPlug is IFeesPlug, PlugBase, AccessControl { /////////////////////// DEPOSIT AND WITHDRAWAL /////////////////////// function depositCredit( address token_, - address receiver_, + address evmx_receiver_, uint256 amount_, bytes memory data_ ) external override { - _deposit(token_, receiver_, amount_, 0, data_); + _deposit(token_, evmx_receiver_, amount_, 0, data_); } function depositCreditAndNative( address token_, - address receiver_, + address evmx_receiver_, uint256 amount_, bytes memory data_ ) external override { uint256 nativeAmount_ = amount_ / 10; - _deposit(token_, receiver_, amount_ - nativeAmount_, nativeAmount_, data_); + _deposit(token_, evmx_receiver_, amount_ - nativeAmount_, nativeAmount_, data_); } function depositToNative( address token_, - address receiver_, + address evmx_receiver_, uint256 amount_, bytes memory data_ ) external override { - _deposit(token_, receiver_, 0, amount_, data_); + _deposit(token_, evmx_receiver_, 0, amount_, data_); } /// @notice Deposits funds /// @param token_ The token address /// @param creditAmount_ The amount of fees /// @param nativeAmount_ The amount of native tokens - /// @param receiver_ The receiver address + /// @param evmx_receiver_ The evmx receiver address. EVMx tokens will be minted to this address to mirror real on-chain balances. function _deposit( address token_, - address receiver_, + address evmx_receiver_, uint256 creditAmount_, uint256 nativeAmount_, bytes memory data_ ) internal { if (!whitelistedTokens[token_]) revert TokenNotWhitelisted(token_); token_.safeTransferFrom(msg.sender, address(this), creditAmount_ + nativeAmount_); - emit FeesDeposited(token_, receiver_, creditAmount_, nativeAmount_, data_); + emit FeesDeposited(token_, evmx_receiver_, creditAmount_, nativeAmount_, data_); } - /// @notice Withdraws fees + /// @notice Withdraws fees - amount in is represented as 18 decimals token. + /// Before transferring we need to convert to do decimals given token has on this chain. + /// final_amount = input_amount / 10^18 * 10^decimals => input_amount * 10^(-18 + decimals) => input_amount * 10^(decimals - 18) /// @param token_ The token address - /// @param amount_ The amount + /// @param amount_ The input amount (represented as 18 decimals token) /// @param receiver_ The receiver address function withdrawFees( address token_, diff --git a/contracts/evmx/watcher/precompiles/WritePrecompile.sol b/contracts/evmx/watcher/precompiles/WritePrecompile.sol index fd747e5a..75d3a8d9 100644 --- a/contracts/evmx/watcher/precompiles/WritePrecompile.sol +++ b/contracts/evmx/watcher/precompiles/WritePrecompile.sol @@ -133,7 +133,7 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc queueParams_.overrideParams.writeFinality, queueParams_.overrideParams.gasLimit, queueParams_.overrideParams.value, - configurations__().switchboards( + configurations__().switchboards( // switchboardId queueParams_.transaction.chainSlug, queueParams_.switchboardType ) @@ -182,7 +182,7 @@ contract WritePrecompile is WritePrecompileStorage, Initializable, Ownable, Watc payloadParams, transaction, appGateway, - transmitter_, + transmitter_, // TODO: we should use here Solana transmitter address prevBatchDigestHash, deadline, gasLimit, diff --git a/contracts/protocol/base/PlugBase.sol b/contracts/protocol/base/PlugBase.sol index a6eda992..1190d065 100644 --- a/contracts/protocol/base/PlugBase.sol +++ b/contracts/protocol/base/PlugBase.sol @@ -21,6 +21,9 @@ abstract contract PlugBase is IPlug { // overrides encoded in bytes bytes public overrides; + // TODO: why it does not have a switchboardId field if it is used in the _connectSocket function? + // should it not be saved is same way as appGatewayId? + // event emitted when plug is disconnected event ConnectorPlugDisconnected(); diff --git a/contracts/protocol/switchboard/SwitchboardBase.sol b/contracts/protocol/switchboard/SwitchboardBase.sol index 43d5cf52..c8a3bc1d 100644 --- a/contracts/protocol/switchboard/SwitchboardBase.sol +++ b/contracts/protocol/switchboard/SwitchboardBase.sol @@ -53,6 +53,7 @@ abstract contract SwitchboardBase is ISwitchboard, AccessControl { ) external view returns (address transmitter) { transmitter = transmitterSignature_.length > 0 ? _recoverSigner( + // TODO: use api encode packed keccak256(abi.encode(address(socket__), payloadId_)), transmitterSignature_ ) From 95fe49089e0994de09f17ab1ea51618990f1e745 Mon Sep 17 00:00:00 2001 From: Gregory The Dev Date: Sat, 27 Sep 2025 10:49:29 +0200 Subject: [PATCH 139/139] Minor fixes from CodeRabbit to: BorshEncoder.sol, EvmSolanaOnchainCalls.sol --- contracts/evmx/watcher/borsh-serde/BorshEncoder.sol | 11 +++++++++-- script/super-token-solana/EvmSolanaOnchainCalls.s.sol | 11 +++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/contracts/evmx/watcher/borsh-serde/BorshEncoder.sol b/contracts/evmx/watcher/borsh-serde/BorshEncoder.sol index b498059e..e0b0f9cb 100644 --- a/contracts/evmx/watcher/borsh-serde/BorshEncoder.sol +++ b/contracts/evmx/watcher/borsh-serde/BorshEncoder.sol @@ -39,7 +39,7 @@ library BorshEncoder { uint128 arg = uint128(abiDecodedArg); bytes16 borshEncodedArg = encodeU128(arg); functionArgsPacked = abi.encodePacked(functionArgsPacked, borshEncodedArg); - } else if (keccak256(bytes(typeName)) == keccak256(bytes("string"))) { + } else if (keccak256(bytes(typeName)) == keccak256(bytes("String"))) { string memory abiDecodedArg = abi.decode(data, (string)); bytes memory borshEncodedArg = encodeString(abiDecodedArg); functionArgsPacked = abi.encodePacked(functionArgsPacked, borshEncodedArg); @@ -65,7 +65,7 @@ library BorshEncoder { uint128[] memory abiDecodedArg = abi.decode(data, (uint128[])); bytes memory borshEncodedArg = encodeUint128Vec(abiDecodedArg); functionArgsPacked = abi.encodePacked(functionArgsPacked, borshEncodedArg); - } else if (keccak256(bytes(typeName)) == keccak256(bytes("string[]"))) { + } else if (keccak256(bytes(typeName)) == keccak256(bytes("String[]"))) { string[] memory abiDecodedArg = abi.decode(data, (string[])); bytes memory borshEncodedArg = encodeStringArray(abiDecodedArg); functionArgsPacked = abi.encodePacked(functionArgsPacked, borshEncodedArg); @@ -154,6 +154,7 @@ library BorshEncoder { /// Encode bytes vector into borsh. Use this method to encode strings as well. function encodeBytes(bytes memory value) internal pure returns (bytes memory) { + require(value.length <= type(uint32).max, "vector length overflow (must fit in uint32)"); return abi.encodePacked(encodeU32(uint32(value.length)), bytes(value)); } @@ -165,31 +166,37 @@ library BorshEncoder { /** Encode Vector types with that can have variable length **/ function encodeUint8Vec(uint8[] memory arr) internal pure returns (bytes memory) { + require(arr.length <= type(uint32).max, "vector length overflow (must fit in uint32)"); bytes memory packed = packUint8Array(arr); return bytes.concat(encodeU32(uint32(arr.length)), packed); } function encodeUint16Vec(uint16[] memory arr) internal pure returns (bytes memory) { + require(arr.length <= type(uint32).max, "vector length overflow (must fit in uint32)"); bytes memory packed = packUint16Array(arr); return bytes.concat(encodeU32(uint32(arr.length)), packed); } function encodeUint32Vec(uint32[] memory arr) internal pure returns (bytes memory) { + require(arr.length <= type(uint32).max, "vector length overflow (must fit in uint32)"); bytes memory packed = packUint32Array(arr); return bytes.concat(encodeU32(uint32(arr.length)), packed); } function encodeUint64Vec(uint64[] memory arr) internal pure returns (bytes memory) { + require(arr.length <= type(uint32).max, "vector length overflow (must fit in uint32)"); bytes memory packed = packUint64Array(arr); return bytes.concat(encodeU32(uint32(arr.length)), packed); } function encodeUint128Vec(uint128[] memory arr) internal pure returns (bytes memory) { + require(arr.length <= type(uint32).max, "vector length overflow (must fit in uint32)"); bytes memory packed = packUint128Array(arr); return bytes.concat(encodeU32(uint32(arr.length)), packed); } function encodeStringVec(string[] memory arr) internal pure returns (bytes memory) { + require(arr.length <= type(uint32).max, "string length overflow (must fit in uint32)"); bytes memory packed = packStringArray(arr); return bytes.concat(encodeU32(uint32(arr.length)), packed); } diff --git a/script/super-token-solana/EvmSolanaOnchainCalls.s.sol b/script/super-token-solana/EvmSolanaOnchainCalls.s.sol index 4487f437..6bc06955 100644 --- a/script/super-token-solana/EvmSolanaOnchainCalls.s.sol +++ b/script/super-token-solana/EvmSolanaOnchainCalls.s.sol @@ -253,7 +253,7 @@ contract EvmSolanaOnchainCalls is Script { bytes32 solanaTargetProgramId = vm.envBytes32("SOLANA_TARGET_PROGRAM"); // May be subject to change - bytes32[] memory accounts = new bytes32[](5); + bytes32[] memory accounts = new bytes32[](4); // accounts 0 - plug signer pda : aprk6EUeRofYzyABHXLKG8hqJ3GHGV7Uhzbu612UMBD accounts[0] = 0x08aa478d7031ac31e2a406e25f1e4dbd00bce5cbd428b7bf5e5b01abfd4b7da8; // accounts 1 - trigger counter pda : 4EYucSHVdCt5BK9N95peyVCi7weQTBoW5Tf3a2nQbRbf @@ -334,7 +334,7 @@ contract EvmSolanaOnchainCalls is Script { // accounts 4 - token programId: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA accounts[4] = 0x06ddf6e1d765a193d9cbe146ceeb79ac1cb485ed5f5b37913a8cf5857eff00a9; - bytes[] memory functionArguments = new bytes[](1); + bytes[] memory functionArguments = new bytes[](3); functionArguments[0] = abi.encode(order.srcAmount); uint256[] memory array = new uint256[](100); functionArguments[1] = abi.encode(array); @@ -346,12 +346,11 @@ contract EvmSolanaOnchainCalls is Script { }); functionArguments[2] = abi.encode(complexTestStruct); - string[] memory functionArgumentTypeNames = new string[](1); + string[] memory functionArgumentTypeNames = new string[](3); functionArgumentTypeNames[0] = "u64"; functionArgumentTypeNames[1] = "[u64;100]"; - functionArgumentTypeNames[ - 2 - ] = '{"ComplexTestStruct": {"name": "string","addr": "[u8;32]","isActive": "boolean","value": "u64"}}'; + functionArgumentTypeNames[2] = + '{"ComplexTestStruct": {"name": "string","addr": "[u8;32]","isActive": "boolean","value": "u64"}}'; bytes1[] memory accountFlags = new bytes1[](5); // superTokenConfigPda is not writable