diff --git a/contracts/protocol/payload-delivery/app-gateway/AuctionManager.sol b/contracts/protocol/payload-delivery/app-gateway/AuctionManager.sol index 59bad963..17c555db 100644 --- a/contracts/protocol/payload-delivery/app-gateway/AuctionManager.sol +++ b/contracts/protocol/payload-delivery/app-gateway/AuctionManager.sol @@ -152,7 +152,7 @@ contract AuctionManager is AddressResolverUtil, Ownable, IAuctionManager, Initia function expireBid(bytes32 asyncId_) external onlyWatcherPrecompile { PayloadBatch memory batch = IDeliveryHelper(addressResolver__.deliveryHelper()) .payloadBatches(asyncId_); - + // if executed, bid is not expired if (batch.totalPayloadsRemaining == 0 || batch.isBatchCancelled) return; diff --git a/contracts/protocol/utils/common/Errors.sol b/contracts/protocol/utils/common/Errors.sol index 1ab0cde6..11c15386 100644 --- a/contracts/protocol/utils/common/Errors.sol +++ b/contracts/protocol/utils/common/Errors.sol @@ -28,4 +28,4 @@ error InvalidPromise(); error InvalidIndex(); error InvalidTransmitter(); error FeesNotSet(); -error InvalidTokenAddress(); \ No newline at end of file +error InvalidTokenAddress(); diff --git a/contracts/protocol/watcherPrecompile/WatcherPrecompile.sol b/contracts/protocol/watcherPrecompile/WatcherPrecompile.sol index c79753fb..7d18ca94 100644 --- a/contracts/protocol/watcherPrecompile/WatcherPrecompile.sol +++ b/contracts/protocol/watcherPrecompile/WatcherPrecompile.sol @@ -300,7 +300,10 @@ contract WatcherPrecompile is WatcherPrecompileConfig, Initializable { /// @dev Only callable by the contract owner /// @dev Watcher signs on following digest for validation on switchboard: /// @dev keccak256(abi.encode(switchboard, root)) - function finalized(bytes32 payloadId_, bytes calldata signature_) external onlyRole(WATCHER_ROLE) { + function finalized( + bytes32 payloadId_, + bytes calldata signature_ + ) external onlyRole(WATCHER_ROLE) { watcherSignatures[payloadId_] = signature_; emit Finalized(payloadId_, asyncRequests[payloadId_], signature_); } @@ -308,7 +311,9 @@ contract WatcherPrecompile is WatcherPrecompileConfig, Initializable { /// @notice Resolves multiple promises with their return data /// @param resolvedPromises_ Array of resolved promises and their return data /// @dev Only callable by the contract owner - function resolvePromises(ResolvedPromises[] calldata resolvedPromises_) external onlyRole(WATCHER_ROLE) { + function resolvePromises( + ResolvedPromises[] calldata resolvedPromises_ + ) external onlyRole(WATCHER_ROLE) { for (uint256 i = 0; i < resolvedPromises_.length; i++) { // Get the array of promise addresses for this payload AsyncRequest memory asyncRequest_ = asyncRequests[resolvedPromises_[i].payloadId]; @@ -335,7 +340,10 @@ contract WatcherPrecompile is WatcherPrecompileConfig, Initializable { } // wait till expiry time to assign fees - function markRevert(bytes32 payloadId_, bool isRevertingOnchain_) external onlyRole(WATCHER_ROLE) { + function markRevert( + bytes32 payloadId_, + bool isRevertingOnchain_ + ) external onlyRole(WATCHER_ROLE) { AsyncRequest memory asyncRequest_ = asyncRequests[payloadId_]; address[] memory next = asyncRequest_.next; @@ -378,7 +386,9 @@ contract WatcherPrecompile is WatcherPrecompileConfig, Initializable { // ================== On-Chain Inbox ================== - function callAppGateways(CallFromInboxParams[] calldata params_) external onlyRole(WATCHER_ROLE) { + function callAppGateways( + CallFromInboxParams[] calldata params_ + ) external onlyRole(WATCHER_ROLE) { for (uint256 i = 0; i < params_.length; i++) { if (appGatewayCalled[params_[i].callId]) revert AppGatewayAlreadyCalled(); if (!isValidInboxCaller[params_[i].appGateway][params_[i].chainSlug][params_[i].plug]) diff --git a/hardhat-scripts/constants/relayers.ts b/hardhat-scripts/constants/relayers.ts index 1cbee517..589291d9 100644 --- a/hardhat-scripts/constants/relayers.ts +++ b/hardhat-scripts/constants/relayers.ts @@ -1,22 +1,22 @@ export const relayerAddressList = [ - "0x59D24CD3A0b2b646F980A62DCb0aA4115506FFc9", - "0x762783712FD12231601d6d8591F3a5718812D534", - "0x9f5C9941306E7B57583E99033BedB7eA7889EEA4", - "0xd35F262d6f2D3F6D610bAf6635dE57c349ca83A1", - "0xce6b9c352f864515d7E8BBEA67d80d18245937F2", - "0xE651eDb3F16D9e6b1145ae5eee388f0e48D2d44b", - "0xc176E88dE45747743699fAeA58814Ce98a2faC2D", - "0x88220692264EEc280Bd5AaF9278CdE0737Feb2D6", - "0x2d68551354226c7321130f122055F049F8F67791", - "0xA7C89619ceaC009a23c6C3bC5F74d41BBaC68fD1", - "0x7893D79718860DF30e5Fd21AAA6Be05edD22465D", - "0x6386c83e994331c6a41A4420294D130930AEDF9e", - "0xfF33A0afc88CbF48C9DB31Fc2D2EC2F36D598184", - "0xB756B6D986eE448433542A60A1f590EE3B0DFCda", - "0x76943F947D5622624444aeFF135a5121d6732299", - "0x049B750045fdE15F347aF9E86FB80dD879C848ea", - "0x9c653569C32473F40210495128BB5A40ef10c65B", - "0x0291a40beF28E3606b8208a665F900d141E9A8B3", - "0x2e498dFB44CC79D2ef80Afd7C4439BEC8822E216", - "0x049E701A690E885467E54A1B0595f90BDc8324B0" -] \ No newline at end of file + "0x59D24CD3A0b2b646F980A62DCb0aA4115506FFc9", + "0x762783712FD12231601d6d8591F3a5718812D534", + "0x9f5C9941306E7B57583E99033BedB7eA7889EEA4", + "0xd35F262d6f2D3F6D610bAf6635dE57c349ca83A1", + "0xce6b9c352f864515d7E8BBEA67d80d18245937F2", + "0xE651eDb3F16D9e6b1145ae5eee388f0e48D2d44b", + "0xc176E88dE45747743699fAeA58814Ce98a2faC2D", + "0x88220692264EEc280Bd5AaF9278CdE0737Feb2D6", + "0x2d68551354226c7321130f122055F049F8F67791", + "0xA7C89619ceaC009a23c6C3bC5F74d41BBaC68fD1", + "0x7893D79718860DF30e5Fd21AAA6Be05edD22465D", + "0x6386c83e994331c6a41A4420294D130930AEDF9e", + "0xfF33A0afc88CbF48C9DB31Fc2D2EC2F36D598184", + "0xB756B6D986eE448433542A60A1f590EE3B0DFCda", + "0x76943F947D5622624444aeFF135a5121d6732299", + "0x049B750045fdE15F347aF9E86FB80dD879C848ea", + "0x9c653569C32473F40210495128BB5A40ef10c65B", + "0x0291a40beF28E3606b8208a665F900d141E9A8B3", + "0x2e498dFB44CC79D2ef80Afd7C4439BEC8822E216", + "0x049E701A690E885467E54A1B0595f90BDc8324B0", +]; diff --git a/hardhat-scripts/deploy/2.roles.ts b/hardhat-scripts/deploy/2.roles.ts index 687cee9b..fe6ab9f9 100644 --- a/hardhat-scripts/deploy/2.roles.ts +++ b/hardhat-scripts/deploy/2.roles.ts @@ -60,28 +60,34 @@ async function setRoleForContract( async function getSigner(chain: number, isWatcher: boolean = false) { const providerInstance = getProviderFromChainSlug(chain); const signer: Wallet = new ethers.Wallet( - isWatcher ? process.env.WATCHER_PRIVATE_KEY as string : process.env.SOCKET_SIGNER_KEY as string, + isWatcher + ? (process.env.WATCHER_PRIVATE_KEY as string) + : (process.env.SOCKET_SIGNER_KEY as string), providerInstance ); return signer; } - -async function setRolesForOnChain(chain: number, addresses: DeploymentAddresses) { - const chainAddresses: ChainAddressesObj = (addresses[chain] ?? {}) as ChainAddressesObj; +async function setRolesForOnChain( + chain: number, + addresses: DeploymentAddresses +) { + const chainAddresses: ChainAddressesObj = (addresses[chain] ?? + {}) as ChainAddressesObj; const signer = await getSigner(chain); for (const [contractName, roles] of Object.entries(REQUIRED_ROLES)) { - const contractAddress = chainAddresses[contractName as keyof ChainAddressesObj]; + const contractAddress = + chainAddresses[contractName as keyof ChainAddressesObj]; if (!contractAddress) continue; for (const roleName of roles) { const targetAddress = - contractName === CORE_CONTRACTS.FastSwitchboard && roleName === ROLES.WATCHER_ROLE + contractName === CORE_CONTRACTS.FastSwitchboard && + roleName === ROLES.WATCHER_ROLE ? watcher : signer.address; - await setRoleForContract( contractName as CORE_CONTRACTS, contractAddress, @@ -95,7 +101,8 @@ async function setRolesForOnChain(chain: number, addresses: DeploymentAddresses) } async function setRolesForEVMx(addresses: DeploymentAddresses) { - const chainAddresses: ChainAddressesObj = (addresses[EVMX_CHAIN_ID] ?? {}) as ChainAddressesObj; + const chainAddresses: ChainAddressesObj = (addresses[EVMX_CHAIN_ID] ?? + {}) as ChainAddressesObj; const signer = await getSigner(EVMX_CHAIN_ID, true); const contractAddress = chainAddresses[EVMxCoreContracts.WatcherPrecompile]; diff --git a/package.json b/package.json index 7e70a99c..250a9afd 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "publishConfig": { "access": "public" }, - "version": "1.0.11", + "version": "1.0.12", "description": "socket protocol", "scripts": { "build": "hardhat export-abi && tsc --project lib.tsconfig.json",