Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- LocalToBridge
- Optimization enabled
- true
- Compiler version
- v0.8.7+commit.e28d00a7
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-09-26T15:32:25.550074Z
Constructor Arguments
0x00000000000000000000000006dc704b8313ab9216a79363b870fc6e558b443800000000000000000000000000000000000000000000000000000000000000c7
Arg [0] (address) : 0x06dc704b8313ab9216a79363b870fc6e558b4438
Arg [1] (uint256) : 199
Contract source code
// SPDX-License-Identifier: No License (None) pragma solidity ^0.8.0; interface IBridge{ function depositTokens( address receiver, // address of token receiver on destination chain address token, // token that user send (if token address < 32, then send native coin) uint256 value, // tokens value uint256 toChainId // destination chain Id where will be claimed tokens ) external; } interface IERC20 { // initialize cloned token just for BEP20TokenCloned function balanceOf(address account) external view returns (uint256); function allowance(address _owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); } interface ISimplifiedGlobalFarm { function mintFarmingReward(address _localFarm) external; function getAllocationX1000(address _farm) external view returns (uint256); function getRewardPerSecond() external view returns (uint256); function rewardMintingAvailable(address _farm) external view returns (bool); function farmExists(address _farmAddress) external view returns (bool); function owner() external view returns (address); } contract LocalToBridge { address public soy = address(0x9FaE2529863bD691B4A7171bDfCf33C7ebB10a65); address public bridge = address(0x9a1fc8C0369D49f3040bF49c1490E7006657ea56); address public globalFarm = address(0x64Fa36ACD0d13472FD786B03afC9C52aD5FCf023); address public foreignGlobalFarm; uint256 public foreignGlobalFarmChainId; uint256 public lastRewardTimestamp; // Last block number that SOY distribution occurs. event RewardAdded(uint256 reward); constructor (address _foreignGlobalFarm, uint256 _foreignGlobalFarmChainId) { foreignGlobalFarm = _foreignGlobalFarm; foreignGlobalFarmChainId = _foreignGlobalFarmChainId; IERC20(soy).approve(bridge, type(uint256).max); } function tokenReceived(address _from, uint256 _amount, bytes memory _data) external { require(msg.sender == soy && _from == globalFarm, "sender is not allowed"); } function notifyRewardAmount(uint256 reward) external { require (msg.sender == globalFarm, "Only globalFarm"); IBridge(bridge).depositTokens(foreignGlobalFarm, soy, reward, foreignGlobalFarmChainId); emit RewardAdded(reward); } function claim() external { require(ISimplifiedGlobalFarm(globalFarm).rewardMintingAvailable(address(this)), "Reward not available"); ISimplifiedGlobalFarm(globalFarm).mintFarmingReward(address(this)); } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_foreignGlobalFarm","internalType":"address"},{"type":"uint256","name":"_foreignGlobalFarmChainId","internalType":"uint256"}]},{"type":"event","name":"RewardAdded","inputs":[{"type":"uint256","name":"reward","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"bridge","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claim","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"foreignGlobalFarm","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"foreignGlobalFarmChainId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"globalFarm","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastRewardTimestamp","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"notifyRewardAmount","inputs":[{"type":"uint256","name":"reward","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"soy","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"tokenReceived","inputs":[{"type":"address","name":"_from","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]}]
Contract Creation Code
0x6080604052600080546001600160a01b0319908116739fae2529863bd691b4a7171bdfcf33c7ebb10a6517909155600180548216739a1fc8c0369d49f3040bf49c1490e7006657ea56179055600280549091167364fa36acd0d13472fd786b03afc9c52ad5fcf02317905534801561007657600080fd5b5060405161070b38038061070b83398101604081905261009591610146565b600380546001600160a01b0319166001600160a01b0384811691909117909155600482815560005460015460405163095ea7b360e01b81529084169281019290925260001960248301529091169063095ea7b390604401602060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013e9190610180565b5050506101a9565b6000806040838503121561015957600080fd5b82516001600160a01b038116811461017057600080fd5b6020939093015192949293505050565b60006020828403121561019257600080fd5b815180151581146101a257600080fd5b9392505050565b610553806101b86000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80634f3a1ff8116100665780634f3a1ff8146100fc5780638943ec021461010f578063daa3a33114610122578063e78cea9214610135578063f8077fae1461014857600080fd5b806339e1be0e146100985780633c6b16ab146100c8578063424de00d146100dd5780634e71d92d146100f4575b600080fd5b6000546100ab906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100db6100d63660046104ee565b610151565b005b6100e660045481565b6040519081526020016100bf565b6100db61025f565b6002546100ab906001600160a01b031681565b6100db61011d3660046103ec565b61037c565b6003546100ab906001600160a01b031681565b6001546100ab906001600160a01b031681565b6100e660055481565b6002546001600160a01b031633146101a25760405162461bcd60e51b815260206004820152600f60248201526e4f6e6c7920676c6f62616c4661726d60881b60448201526064015b60405180910390fd5b6001546003546000546004805460405163487cda0d60e01b81526001600160a01b0394851692810192909252918316602482015260448101859052606481019190915291169063487cda0d90608401600060405180830381600087803b15801561020b57600080fd5b505af115801561021f573d6000803e3d6000fd5b505050507fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d8160405161025491815260200190565b60405180910390a150565b60025460405163445c92c560e01b81523060048201526001600160a01b039091169063445c92c59060240160206040518083038186803b1580156102a257600080fd5b505afa1580156102b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102da91906104c5565b61031d5760405162461bcd60e51b8152602060048201526014602482015273526577617264206e6f7420617661696c61626c6560601b6044820152606401610199565b60025460405163032453f160e51b81523060048201526001600160a01b039091169063648a7e2090602401600060405180830381600087803b15801561036257600080fd5b505af1158015610376573d6000803e3d6000fd5b50505050565b6000546001600160a01b0316331480156103a357506002546001600160a01b038481169116145b6103e75760405162461bcd60e51b81526020600482015260156024820152741cd95b99195c881a5cc81b9bdd08185b1b1bddd959605a1b6044820152606401610199565b505050565b60008060006060848603121561040157600080fd5b83356001600160a01b038116811461041857600080fd5b925060208401359150604084013567ffffffffffffffff8082111561043c57600080fd5b818601915086601f83011261045057600080fd5b81358181111561046257610462610507565b604051601f8201601f19908116603f0116810190838211818310171561048a5761048a610507565b816040528281528960208487010111156104a357600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000602082840312156104d757600080fd5b815180151581146104e757600080fd5b9392505050565b60006020828403121561050057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220b597e681bda933ec038ab056cd0e6e22d7da0ea95a64edf475b79f882f02324c64736f6c6343000807003300000000000000000000000006dc704b8313ab9216a79363b870fc6e558b443800000000000000000000000000000000000000000000000000000000000000c7
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80634f3a1ff8116100665780634f3a1ff8146100fc5780638943ec021461010f578063daa3a33114610122578063e78cea9214610135578063f8077fae1461014857600080fd5b806339e1be0e146100985780633c6b16ab146100c8578063424de00d146100dd5780634e71d92d146100f4575b600080fd5b6000546100ab906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100db6100d63660046104ee565b610151565b005b6100e660045481565b6040519081526020016100bf565b6100db61025f565b6002546100ab906001600160a01b031681565b6100db61011d3660046103ec565b61037c565b6003546100ab906001600160a01b031681565b6001546100ab906001600160a01b031681565b6100e660055481565b6002546001600160a01b031633146101a25760405162461bcd60e51b815260206004820152600f60248201526e4f6e6c7920676c6f62616c4661726d60881b60448201526064015b60405180910390fd5b6001546003546000546004805460405163487cda0d60e01b81526001600160a01b0394851692810192909252918316602482015260448101859052606481019190915291169063487cda0d90608401600060405180830381600087803b15801561020b57600080fd5b505af115801561021f573d6000803e3d6000fd5b505050507fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d8160405161025491815260200190565b60405180910390a150565b60025460405163445c92c560e01b81523060048201526001600160a01b039091169063445c92c59060240160206040518083038186803b1580156102a257600080fd5b505afa1580156102b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102da91906104c5565b61031d5760405162461bcd60e51b8152602060048201526014602482015273526577617264206e6f7420617661696c61626c6560601b6044820152606401610199565b60025460405163032453f160e51b81523060048201526001600160a01b039091169063648a7e2090602401600060405180830381600087803b15801561036257600080fd5b505af1158015610376573d6000803e3d6000fd5b50505050565b6000546001600160a01b0316331480156103a357506002546001600160a01b038481169116145b6103e75760405162461bcd60e51b81526020600482015260156024820152741cd95b99195c881a5cc81b9bdd08185b1b1bddd959605a1b6044820152606401610199565b505050565b60008060006060848603121561040157600080fd5b83356001600160a01b038116811461041857600080fd5b925060208401359150604084013567ffffffffffffffff8082111561043c57600080fd5b818601915086601f83011261045057600080fd5b81358181111561046257610462610507565b604051601f8201601f19908116603f0116810190838211818310171561048a5761048a610507565b816040528281528960208487010111156104a357600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b6000602082840312156104d757600080fd5b815180151581146104e757600080fd5b9392505050565b60006020828403121561050057600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fdfea2646970667358221220b597e681bda933ec038ab056cd0e6e22d7da0ea95a64edf475b79f882f02324c64736f6c63430008070033