Discover more of SonicScan Block Explorer's tools and services in one place.
Contract Source Code:
File 1 of 1 : BatchBridge
// SPDX-License-Identifier: MIT pragma solidity >= 0.8.0; interface IBridge { function deposit(uint256 fee) external payable; } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BatchBridge { address owner; constructor() { owner = msg.sender; } function withdraw(address token) public { require(msg.sender == address(owner)); IERC20(token).transfer(msg.sender, IERC20(token).balanceOf(address(this))); } function withdrawNative(uint256 amount) public { require(msg.sender == address(owner)); payable(owner).transfer(amount); } receive() external payable { } }
// SPDX-License-Identifier: MIT pragma solidity >= 0.8.0; interface IBridge { function deposit(uint256 fee) external payable; } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BatchBridge { address owner; address bridge = 0x3561607590e28e0848ba3B67074C676D6D1C9953; uint256 MAX_DEPOSIT = 100 ether; constructor() { owner = msg.sender; } function withdraw(address token) public { require(msg.sender == address(owner)); IERC20(token).transfer(msg.sender, IERC20(token).balanceOf(address(this))); } function withdrawNative(uint256 amount) public { require(msg.sender == address(owner)); payable(owner).transfer(amount); } receive() external payable { uint256 loops = msg.value / MAX_DEPOSIT; for (uint256 i=0; i<loops; i++) { IBridge(bridge).deposit{value: MAX_DEPOSIT}(0); } } function setMax(uint256 max) public { require(owner == msg.sender); MAX_DEPOSIT = max; } }
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.