Verified contractPartialUNLICENSED
Bridge
Address0x9bf99a52da5e584057404f686deda2c0281e4f35
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.1
- Same code
1 more contract
Details
- Compiler
- solc 0.8.1+commit.df193b15
- Language
- solidity
- Optimization
- No
- EVM version
- istanbul
- License
- UNLICENSED
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 19,865,378
- Creation transaction
- 0xe156d17227…5a61ccfb07
- Main copy (most transactions)
- 0x873f2cd9…66b63b84
2 files
- Bridge.solmain1.04 KB
- Ownable.sol845 B
Bridge.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.1;
import "./Ownable.sol";
interface Token {
function transfer(address to, uint256 value) external;
}
contract Bridge is Ownable {
constructor () Ownable(msg.sender) payable {}
fallback() external payable {}
receive() external payable {}
function transferToken(address coin, address[] calldata dsts, uint256[] calldata values) public onlyOwner{
require(dsts.length == values.length);
Token token = Token(coin);
uint256 total = 0;
uint256 count = dsts.length;
for (uint256 i = 0; i < count; i++) {
token.transfer(dsts[i], values[i]);
total += values[i];
}
}
function transferEth(address payable[] calldata dsts, uint256[] calldata values) public onlyOwner{
require(dsts.length == values.length);
uint256 total = 0;
for (uint256 i = 0; i < dsts.length; i++) {
dsts[i].transfer(values[i]);
total += values[i];
}
}
}
Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
contract Ownable {
bytes32 private constant ownerPosition = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
constructor(address ownerAddress) {
setOwner(ownerAddress);
}
function setOwner(address newOwner) internal {
bytes32 position = ownerPosition;
assembly {
sstore(position, newOwner)
}
}
function getOwner() public view returns (address owner) {
bytes32 position = ownerPosition;
assembly {
owner := sload(position)
}
}
modifier onlyOwner() {
require(msg.sender == getOwner());
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
setOwner(newOwner);
}
}Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": false
},
"evmVersion": "istanbul",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.