From 78d9f60b7db0293f4e12b0ec9069a0d1712f6c47 Mon Sep 17 00:00:00 2001 From: mfw78 Date: Tue, 22 Aug 2023 06:17:56 +0000 Subject: [PATCH 1/3] chore: remove repo abi --- abi/ComposableCoW.json | 608 ----------------------------- abi/ExtensibleFallbackHandler.json | 493 ----------------------- abi/TWAP.json | 324 --------------- 3 files changed, 1425 deletions(-) delete mode 100644 abi/ComposableCoW.json delete mode 100644 abi/ExtensibleFallbackHandler.json delete mode 100644 abi/TWAP.json diff --git a/abi/ComposableCoW.json b/abi/ComposableCoW.json deleted file mode 100644 index 8f50c242..00000000 --- a/abi/ComposableCoW.json +++ /dev/null @@ -1,608 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "_settlement", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "InterfaceNotSupported", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidHandler", - "type": "error" - }, - { - "inputs": [], - "name": "ProofNotAuthed", - "type": "error" - }, - { - "inputs": [], - "name": "SingleOrderNotAuthed", - "type": "error" - }, - { - "inputs": [], - "name": "SwapGuardRestricted", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "components": [ - { - "internalType": "contract IConditionalOrder", - "name": "handler", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "staticInput", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct IConditionalOrder.ConditionalOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "ConditionalOrderCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "root", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "location", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct ComposableCoW.Proof", - "name": "proof", - "type": "tuple" - } - ], - "name": "MerkleRootSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract ISwapGuard", - "name": "swapGuard", - "type": "address" - } - ], - "name": "SwapGuardSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "cabinet", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "contract IConditionalOrder", - "name": "handler", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "staticInput", - "type": "bytes" - } - ], - "internalType": "struct IConditionalOrder.ConditionalOrderParams", - "name": "params", - "type": "tuple" - }, - { - "internalType": "bool", - "name": "dispatch", - "type": "bool" - } - ], - "name": "create", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "contract IConditionalOrder", - "name": "handler", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "staticInput", - "type": "bytes" - } - ], - "internalType": "struct IConditionalOrder.ConditionalOrderParams", - "name": "params", - "type": "tuple" - }, - { - "internalType": "contract IValueFactory", - "name": "factory", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bool", - "name": "dispatch", - "type": "bool" - } - ], - "name": "createWithContext", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "domainSeparator", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "components": [ - { - "internalType": "contract IConditionalOrder", - "name": "handler", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "staticInput", - "type": "bytes" - } - ], - "internalType": "struct IConditionalOrder.ConditionalOrderParams", - "name": "params", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "offchainInput", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "proof", - "type": "bytes32[]" - } - ], - "name": "getTradeableOrderWithSignature", - "outputs": [ - { - "components": [ - { - "internalType": "contract IERC20", - "name": "sellToken", - "type": "address" - }, - { - "internalType": "contract IERC20", - "name": "buyToken", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sellAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "buyAmount", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "validTo", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "appData", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "partiallyFillable", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "sellTokenBalance", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "buyTokenBalance", - "type": "bytes32" - } - ], - "internalType": "struct GPv2Order.Data", - "name": "order", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "contract IConditionalOrder", - "name": "handler", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "staticInput", - "type": "bytes" - } - ], - "internalType": "struct IConditionalOrder.ConditionalOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "hash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract Safe", - "name": "safe", - "type": "address" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_hash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "_domainSeparator", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "encodeData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "payload", - "type": "bytes" - } - ], - "name": "isValidSafeSignature", - "outputs": [ - { - "internalType": "bytes4", - "name": "magic", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "singleOrderHash", - "type": "bytes32" - } - ], - "name": "remove", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "roots", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "root", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "location", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct ComposableCoW.Proof", - "name": "proof", - "type": "tuple" - } - ], - "name": "setRoot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "root", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "location", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "internalType": "struct ComposableCoW.Proof", - "name": "proof", - "type": "tuple" - }, - { - "internalType": "contract IValueFactory", - "name": "factory", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "setRootWithContext", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract ISwapGuard", - "name": "swapGuard", - "type": "address" - } - ], - "name": "setSwapGuard", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "singleOrders", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "swapGuards", - "outputs": [ - { - "internalType": "contract ISwapGuard", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/abi/ExtensibleFallbackHandler.json b/abi/ExtensibleFallbackHandler.json deleted file mode 100644 index 907244db..00000000 --- a/abi/ExtensibleFallbackHandler.json +++ /dev/null @@ -1,493 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract Safe", - "name": "safe", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "domainSeparator", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "contract ISafeSignatureVerifier", - "name": "verifier", - "type": "address" - } - ], - "name": "AddedDomainVerifier", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract Safe", - "name": "safe", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "AddedInterface", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract Safe", - "name": "safe", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes4", - "name": "selector", - "type": "bytes4" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "method", - "type": "bytes32" - } - ], - "name": "AddedSafeMethod", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract Safe", - "name": "safe", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "domainSeparator", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "contract ISafeSignatureVerifier", - "name": "oldVerifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract ISafeSignatureVerifier", - "name": "newVerifier", - "type": "address" - } - ], - "name": "ChangedDomainVerifier", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract Safe", - "name": "safe", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes4", - "name": "selector", - "type": "bytes4" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "oldMethod", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "newMethod", - "type": "bytes32" - } - ], - "name": "ChangedSafeMethod", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract Safe", - "name": "safe", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "domainSeparator", - "type": "bytes32" - } - ], - "name": "RemovedDomainVerifier", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract Safe", - "name": "safe", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "RemovedInterface", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "contract Safe", - "name": "safe", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes4", - "name": "selector", - "type": "bytes4" - } - ], - "name": "RemovedSafeMethod", - "type": "event" - }, - { - "stateMutability": "nonpayable", - "type": "fallback" - }, - { - "inputs": [ - { - "internalType": "contract Safe", - "name": "", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "domainVerifiers", - "outputs": [ - { - "internalType": "contract ISafeSignatureVerifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "_hash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "isValidSignature", - "outputs": [ - { - "internalType": "bytes4", - "name": "magic", - "type": "bytes4" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155BatchReceived", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC721Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract Safe", - "name": "", - "type": "address" - }, - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "name": "safeInterfaces", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract Safe", - "name": "", - "type": "address" - }, - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "name": "safeMethods", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "domainSeparator", - "type": "bytes32" - }, - { - "internalType": "contract ISafeSignatureVerifier", - "name": "newVerifier", - "type": "address" - } - ], - "name": "setDomainVerifier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "selector", - "type": "bytes4" - }, - { - "internalType": "bytes32", - "name": "newMethod", - "type": "bytes32" - } - ], - "name": "setSafeMethod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - }, - { - "internalType": "bool", - "name": "supported", - "type": "bool" - } - ], - "name": "setSupportedInterface", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "_interfaceId", - "type": "bytes4" - }, - { - "internalType": "bytes32[]", - "name": "handlerWithSelectors", - "type": "bytes32[]" - } - ], - "name": "setSupportedInterfaceBatch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file diff --git a/abi/TWAP.json b/abi/TWAP.json deleted file mode 100644 index e6f15edd..00000000 --- a/abi/TWAP.json +++ /dev/null @@ -1,324 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "contract ComposableCoW", - "name": "_composableCow", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "InvalidFrequency", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidMinPartLimit", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidNumParts", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidPartSellAmount", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidSameToken", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidSpan", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidStartTime", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidToken", - "type": "error" - }, - { - "inputs": [], - "name": "OrderNotValid", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "components": [ - { - "internalType": "contract IConditionalOrder", - "name": "handler", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "staticInput", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct IConditionalOrder.ConditionalOrderParams", - "name": "params", - "type": "tuple" - } - ], - "name": "ConditionalOrderCreated", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "ctx", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "staticInput", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "getTradeableOrder", - "outputs": [ - { - "components": [ - { - "internalType": "contract IERC20", - "name": "sellToken", - "type": "address" - }, - { - "internalType": "contract IERC20", - "name": "buyToken", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sellAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "buyAmount", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "validTo", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "appData", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "partiallyFillable", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "sellTokenBalance", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "buyTokenBalance", - "type": "bytes32" - } - ], - "internalType": "struct GPv2Order.Data", - "name": "order", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_hash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "domainSeparator", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "ctx", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "staticInput", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "offchainInput", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "contract IERC20", - "name": "sellToken", - "type": "address" - }, - { - "internalType": "contract IERC20", - "name": "buyToken", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sellAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "buyAmount", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "validTo", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "appData", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "feeAmount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "kind", - "type": "bytes32" - }, - { - "internalType": "bool", - "name": "partiallyFillable", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "sellTokenBalance", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "buyTokenBalance", - "type": "bytes32" - } - ], - "internalType": "struct GPv2Order.Data", - "name": "", - "type": "tuple" - } - ], - "name": "verify", - "outputs": [], - "stateMutability": "view", - "type": "function" - } -] \ No newline at end of file From ada3598f7e485fd8c2e764da344e36bc15df9355 Mon Sep 17 00:00:00 2001 From: mfw78 Date: Tue, 22 Aug 2023 06:18:47 +0000 Subject: [PATCH 2/3] chore: gitignore abi --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 95699543..8c543b40 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ jest.results.json .yalc yalc.lock src/composable/generated -docs/typedoc/ \ No newline at end of file +docs/typedoc/ +abi/ \ No newline at end of file From d4e56eb23a6a39a29b49fa0e2833cca21d5ddd31 Mon Sep 17 00:00:00 2001 From: mfw78 Date: Tue, 22 Aug 2023 07:16:10 +0000 Subject: [PATCH 3/3] chore: fetch abi --- package.json | 2 +- prepublish.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 prepublish.ts diff --git a/package.json b/package.json index b785bd4e..72963df7 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "types": "dist/index.d.ts", "scripts": { - "prebuild": "rm -rf dist && yarn run codegen", + "prebuild": "rm -rf dist && rm -rf abi && yarn ts-node prepublish.ts && yarn run codegen", "build": "microbundle -f modern,esm,cjs", "start": "microbundle -f modern,esm,cjs watch", "postbuild": "cp package.json dist && cp README.md dist", diff --git a/prepublish.ts b/prepublish.ts new file mode 100644 index 00000000..b3923145 --- /dev/null +++ b/prepublish.ts @@ -0,0 +1,48 @@ +import * as fs from 'fs' +import * as https from 'https' +import * as path from 'path' + +const UPSTREAM_COMMIT_HASH = '8c762559c98b707801f52dd070dd39ab9478b876' +const UPSTREAM_REPO = 'https://raw.githubusercontent.com/cowprotocol/composable-cow' +const ABI_TO_FETCH = ['ComposableCoW', 'ExtensibleFallbackHandler', 'TWAP'] + +const urlsToDownload = ABI_TO_FETCH.map((abi) => { + return `${UPSTREAM_REPO}/${UPSTREAM_COMMIT_HASH}/out/${abi}.sol/${abi}.json` +}) + +const abiDir = path.join(__dirname, 'abi') + +if (!fs.existsSync(abiDir)) { + fs.mkdirSync(abiDir) +} + +function downloadFile(url: string, targetPath: string): Promise { + return new Promise((resolve, reject) => { + const fileStream = fs.createWriteStream(targetPath) + const request = https.get(url, (response) => { + response.pipe(fileStream) + fileStream.on('finish', () => { + fileStream.close(() => resolve()) + }) + }) + + request.on('error', (error) => { + reject(error) + }) + }) +} + +async function downloadAndMoveFiles(urls: string[]): Promise { + for (const url of urls) { + const filename = path.basename(url) + const targetPath = path.join(abiDir, filename) + await downloadFile(url, targetPath) + console.log(`File ${filename} downloaded and saved successfully.`) + } +} + +async function main() { + await downloadAndMoveFiles(urlsToDownload) +} + +main()