ETH Price: $3,394.70 (+1.89%)

Contract

0x720eB39C557B80AC99F548Dd6922DB7113c30eff
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Pay199658842024-05-28 4:09:11179 days ago1716869351IN
0x720eB39C...113c30eff
0 ETH0.0030184830
0x60806040199658162024-05-28 3:55:35179 days ago1716868535IN
 Contract Creation
0 ETH0.0096635916.50426989

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xF729ac7D...C884e812e
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
PaymentContract

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2024-05-29
*/

// SPDX-License-Identifier: MIT
// File: @openzeppelin/[email protected]/token/ERC20/IERC20.sol



pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// File: contracts/GRDNPay.sol


pragma solidity ^0.8.0;


contract PaymentContract {
    address public owner;
    IERC20 public grdnToken;
    uint256 public paymentAmount;

    // Sự kiện khi thanh toán thành công
    event PaymentReceived(address indexed from, uint256 amount);
    
    // Sự kiện khi thay đổi địa chỉ token GRDN
    event TokenAddressChanged(address indexed newTokenAddress);

    constructor(address _grdnTokenAddress, uint256 _paymentAmount) {
        owner = msg.sender;
        grdnToken = IERC20(_grdnTokenAddress);
        paymentAmount = _paymentAmount;
    }

    // Hàm để thay đổi địa chỉ token GRDN
    function setTokenAddress(address _newTokenAddress) external {
        require(msg.sender == owner, "Only owner can set the token address");
        grdnToken = IERC20(_newTokenAddress);
        emit TokenAddressChanged(_newTokenAddress);
    }

    // Hàm để thay đổi số lượng token cần thanh toán
    function setPaymentAmount(uint256 _newAmount) external {
        require(msg.sender == owner, "Only owner can set the payment amount");
        paymentAmount = _newAmount;
    }

    // Hàm để thực hiện thanh toán
    function pay() external {
        require(grdnToken.transferFrom(msg.sender, owner, paymentAmount), "Token transfer failed");
        emit PaymentReceived(msg.sender, paymentAmount);
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_grdnTokenAddress","type":"address"},{"internalType":"uint256","name":"_paymentAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newTokenAddress","type":"address"}],"name":"TokenAddressChanged","type":"event"},{"inputs":[],"name":"grdnToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paymentAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAmount","type":"uint256"}],"name":"setPaymentAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newTokenAddress","type":"address"}],"name":"setTokenAddress","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610060575f3560e01c806305f6c1a8146100645780631b9265b81461008057806326a4e8d21461008a5780638da5cb5b146100a6578063c35905c6146100c4578063d0b8f390146100e2575b5f80fd5b61007e6004803603810190610079919061047f565b610100565b005b610088610197565b005b6100a4600480360381019061009f9190610504565b6102e7565b005b6100ae6103fa565b6040516100bb919061053e565b60405180910390f35b6100cc61041d565b6040516100d99190610566565b60405180910390f35b6100ea610423565b6040516100f791906105da565b60405180910390f35b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461018d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018490610673565b60405180910390fd5b8060028190555050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd335f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002546040518463ffffffff1660e01b815260040161021693929190610691565b6020604051808303815f875af1158015610232573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061025691906106fb565b610295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028c90610770565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be7706002546040516102dd9190610566565b60405180910390a2565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610374576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161036b906107fe565b60405180910390fd5b8060015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f1297217f6da0341ba2cab10677a2e4471c20ebc84acc96ef2339a734a3a233b260405160405180910390a250565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f80fd5b5f819050919050565b61045e8161044c565b8114610468575f80fd5b50565b5f8135905061047981610455565b92915050565b5f6020828403121561049457610493610448565b5b5f6104a18482850161046b565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6104d3826104aa565b9050919050565b6104e3816104c9565b81146104ed575f80fd5b50565b5f813590506104fe816104da565b92915050565b5f6020828403121561051957610518610448565b5b5f610526848285016104f0565b91505092915050565b610538816104c9565b82525050565b5f6020820190506105515f83018461052f565b92915050565b6105608161044c565b82525050565b5f6020820190506105795f830184610557565b92915050565b5f819050919050565b5f6105a261059d610598846104aa565b61057f565b6104aa565b9050919050565b5f6105b382610588565b9050919050565b5f6105c4826105a9565b9050919050565b6105d4816105ba565b82525050565b5f6020820190506105ed5f8301846105cb565b92915050565b5f82825260208201905092915050565b7f4f6e6c79206f776e65722063616e2073657420746865207061796d656e7420615f8201527f6d6f756e74000000000000000000000000000000000000000000000000000000602082015250565b5f61065d6025836105f3565b915061066882610603565b604082019050919050565b5f6020820190508181035f83015261068a81610651565b9050919050565b5f6060820190506106a45f83018661052f565b6106b1602083018561052f565b6106be6040830184610557565b949350505050565b5f8115159050919050565b6106da816106c6565b81146106e4575f80fd5b50565b5f815190506106f5816106d1565b92915050565b5f602082840312156107105761070f610448565b5b5f61071d848285016106e7565b91505092915050565b7f546f6b656e207472616e73666572206661696c656400000000000000000000005f82015250565b5f61075a6015836105f3565b915061076582610726565b602082019050919050565b5f6020820190508181035f8301526107878161074e565b9050919050565b7f4f6e6c79206f776e65722063616e207365742074686520746f6b656e206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f6107e86024836105f3565b91506107f38261078e565b604082019050919050565b5f6020820190508181035f830152610815816107dc565b905091905056fea264697066735822122084b4e61a6d10de62c5dddae7f0d26e4aeab0bcac20ba1f9fc07308ef2037af8464736f6c63430008190033

Deployed Bytecode Sourcemap

2941:1377:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3891:180;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;4124:191;;;:::i;:::-;;3567:247;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;2973:20;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3030:28;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3000:23;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;3891:180;3979:5;;;;;;;;;;3965:19;;:10;:19;;;3957:69;;;;;;;;;;;;:::i;:::-;;;;;;;;;4053:10;4037:13;:26;;;;3891:180;:::o;4124:191::-;4167:9;;;;;;;;;;;:22;;;4190:10;4202:5;;;;;;;;;;4209:13;;4167:56;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4159:90;;;;;;;;;;;;:::i;:::-;;;;;;;;;4281:10;4265:42;;;4293:13;;4265:42;;;;;;:::i;:::-;;;;;;;;4124:191::o;3567:247::-;3660:5;;;;;;;;;;3646:19;;:10;:19;;;3638:68;;;;;;;;;;;;:::i;:::-;;;;;;;;;3736:16;3717:9;;:36;;;;;;;;;;;;;;;;;;3789:16;3769:37;;;;;;;;;;;;3567:247;:::o;2973:20::-;;;;;;;;;;;;:::o;3030:28::-;;;;:::o;3000:23::-;;;;;;;;;;;;;:::o;88:117:1:-;197:1;194;187:12;334:77;371:7;400:5;389:16;;334:77;;;:::o;417:122::-;490:24;508:5;490:24;:::i;:::-;483:5;480:35;470:63;;529:1;526;519:12;470:63;417:122;:::o;545:139::-;591:5;629:6;616:20;607:29;;645:33;672:5;645:33;:::i;:::-;545:139;;;;:::o;690:329::-;749:6;798:2;786:9;777:7;773:23;769:32;766:119;;;804:79;;:::i;:::-;766:119;924:1;949:53;994:7;985:6;974:9;970:22;949:53;:::i;:::-;939:63;;895:117;690:329;;;;:::o;1025:126::-;1062:7;1102:42;1095:5;1091:54;1080:65;;1025:126;;;:::o;1157:96::-;1194:7;1223:24;1241:5;1223:24;:::i;:::-;1212:35;;1157:96;;;:::o;1259:122::-;1332:24;1350:5;1332:24;:::i;:::-;1325:5;1322:35;1312:63;;1371:1;1368;1361:12;1312:63;1259:122;:::o;1387:139::-;1433:5;1471:6;1458:20;1449:29;;1487:33;1514:5;1487:33;:::i;:::-;1387:139;;;;:::o;1532:329::-;1591:6;1640:2;1628:9;1619:7;1615:23;1611:32;1608:119;;;1646:79;;:::i;:::-;1608:119;1766:1;1791:53;1836:7;1827:6;1816:9;1812:22;1791:53;:::i;:::-;1781:63;;1737:117;1532:329;;;;:::o;1867:118::-;1954:24;1972:5;1954:24;:::i;:::-;1949:3;1942:37;1867:118;;:::o;1991:222::-;2084:4;2122:2;2111:9;2107:18;2099:26;;2135:71;2203:1;2192:9;2188:17;2179:6;2135:71;:::i;:::-;1991:222;;;;:::o;2219:118::-;2306:24;2324:5;2306:24;:::i;:::-;2301:3;2294:37;2219:118;;:::o;2343:222::-;2436:4;2474:2;2463:9;2459:18;2451:26;;2487:71;2555:1;2544:9;2540:17;2531:6;2487:71;:::i;:::-;2343:222;;;;:::o;2571:60::-;2599:3;2620:5;2613:12;;2571:60;;;:::o;2637:142::-;2687:9;2720:53;2738:34;2747:24;2765:5;2747:24;:::i;:::-;2738:34;:::i;:::-;2720:53;:::i;:::-;2707:66;;2637:142;;;:::o;2785:126::-;2835:9;2868:37;2899:5;2868:37;:::i;:::-;2855:50;;2785:126;;;:::o;2917:139::-;2980:9;3013:37;3044:5;3013:37;:::i;:::-;3000:50;;2917:139;;;:::o;3062:157::-;3162:50;3206:5;3162:50;:::i;:::-;3157:3;3150:63;3062:157;;:::o;3225:248::-;3331:4;3369:2;3358:9;3354:18;3346:26;;3382:84;3463:1;3452:9;3448:17;3439:6;3382:84;:::i;:::-;3225:248;;;;:::o;3479:169::-;3563:11;3597:6;3592:3;3585:19;3637:4;3632:3;3628:14;3613:29;;3479:169;;;;:::o;3654:224::-;3794:34;3790:1;3782:6;3778:14;3771:58;3863:7;3858:2;3850:6;3846:15;3839:32;3654:224;:::o;3884:366::-;4026:3;4047:67;4111:2;4106:3;4047:67;:::i;:::-;4040:74;;4123:93;4212:3;4123:93;:::i;:::-;4241:2;4236:3;4232:12;4225:19;;3884:366;;;:::o;4256:419::-;4422:4;4460:2;4449:9;4445:18;4437:26;;4509:9;4503:4;4499:20;4495:1;4484:9;4480:17;4473:47;4537:131;4663:4;4537:131;:::i;:::-;4529:139;;4256:419;;;:::o;4681:442::-;4830:4;4868:2;4857:9;4853:18;4845:26;;4881:71;4949:1;4938:9;4934:17;4925:6;4881:71;:::i;:::-;4962:72;5030:2;5019:9;5015:18;5006:6;4962:72;:::i;:::-;5044;5112:2;5101:9;5097:18;5088:6;5044:72;:::i;:::-;4681:442;;;;;;:::o;5129:90::-;5163:7;5206:5;5199:13;5192:21;5181:32;;5129:90;;;:::o;5225:116::-;5295:21;5310:5;5295:21;:::i;:::-;5288:5;5285:32;5275:60;;5331:1;5328;5321:12;5275:60;5225:116;:::o;5347:137::-;5401:5;5432:6;5426:13;5417:22;;5448:30;5472:5;5448:30;:::i;:::-;5347:137;;;;:::o;5490:345::-;5557:6;5606:2;5594:9;5585:7;5581:23;5577:32;5574:119;;;5612:79;;:::i;:::-;5574:119;5732:1;5757:61;5810:7;5801:6;5790:9;5786:22;5757:61;:::i;:::-;5747:71;;5703:125;5490:345;;;;:::o;5841:171::-;5981:23;5977:1;5969:6;5965:14;5958:47;5841:171;:::o;6018:366::-;6160:3;6181:67;6245:2;6240:3;6181:67;:::i;:::-;6174:74;;6257:93;6346:3;6257:93;:::i;:::-;6375:2;6370:3;6366:12;6359:19;;6018:366;;;:::o;6390:419::-;6556:4;6594:2;6583:9;6579:18;6571:26;;6643:9;6637:4;6633:20;6629:1;6618:9;6614:17;6607:47;6671:131;6797:4;6671:131;:::i;:::-;6663:139;;6390:419;;;:::o;6815:223::-;6955:34;6951:1;6943:6;6939:14;6932:58;7024:6;7019:2;7011:6;7007:15;7000:31;6815:223;:::o;7044:366::-;7186:3;7207:67;7271:2;7266:3;7207:67;:::i;:::-;7200:74;;7283:93;7372:3;7283:93;:::i;:::-;7401:2;7396:3;7392:12;7385:19;;7044:366;;;:::o;7416:419::-;7582:4;7620:2;7609:9;7605:18;7597:26;;7669:9;7663:4;7659:20;7655:1;7644:9;7640:17;7633:47;7697:131;7823:4;7697:131;:::i;:::-;7689:139;;7416:419;;;:::o

Swarm Source

ipfs://84b4e61a6d10de62c5dddae7f0d26e4aeab0bcac20ba1f9fc07308ef2037af84

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.