Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
84 lines
3.4 KiB
Solidity
84 lines
3.4 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.0;
|
|
|
|
import "forge-std/Script.sol";
|
|
import "../contracts/balancer/FlashLoanReceiverSecure.sol";
|
|
|
|
/// @title Deploy FlashLoanReceiverSecure to Fork
|
|
/// @notice Deployment script for testing flash loan contract on forked Arbitrum
|
|
contract DeployFlashLoanSecure is Script {
|
|
// Balancer Vault on Arbitrum mainnet
|
|
address constant BALANCER_VAULT = 0xBA12222222228d8Ba445958a75a0704d566BF2C8;
|
|
|
|
// Arbitrum token addresses for testing
|
|
address constant WETH = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1;
|
|
address constant USDC = 0xaf88d065e77c8cC2239327C5EDb3A432268e5831;
|
|
address constant USDT = 0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9;
|
|
address constant ARB = 0x912CE59144191C1204E64559FE8253a0e49E6548;
|
|
|
|
// Uniswap V3 Router
|
|
address constant UNISWAP_V3_ROUTER = 0xE592427A0AEce92De3Edee1F18E0157C05861564;
|
|
|
|
function run() external {
|
|
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
|
|
|
|
vm.startBroadcast(deployerPrivateKey);
|
|
|
|
console.log("========================================");
|
|
console.log("Deploying FlashLoanReceiverSecure");
|
|
console.log("========================================");
|
|
console.log("Deployer:", vm.addr(deployerPrivateKey));
|
|
console.log("Balancer Vault:", BALANCER_VAULT);
|
|
console.log("");
|
|
|
|
// Deploy FlashLoanReceiverSecure
|
|
FlashLoanReceiverSecure flashLoanReceiver = new FlashLoanReceiverSecure(
|
|
BALANCER_VAULT
|
|
);
|
|
|
|
console.log("========================================");
|
|
console.log("Deployment Successful!");
|
|
console.log("========================================");
|
|
console.log("Contract Address:", address(flashLoanReceiver));
|
|
console.log("Owner:", flashLoanReceiver.owner());
|
|
console.log("Max Slippage:", flashLoanReceiver.MAX_SLIPPAGE_BPS(), "bps (0.5%)");
|
|
console.log("Max Path Length:", flashLoanReceiver.MAX_PATH_LENGTH());
|
|
console.log("");
|
|
|
|
console.log("========================================");
|
|
console.log("Test Token Addresses (Arbitrum)");
|
|
console.log("========================================");
|
|
console.log("WETH:", WETH);
|
|
console.log("USDC:", USDC);
|
|
console.log("USDT:", USDT);
|
|
console.log("ARB:", ARB);
|
|
console.log("");
|
|
|
|
console.log("========================================");
|
|
console.log("DEX Router Addresses");
|
|
console.log("========================================");
|
|
console.log("Uniswap V3:", UNISWAP_V3_ROUTER);
|
|
console.log("");
|
|
|
|
console.log("========================================");
|
|
console.log("Next Steps");
|
|
console.log("========================================");
|
|
console.log("1. Fund contract with test ETH for gas");
|
|
console.log("2. Test flash loan with small amount");
|
|
console.log("3. Verify slippage protection works");
|
|
console.log("4. Test reentrancy protection");
|
|
console.log("5. Execute real arbitrage path");
|
|
console.log("");
|
|
|
|
console.log("Example: Flash loan 1 WETH");
|
|
console.log(" cast send", address(flashLoanReceiver));
|
|
console.log(" 'executeArbitrage(address[],uint256[],bytes)'");
|
|
console.log(" '[", WETH, "]'");
|
|
console.log(" '[1000000000000000000]' # 1 WETH");
|
|
console.log(" '<encoded-path>'");
|
|
console.log("");
|
|
|
|
vm.stopBroadcast();
|
|
}
|
|
}
|