Skip to content

Commit ec0ca57

Browse files
author
Achilles Bot
committed
fix(hardhat): add proper ESM config, fix contract syntax for Hardhat 3.x, compilation working
1 parent 04cb174 commit ec0ca57

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

contracts/BasePayContract.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// SPDX-License-Identifier: MIT
22
pragma 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.
916
contract 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;

hardhat.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
};

0 commit comments

Comments
 (0)