@settlemint/solidity-token-erc20-metatx
Version: 
Smart contract set to use ERC20 meta transactions in SettleMint
578 lines • 19.2 kB
JSON
{
  "compiler": {
    "version": "0.8.27+commit.40a35a09"
  },
  "language": "Solidity",
  "output": {
    "abi": [
      {
        "inputs": [
          {
            "internalType": "string",
            "name": "name",
            "type": "string"
          }
        ],
        "stateMutability": "payable",
        "type": "constructor"
      },
      {
        "inputs": [
          {
            "internalType": "uint48",
            "name": "deadline",
            "type": "uint48"
          }
        ],
        "type": "error",
        "name": "ERC2771ForwarderExpiredRequest"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "signer",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "from",
            "type": "address"
          }
        ],
        "type": "error",
        "name": "ERC2771ForwarderInvalidSigner"
      },
      {
        "inputs": [
          {
            "internalType": "uint256",
            "name": "requestedValue",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "msgValue",
            "type": "uint256"
          }
        ],
        "type": "error",
        "name": "ERC2771ForwarderMismatchedValue"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "target",
            "type": "address"
          },
          {
            "internalType": "address",
            "name": "forwarder",
            "type": "address"
          }
        ],
        "type": "error",
        "name": "ERC2771UntrustfulTarget"
      },
      {
        "inputs": [],
        "type": "error",
        "name": "FailedCall"
      },
      {
        "inputs": [
          {
            "internalType": "uint256",
            "name": "balance",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "needed",
            "type": "uint256"
          }
        ],
        "type": "error",
        "name": "InsufficientBalance"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "account",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "currentNonce",
            "type": "uint256"
          }
        ],
        "type": "error",
        "name": "InvalidAccountNonce"
      },
      {
        "inputs": [],
        "type": "error",
        "name": "InvalidShortString"
      },
      {
        "inputs": [
          {
            "internalType": "string",
            "name": "str",
            "type": "string"
          }
        ],
        "type": "error",
        "name": "StringTooLong"
      },
      {
        "inputs": [],
        "type": "event",
        "name": "EIP712DomainChanged",
        "anonymous": false
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "signer",
            "type": "address",
            "indexed": true
          },
          {
            "internalType": "uint256",
            "name": "nonce",
            "type": "uint256",
            "indexed": false
          },
          {
            "internalType": "bool",
            "name": "success",
            "type": "bool",
            "indexed": false
          }
        ],
        "type": "event",
        "name": "ExecutedForwardRequest",
        "anonymous": false
      },
      {
        "inputs": [],
        "stateMutability": "view",
        "type": "function",
        "name": "eip712Domain",
        "outputs": [
          {
            "internalType": "bytes1",
            "name": "fields",
            "type": "bytes1"
          },
          {
            "internalType": "string",
            "name": "name",
            "type": "string"
          },
          {
            "internalType": "string",
            "name": "version",
            "type": "string"
          },
          {
            "internalType": "uint256",
            "name": "chainId",
            "type": "uint256"
          },
          {
            "internalType": "address",
            "name": "verifyingContract",
            "type": "address"
          },
          {
            "internalType": "bytes32",
            "name": "salt",
            "type": "bytes32"
          },
          {
            "internalType": "uint256[]",
            "name": "extensions",
            "type": "uint256[]"
          }
        ]
      },
      {
        "inputs": [
          {
            "internalType": "struct ERC2771Forwarder.ForwardRequestData",
            "name": "request",
            "type": "tuple",
            "components": [
              {
                "internalType": "address",
                "name": "from",
                "type": "address"
              },
              {
                "internalType": "address",
                "name": "to",
                "type": "address"
              },
              {
                "internalType": "uint256",
                "name": "value",
                "type": "uint256"
              },
              {
                "internalType": "uint256",
                "name": "gas",
                "type": "uint256"
              },
              {
                "internalType": "uint48",
                "name": "deadline",
                "type": "uint48"
              },
              {
                "internalType": "bytes",
                "name": "data",
                "type": "bytes"
              },
              {
                "internalType": "bytes",
                "name": "signature",
                "type": "bytes"
              }
            ]
          }
        ],
        "stateMutability": "payable",
        "type": "function",
        "name": "execute"
      },
      {
        "inputs": [
          {
            "internalType": "struct ERC2771Forwarder.ForwardRequestData[]",
            "name": "requests",
            "type": "tuple[]",
            "components": [
              {
                "internalType": "address",
                "name": "from",
                "type": "address"
              },
              {
                "internalType": "address",
                "name": "to",
                "type": "address"
              },
              {
                "internalType": "uint256",
                "name": "value",
                "type": "uint256"
              },
              {
                "internalType": "uint256",
                "name": "gas",
                "type": "uint256"
              },
              {
                "internalType": "uint48",
                "name": "deadline",
                "type": "uint48"
              },
              {
                "internalType": "bytes",
                "name": "data",
                "type": "bytes"
              },
              {
                "internalType": "bytes",
                "name": "signature",
                "type": "bytes"
              }
            ]
          },
          {
            "internalType": "address payable",
            "name": "refundReceiver",
            "type": "address"
          }
        ],
        "stateMutability": "payable",
        "type": "function",
        "name": "executeBatch"
      },
      {
        "inputs": [
          {
            "internalType": "address",
            "name": "owner",
            "type": "address"
          }
        ],
        "stateMutability": "view",
        "type": "function",
        "name": "nonces",
        "outputs": [
          {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
          }
        ]
      },
      {
        "inputs": [
          {
            "internalType": "struct ERC2771Forwarder.ForwardRequestData",
            "name": "request",
            "type": "tuple",
            "components": [
              {
                "internalType": "address",
                "name": "from",
                "type": "address"
              },
              {
                "internalType": "address",
                "name": "to",
                "type": "address"
              },
              {
                "internalType": "uint256",
                "name": "value",
                "type": "uint256"
              },
              {
                "internalType": "uint256",
                "name": "gas",
                "type": "uint256"
              },
              {
                "internalType": "uint48",
                "name": "deadline",
                "type": "uint48"
              },
              {
                "internalType": "bytes",
                "name": "data",
                "type": "bytes"
              },
              {
                "internalType": "bytes",
                "name": "signature",
                "type": "bytes"
              }
            ]
          }
        ],
        "stateMutability": "view",
        "type": "function",
        "name": "verify",
        "outputs": [
          {
            "internalType": "bool",
            "name": "",
            "type": "bool"
          }
        ]
      }
    ],
    "devdoc": {
      "kind": "dev",
      "methods": {
        "eip712Domain()": {
          "details": "returns the fields and values that describe the domain separator used by this contract for EIP-712 signature."
        },
        "execute((address,address,uint256,uint256,uint48,bytes,bytes))": {
          "details": "Executes a `request` on behalf of `signature`'s signer using the ERC-2771 protocol. The gas provided to the requested call may not be exactly the amount requested, but the call will not run out of gas. Will revert if the request is invalid or the call reverts, in this case the nonce is not consumed. Requirements: - The request value should be equal to the provided `msg.value`. - The request should be valid according to {verify}."
        },
        "executeBatch((address,address,uint256,uint256,uint48,bytes,bytes)[],address)": {
          "details": "Batch version of {execute} with optional refunding and atomic execution. In case a batch contains at least one invalid request (see {verify}), the request will be skipped and the `refundReceiver` parameter will receive back the unused requested value at the end of the execution. This is done to prevent reverting the entire batch when a request is invalid or has already been submitted. If the `refundReceiver` is the `address(0)`, this function will revert when at least one of the requests was not valid instead of skipping it. This could be useful if a batch is required to get executed atomically (at least at the top-level). For example, refunding (and thus atomicity) can be opt-out if the relayer is using a service that avoids including reverted transactions. Requirements: - The sum of the requests' values should be equal to the provided `msg.value`. - All of the requests should be valid (see {verify}) when `refundReceiver` is the zero address. NOTE: Setting a zero `refundReceiver` guarantees an all-or-nothing requests execution only for the first-level forwarded calls. In case a forwarded request calls to a contract with another subcall, the second-level call may revert without the top-level call reverting."
        },
        "nonces(address)": {
          "details": "Returns the next unused nonce for an address."
        },
        "verify((address,address,uint256,uint256,uint48,bytes,bytes))": {
          "details": "Returns `true` if a request is valid for a provided `signature` at the current block timestamp. A transaction is considered valid when the target trusts this forwarder, the request hasn't expired (deadline is not met), and the signer matches the `from` parameter of the signed request. NOTE: A request may return false here but it won't cause {executeBatch} to revert if a refund receiver is provided."
        }
      },
      "version": 1
    },
    "userdoc": {
      "kind": "user",
      "methods": {},
      "version": 1
    }
  },
  "settings": {
    "remappings": [
      "@openzeppelin/=node_modules/@openzeppelin/",
      "forge-std/=lib/forge-std/src/",
      "hardhat/=node_modules/hardhat/"
    ],
    "optimizer": {
      "enabled": true,
      "runs": 10000
    },
    "metadata": {
      "bytecodeHash": "ipfs"
    },
    "compilationTarget": {
      "contracts/Forwarder.sol": "Forwarder"
    },
    "evmVersion": "cancun",
    "libraries": {},
    "viaIR": true
  },
  "sources": {
    "contracts/Forwarder.sol": {
      "keccak256": "0x1bc78d86650fe21dc9958746eaee97774588a3379795294a4eda7a34f3d6d280",
      "urls": [
        "bzz-raw://b071378430013e44940090a1a8324e3561275cd0905ca67b706d2f1122c54ae2",
        "dweb:/ipfs/QmTKrLU5j9mYbJtDy1EUkssQ4tuJ7cRe5jJvbJNUnYYAZF"
      ],
      "license": "FSL-1.1-MIT"
    },
    "node_modules/@openzeppelin/contracts/interfaces/IERC5267.sol": {
      "keccak256": "0xfb223a85dd0b2175cfbbaa325a744e2cd74ecd17c3df2b77b0722f991d2725ee",
      "urls": [
        "bzz-raw://84bf1dea0589ec49c8d15d559cc6d86ee493048a89b2d4adb60fbe705a3d89ae",
        "dweb:/ipfs/Qmd56n556d529wk2pRMhYhm5nhMDhviwereodDikjs68w1"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/metatx/ERC2771Context.sol": {
      "keccak256": "0x345acfb731203002ef98916d5a222339709db0ad44dc4a389e7f1ce4088ce59b",
      "urls": [
        "bzz-raw://e1dcd7e6c8ca2b402e232d2e44666c282a894c475bca15532464a47513222e5d",
        "dweb:/ipfs/QmbfGjwHHCUxHtkCECoisxr7JDiZXSFtrHNizwwKzNNSHJ"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/metatx/ERC2771Forwarder.sol": {
      "keccak256": "0x2727ef32bb32f440c5ab7225ae4bdd6bd8706d61d76ba573b85b824cbfd9c03a",
      "urls": [
        "bzz-raw://b8afdc43560109a2fe87e17a05d7871530aaa506a8c5c4f5c0b6d00a9304ca61",
        "dweb:/ipfs/QmdWXRUPHhgmuLHkhiqAab53Y3Ark7Zezu3jJmfqx9S8dK"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/Address.sol": {
      "keccak256": "0x6d0ae6e206645341fd122d278c2cb643dea260c190531f2f3f6a0426e77b00c0",
      "urls": [
        "bzz-raw://032d1201d839435be2c85b72e33206b3ea980c569d6ebf7fa57d811ab580a82f",
        "dweb:/ipfs/QmeqQjAtMvdZT2tG7zm39itcRJkuwu8AEReK6WRnLJ18DD"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/Context.sol": {
      "keccak256": "0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2",
      "urls": [
        "bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12",
        "dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/Errors.sol": {
      "keccak256": "0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123",
      "urls": [
        "bzz-raw://ba1d02f4847670a1b83dec9f7d37f0b0418d6043447b69f3a29a5f9efc547fcf",
        "dweb:/ipfs/QmQ7iH2keLNUKgq2xSWcRmuBE5eZ3F5whYAkAGzCNNoEWB"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/Nonces.sol": {
      "keccak256": "0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f",
      "urls": [
        "bzz-raw://132dce9686a54e025eb5ba5d2e48208f847a1ec3e60a3e527766d7bf53fb7f9e",
        "dweb:/ipfs/QmXn1a2nUZMpu2z6S88UoTfMVtY2YNh86iGrzJDYmMkKeZ"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/Panic.sol": {
      "keccak256": "0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a",
      "urls": [
        "bzz-raw://c6a5ff4f9fd8649b7ee20800b7fa387d3465bd77cf20c2d1068cd5c98e1ed57a",
        "dweb:/ipfs/QmVSaVJf9FXFhdYEYeCEfjMVHrxDh5qL4CGkxdMWpQCrqG"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/ShortStrings.sol": {
      "keccak256": "0x1fcf8cceb1a67e6c8512267e780933c4a3f63ef44756e6c818fda79be51c8402",
      "urls": [
        "bzz-raw://617d7d57f6f9cd449068b4d23daf485676d083aae648e038d05eb3a13291de35",
        "dweb:/ipfs/QmPADWPiGaSzZDFNpFEUx4ZPqhzPkYncBpHyTfAGcfsqzy"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/StorageSlot.sol": {
      "keccak256": "0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97",
      "urls": [
        "bzz-raw://9f660b1f351b757dfe01438e59888f31f33ded3afcf5cb5b0d9bf9aa6f320a8b",
        "dweb:/ipfs/QmarDJ5hZEgBtCmmrVzEZWjub9769eD686jmzb2XpSU1cM"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/Strings.sol": {
      "keccak256": "0xad148d59f05165f9217d0a9e1ac8f772abb02ea6aaad8a756315c532bf79f9f4",
      "urls": [
        "bzz-raw://15e3599867c2182f5831e9268b274b2ef2047825837df6b4d81c9e89254b093e",
        "dweb:/ipfs/QmZbL7XAYr5RmaNaooPgZRmcDXaudfsYQfYD9y5iAECvpS"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/cryptography/ECDSA.sol": {
      "keccak256": "0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84",
      "urls": [
        "bzz-raw://8e25e4bdb7ae1f21d23bfee996e22736fc0ab44cfabedac82a757b1edc5623b9",
        "dweb:/ipfs/QmQdWQvB6JCP9ZMbzi8EvQ1PTETqkcTWrbcVurS7DKpa5n"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/cryptography/EIP712.sol": {
      "keccak256": "0x17fc4574e07105b0180ef61f1b3cacd1820a3d37f29a4af1018d0a253c6399b5",
      "urls": [
        "bzz-raw://be46b3e1362dbcadbbb45ec92cdea849dceccea3e2795237f00c123aeae44746",
        "dweb:/ipfs/QmSpyB8mud6xKiZaQnVtEPrxtTHGtyBgjs1PCYk4f2gesd"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": {
      "keccak256": "0x26670fef37d4adf55570ba78815eec5f31cb017e708f61886add4fc4da665631",
      "urls": [
        "bzz-raw://b16d45febff462bafd8a5669f904796a835baf607df58a8461916d3bf4f08c59",
        "dweb:/ipfs/QmU2eJFpjmT4vxeJWJyLeQb8Xht1kdB8Y6MKLDPFA9WPux"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/math/Math.sol": {
      "keccak256": "0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6",
      "urls": [
        "bzz-raw://6c5fab4970634f9ab9a620983dc1c8a30153981a0b1a521666e269d0a11399d3",
        "dweb:/ipfs/QmVRnBC575MESGkEHndjujtR7qub2FzU9RWy9eKLp4hPZB"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/math/SafeCast.sol": {
      "keccak256": "0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54",
      "urls": [
        "bzz-raw://b1d578337048cad08c1c03041cca5978eff5428aa130c781b271ad9e5566e1f8",
        "dweb:/ipfs/QmPFKL2r9CBsMwmUqqdcFPfHZB2qcs9g1HDrPxzWSxomvy"
      ],
      "license": "MIT"
    },
    "node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol": {
      "keccak256": "0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3",
      "urls": [
        "bzz-raw://db5fbb3dddd8b7047465b62575d96231ba8a2774d37fb4737fbf23340fabbb03",
        "dweb:/ipfs/QmVUSvooZKEdEdap619tcJjTLcAuH6QBdZqAzWwnAXZAWJ"
      ],
      "license": "MIT"
    }
  },
  "version": 1
}