File tree Expand file tree Collapse file tree 2 files changed +25
-7
lines changed
Expand file tree Collapse file tree 2 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: MIT
22pragma solidity ^ 0.8.20 ;
33
4+ // Minimal ERC20 interface (USDC)
5+ interface IERC20 {
6+ function transferFrom (address from , address to , uint256 amount ) external returns (bool );
7+ function transfer (address to , uint256 amount ) external returns (bool );
8+ function balanceOf (address account ) external view returns (uint256 );
9+ }
10+
411/// @title BasePayContract
512/// @notice Accepts USDC micro-fee payments per EP validation request (requestId).
613/// @dev Agents approve USDC to this contract, then call pay(requestId).
714/// EP server verifies payment by reading receipts[requestId].
815/// Owner can withdraw accumulated USDC.
916contract BasePayContract {
10- // Minimal ERC20 interface (USDC)
11- interface IERC20 {
12- function transferFrom (address from , address to , uint256 amount ) external returns (bool );
13- function transfer (address to , uint256 amount ) external returns (bool );
14- function balanceOf (address account ) external view returns (uint256 );
15- }
16-
1717 struct Receipt {
1818 address payer;
1919 uint256 amount;
Original file line number Diff line number Diff line change 1+ /** @type import('hardhat/config').HardhatUserConfig */
2+ export default {
3+ solidity : {
4+ version : '0.8.20' ,
5+ settings : {
6+ optimizer : {
7+ enabled : true ,
8+ runs : 200
9+ }
10+ }
11+ } ,
12+ paths : {
13+ sources : './contracts' ,
14+ tests : './test-hardhat' ,
15+ cache : './cache' ,
16+ artifacts : './artifacts'
17+ }
18+ } ;
You can’t perform that action at this time.
0 commit comments