|
| 1 | +import { ContractFactory, type ethers } from 'ethers' |
| 2 | +import type { VerificationRequest } from 'scripts/types' |
| 3 | + |
| 4 | +const abi = [ |
| 5 | + { |
| 6 | + type: 'function', |
| 7 | + name: 'forwardValue', |
| 8 | + inputs: [ |
| 9 | + { name: 'to', type: 'address', internalType: 'address' }, |
| 10 | + { name: 'value', type: 'uint256', internalType: 'uint256' } |
| 11 | + ], |
| 12 | + outputs: [], |
| 13 | + stateMutability: 'payable' |
| 14 | + } |
| 15 | +] |
| 16 | + |
| 17 | +export class ValueForwarder extends ContractFactory { |
| 18 | + constructor(signer?: ethers.Signer) { |
| 19 | + super( |
| 20 | + abi, |
| 21 | + '6080806040523460155761014f908161001b8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c6398f850f11461002757600080fd5b6040366003190112610114576004356001600160a01b038116810361011457600080808093602435905af13d1561010f573d67ffffffffffffffff81116100f95760405190601f8101601f19908116603f0116820167ffffffffffffffff8111838210176100f9576040528152600060203d92013e5b156100a457005b60405162461bcd60e51b815260206004820152602760248201527f56616c7565466f727761726465723a204661696c656420746f20666f72776172604482015266642076616c756560c81b6064820152608490fd5b634e487b7160e01b600052604160045260246000fd5b61009d565b600080fdfea26469706673582212202706a11f313e042ccf1cd42b40b5f01308364a2290592fe4e14dce33175da1bf64736f6c634300081c0033', |
| 22 | + signer |
| 23 | + ) |
| 24 | + } |
| 25 | +} |
| 26 | + |
| 27 | +export const VALUEFORWARDER_VERIFICATION: Omit<VerificationRequest, 'waitForSuccess'> = { |
| 28 | + contractToVerify: 'test/mocks/ValueForwarder.sol:ValueForwarder', |
| 29 | + version: 'v0.8.28+commit.7893614a', |
| 30 | + licenceType: 'Apache-2.0', |
| 31 | + compilerInput: { |
| 32 | + language: 'Solidity', |
| 33 | + sources: { |
| 34 | + 'test/mocks/ValueForwarder.sol': { |
| 35 | + content: |
| 36 | + "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\n/// @title ValueForwarder\n/// @author Michael Standen\n/// @notice Forwarder for value\ncontract ValueForwarder {\n function forwardValue(address to, uint256 value) external payable {\n (bool success, ) = to.call{value: value}('');\n require(success, 'ValueForwarder: Failed to forward value');\n }\n}\n" |
| 37 | + } |
| 38 | + }, |
| 39 | + settings: { |
| 40 | + remappings: [ |
| 41 | + '@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/', |
| 42 | + 'erc2470-libs/=lib/erc2470-libs/', |
| 43 | + 'erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/', |
| 44 | + 'forge-std/=lib/forge-std/src/', |
| 45 | + 'halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/', |
| 46 | + 'openzeppelin-contracts/=lib/openzeppelin-contracts/' |
| 47 | + ], |
| 48 | + optimizer: { |
| 49 | + enabled: true, |
| 50 | + runs: 200 |
| 51 | + }, |
| 52 | + metadata: { |
| 53 | + useLiteralContent: false, |
| 54 | + bytecodeHash: 'ipfs', |
| 55 | + appendCBOR: true |
| 56 | + }, |
| 57 | + outputSelection: { |
| 58 | + '*': { |
| 59 | + '*': ['evm.bytecode', 'evm.deployedBytecode', 'devdoc', 'userdoc', 'metadata', 'abi'] |
| 60 | + } |
| 61 | + }, |
| 62 | + evmVersion: 'paris', |
| 63 | + viaIR: true, |
| 64 | + libraries: {} |
| 65 | + } |
| 66 | + } |
| 67 | +} |
0 commit comments