Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b887c34
refactor: update ERC20CommerceEscrowWrapper deployment script to supp…
rodrigopavezi Dec 9, 2025
e5c1743
Update packages/smart-contracts/src/lib/artifacts/AuthCaptureEscrow/i…
rodrigopavezi Dec 9, 2025
ebb9c68
chore: update TheGraph API URLs and clean up client logic
rodrigopavezi Dec 9, 2025
3216bf7
Merge branch 'feat/commerce-escrow-eth-sepolia-deployment' of https:/…
rodrigopavezi Dec 9, 2025
6ab211b
test: enhance request-client.js tests with real timers and payment op…
rodrigopavezi Dec 10, 2025
8e6d598
test: update request-client.js tests to use advanced fake timers
rodrigopavezi Dec 10, 2025
f9a4cbc
test: refactor request-client.js tests to use jest.spyOn for mocking …
rodrigopavezi Dec 10, 2025
885bf17
test: improve request-client.js tests with mock server resets and tim…
rodrigopavezi Dec 10, 2025
04617bf
test: ensure proper mock restoration in request-client.js tests
rodrigopavezi Dec 11, 2025
ad93c7e
test: simplify timer management in request-client.js tests
rodrigopavezi Dec 11, 2025
0d7798b
test: replace jest fake timers with setTimeout in request-client.js t…
rodrigopavezi Dec 11, 2025
8b72a4b
test: enhance request-client.js tests with improved readability and s…
rodrigopavezi Dec 11, 2025
6394b8f
test: extend timeout for request-client.js tests to improve reliability
rodrigopavezi Dec 11, 2025
e5c3f3a
test: update erc20-commerce-escrow-wrapper tests to use real wrapper …
rodrigopavezi Dec 11, 2025
4079433
refactor: prepare ERC20CommerceEscrowWrapper for Create2 deployment (…
MantisClone Dec 11, 2025
bfe6cfe
feat: add ERC20CommerceEscrowWrapper deployed addresses for Sepolia a…
MantisClone Dec 12, 2025
6e9d4ca
chore: add .ignore to .gitignore for improved file management
MantisClone Dec 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { deployOne } from './deploy-one';

// Base Mainnet & Base Sepolia Contract Addresses
const BASE_SEPOLIA_CONTRACTS = {
AuthCaptureEscrow: '0xBdEA0D1bcC5966192B070Fdf62aB4EF5b4420cff',
ERC3009PaymentCollector: '0x0E3dF9510de65469C4518D7843919c0b8C7A7757',
Permit2PaymentCollector: '0x992476B9Ee81d52a5BdA0622C333938D0Af0aB26',
PreApprovalPaymentCollector: '0x1b77ABd71FCD21fbe2398AE821Aa27D1E6B94bC6',
SpendPermissionPaymentCollector: '0x8d9F34934dc9619e5DC3Df27D0A40b4A744E7eAa',
OperatorRefundCollector: '0x934907bffd0901b6A21e398B9C53A4A38F02fa5d',
// Contract Addresses by Network
const NETWORK_CONTRACTS: Record<
string,
{
AuthCaptureEscrow: string;
ERC20FeeProxy?: string;
}
> = {
'base-sepolia': {
AuthCaptureEscrow: '0xBdEA0D1bcC5966192B070Fdf62aB4EF5b4420cff',
},
sepolia: {
AuthCaptureEscrow: '0xF81E3F293c92CaCfc0d723d2D8183e39Cc3AEdC7',
ERC20FeeProxy: '0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE',
},
};

/**
* Deploy ERC20CommerceEscrowWrapper using official Base contracts
* Deploy ERC20CommerceEscrowWrapper using network-specific contracts
*
* This script will:
* 1. Deploy ERC20FeeProxy if not already deployed
* 2. Use the official AuthCaptureEscrow contract deployed on Base Sepolia
* 1. Use existing ERC20FeeProxy if available, or deploy a new one
* 2. Use the official AuthCaptureEscrow contract deployed on the target network
* 3. Deploy ERC20CommerceEscrowWrapper with the above dependencies
*/
export default async function deployERC20CommerceEscrowWrapper(
Expand All @@ -42,16 +49,34 @@ export default async function deployERC20CommerceEscrowWrapper(
console.log(`Deployer: ${deployer.address}`);
console.log(`Deployer balance: ${hre.ethers.utils.formatEther(await deployer.getBalance())} ETH`);

// Step 1: Deploy ERC20FeeProxy
console.log('\n--- Step 1: Deploying ERC20FeeProxy ---');
const { address: erc20FeeProxyAddress } = await deployOne(args, hre, 'ERC20FeeProxy', {
verify: true,
});
console.log(`✅ ERC20FeeProxy deployed at: ${erc20FeeProxyAddress}`);
// Get network-specific contract addresses
const networkContracts = NETWORK_CONTRACTS[hre.network.name];
if (!networkContracts) {
throw new Error(
`Network ${hre.network.name} is not configured. Please add contract addresses to NETWORK_CONTRACTS.`,
);
}

let erc20FeeProxyAddress: string;

// Step 1: Get or Deploy ERC20FeeProxy
console.log('\n--- Step 1: ERC20FeeProxy ---');
if (networkContracts.ERC20FeeProxy) {
// Use existing ERC20FeeProxy
erc20FeeProxyAddress = networkContracts.ERC20FeeProxy;
console.log(`✅ Using existing ERC20FeeProxy at: ${erc20FeeProxyAddress}`);
} else {
// Deploy ERC20FeeProxy
const result = await deployOne(args, hre, 'ERC20FeeProxy', {
verify: true,
});
erc20FeeProxyAddress = result.address;
console.log(`✅ ERC20FeeProxy deployed at: ${erc20FeeProxyAddress}`);
}

// Step 2: Use official AuthCaptureEscrow contract
console.log('\n--- Step 2: Using official AuthCaptureEscrow ---');
const authCaptureEscrowAddress = BASE_SEPOLIA_CONTRACTS.AuthCaptureEscrow;
const authCaptureEscrowAddress = networkContracts.AuthCaptureEscrow;
console.log(`✅ Using official AuthCaptureEscrow at: ${authCaptureEscrowAddress}`);

// Step 3: Deploy ERC20CommerceEscrowWrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export const authCaptureEscrowArtifact = new ContractArtifact<AuthCaptureEscrow>
address: '0x0000000000000000000000000000000000000000',
creationBlockNumber: 0,
},
// Base Sepolia deployment (same address as mainnet via CREATE2)
// Sepolia deployment
sepolia: {
address: '0x1234567890123456789012345678901234567890', // Placeholder - to be updated with actual deployment
creationBlockNumber: 0,
address: '0xF81E3F293c92CaCfc0d723d2D8183e39Cc3AEdC7',
creationBlockNumber: 9795220,
},
// Base Mainnet deployment (same address as sepolia via CREATE2)
base: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,13 @@ export const erc20CommerceEscrowWrapperArtifact = new ContractArtifact<ERC20Comm
},
// Testnet deployments for testing
sepolia: {
address: '0x1234567890123456789012345678901234567890', // Placeholder - to be updated with actual deployment
creationBlockNumber: 0,
},
goerli: {
address: '0x2345678901234567890123456789012345678901', // Placeholder - to be updated with actual deployment
creationBlockNumber: 0,
},
mumbai: {
address: '0x3456789012345678901234567890123456789012', // Placeholder - to be updated with actual deployment
address: '0x4062C5c38b14A90f9293010a72b53FA3b400bD46',
creationBlockNumber: 0,
},
'base-sepolia': {
address: '0xDF4945F8AB31C666714f34DDF8Ac9445379fD3f5', // To be updated after deployment
address: '0xDF4945F8AB31C666714f34DDF8Ac9445379fD3f5',
creationBlockNumber: 0,
},
// TODO: Add deployment addresses for mainnet networks once deployed
// mainnet: {
// address: '0x0000000000000000000000000000000000000000',
// creationBlockNumber: 0,
// },
// matic: {
// address: '0x0000000000000000000000000000000000000000',
// creationBlockNumber: 0,
// },
},
},
},
Expand Down
Loading