Contract Overview
Balance:
0 MATIC
MATIC Value:
$0.00
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
StreamBridgeCrossChain
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.11; import "./interfaces/ISwap.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Context.sol"; contract StreamBridgeCrossChain is Context { using SafeERC20 for IERC20; using SafeMath for uint256; mapping(address => address) public swapMapping2BSC; mapping(address => address) public swapMappingFrmBSC; mapping(bytes32 => bool) public filledBSCTx; address payable public owner; address public superAdmin; address payable public feeReceiver; uint256 public swapFee; uint256 public feePercentageInStream; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); event SuperAdminChanged( address indexed previousSuperAdmin, address indexed newSuperAdmin ); event FeeReceiverUpdated( address indexed prevFeeReceiver, address indexed newFeeReceiver ); event SwapPairCreated( bytes32 indexed bscRegisterTxHash, address indexed gen20Addr, address indexed bep20Addr ); event SwapStarted( address indexed gen20Addr, address indexed bep20Addr, address indexed fromAddr, uint256 amount, uint256 feeAmount, uint256 feeInStream, string chain ); event SwapFilled( address indexed bep20Addr, bytes32 indexed bscTxHash, address indexed toAddress, uint256 amount, string chain ); constructor( uint256 fee_Native, uint256 fee_PerStream, address payable fee_Receiver, address super_Admin ) { swapFee = fee_Native; feePercentageInStream = fee_PerStream; feeReceiver = fee_Receiver; owner = payable(msg.sender); superAdmin = super_Admin; } /** * Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * Throws if called transferOwnership by any account other than the super admin. */ modifier onlySuperAdmin() { require( superAdmin == _msgSender(), "Super Admin: caller is not the super admin" ); _; } modifier notContract() { require(!isContract(msg.sender), "contract is not allowed to swap"); _; } modifier noProxy() { require(msg.sender == tx.origin, "no proxy is allowed"); _; } function isContract(address addr) internal view returns (bool) { uint256 size; assembly { size := extcodesize(addr) } return size > 0; } /** * Leaves the contract without owner. It will not be possible to call * `onlySuperAdmin` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public onlySuperAdmin { emit OwnershipTransferred(owner, address(0)); owner = payable(0); } /** * Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address payable newOwner) public onlySuperAdmin { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * Change Super Admin of the contract to a new account (`newSuperAdmin`). * Can only be called by the current super admin. */ function changeSuperAdmin(address newSuperAdmin) public onlySuperAdmin { require( newSuperAdmin != address(0), "Super Admin: new super admin is the zero address" ); emit SuperAdminChanged(superAdmin, newSuperAdmin); superAdmin = newSuperAdmin; } /** * Transfers fee receiver to a new account (`newFeeReceiver`). * Can only be called by the current owner. */ function changeFeeReceiver(address payable newFeeReceiver) public onlySuperAdmin { require( newFeeReceiver != address(0), "Fee Receiver: new fee receiver address is zero " ); emit FeeReceiverUpdated(feeReceiver, newFeeReceiver); feeReceiver = newFeeReceiver; } /** * Returns set minimum swap fee */ function setSwapFee(uint256 fee) external onlyOwner { swapFee = fee; } /** * Returns set minimum swap fee in STRM */ function setSwapFeePercentageOfSTRM(uint256 _feePerStream) external onlyOwner { require( _feePerStream < 100000000000000000000, "feePercentageInStream: Greater than 100 %" ); feePercentageInStream = _feePerStream; } /** * createSwapPair */ function createSwapPair( bytes32 bscTxHash, address bep20Addr, address gen20TokenAddr ) external onlyOwner returns (address) { require( swapMapping2BSC[bep20Addr] == address(0x0), "duplicated swap pair" ); swapMapping2BSC[bep20Addr] = address(gen20TokenAddr); swapMappingFrmBSC[address(gen20TokenAddr)] = bep20Addr; emit SwapPairCreated( bscTxHash, gen20TokenAddr, bep20Addr ); return address(gen20TokenAddr); } /** * fill Swap between 2 chains */ function fillSwap( bytes32 requestSwapTxHash, address bep20Addr, address toAddress, uint256 amount, string calldata chain ) external onlyOwner returns (bool) { require(!filledBSCTx[requestSwapTxHash], "bsc tx filled already"); address genTokenAddr = swapMapping2BSC[bep20Addr]; require(genTokenAddr != address(0x0), "no swap pair for this token"); require(amount > 0, "Amount should be greater than 0"); ISwap(genTokenAddr).mint(toAddress, amount); filledBSCTx[requestSwapTxHash] = true; emit SwapFilled( genTokenAddr, requestSwapTxHash, toAddress, amount, chain ); return true; } /** * swap token to other chain */ function swapToken( address gen20Addr, uint256 amount, string calldata chain ) external payable notContract noProxy returns (bool) { address bep20Addr = swapMappingFrmBSC[gen20Addr]; require(bep20Addr != address(0x0), "no swap pair for this token"); require(msg.value >= swapFee, "swap fee is not enough"); require(amount > 0, "Amount should be greater than 0"); require( feePercentageInStream < 100000000000000000000, "feePercentageInStream: Greater than 100 %" ); uint256 feeAmountInStrm = 0; if (feePercentageInStream > 0) { feeAmountInStrm = amount.mul(feePercentageInStream); feeAmountInStrm = feeAmountInStrm.div(100000000000000000000); amount = amount.sub(feeAmountInStrm); IERC20(gen20Addr).safeTransferFrom( msg.sender, feeReceiver, feeAmountInStrm ); } if (msg.value != 0) { owner.transfer(msg.value); } IERC20(gen20Addr).safeTransferFrom(msg.sender, address(this), amount); ISwap(gen20Addr).burn(amount); emit SwapStarted( gen20Addr, bep20Addr, msg.sender, amount, msg.value, feeAmountInStrm, chain ); return true; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.11; interface ISwap { /** * Creates `amount` tokens and assigns them to `recipient`, increasing * the total supply. * * Requirements * * - `msg.sender` must be the token owner * - `_mintable` must be true */ function mint(address recipient, uint256 amount) external; /** * Burn `amount` tokens and decreasing the total supply. */ function burn(uint256 amount) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"fee_Native","type":"uint256"},{"internalType":"uint256","name":"fee_PerStream","type":"uint256"},{"internalType":"address payable","name":"fee_Receiver","type":"address"},{"internalType":"address","name":"super_Admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevFeeReceiver","type":"address"},{"indexed":true,"internalType":"address","name":"newFeeReceiver","type":"address"}],"name":"FeeReceiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousSuperAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newSuperAdmin","type":"address"}],"name":"SuperAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bep20Addr","type":"address"},{"indexed":true,"internalType":"bytes32","name":"bscTxHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"chain","type":"string"}],"name":"SwapFilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"bscRegisterTxHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"gen20Addr","type":"address"},{"indexed":true,"internalType":"address","name":"bep20Addr","type":"address"}],"name":"SwapPairCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"gen20Addr","type":"address"},{"indexed":true,"internalType":"address","name":"bep20Addr","type":"address"},{"indexed":true,"internalType":"address","name":"fromAddr","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feeInStream","type":"uint256"},{"indexed":false,"internalType":"string","name":"chain","type":"string"}],"name":"SwapStarted","type":"event"},{"inputs":[{"internalType":"address payable","name":"newFeeReceiver","type":"address"}],"name":"changeFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSuperAdmin","type":"address"}],"name":"changeSuperAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"bscTxHash","type":"bytes32"},{"internalType":"address","name":"bep20Addr","type":"address"},{"internalType":"address","name":"gen20TokenAddr","type":"address"}],"name":"createSwapPair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feePercentageInStream","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestSwapTxHash","type":"bytes32"},{"internalType":"address","name":"bep20Addr","type":"address"},{"internalType":"address","name":"toAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"chain","type":"string"}],"name":"fillSwap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"filledBSCTx","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setSwapFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feePerStream","type":"uint256"}],"name":"setSwapFeePercentageOfSTRM","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"superAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"swapMapping2BSC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"swapMappingFrmBSC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"gen20Addr","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"chain","type":"string"}],"name":"swapToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161157c38038061157c83398101604081905261002f9161008e565b600693909355600791909155600580546001600160a01b039283166001600160a01b03199182161790915560038054821633179055600480549290931691161790556100d9565b6001600160a01b038116811461008b57600080fd5b50565b600080600080608085870312156100a457600080fd5b845193506020850151925060408501516100bd81610076565b60608601519092506100ce81610076565b939692955090935050565b611494806100e86000396000f3fe6080604052600436106100fe5760003560e01c80637c08b96411610095578063b3f0067411610064578063b3f00674146102a4578063b5100483146102c4578063f2fde38b146102e4578063fbcaee9614610304578063fcdb0e161461033a57600080fd5b80637c08b9641461023b5780638da5cb5b1461025b5780638f4d78bb1461027b578063a29ca78b1461029157600080fd5b806350877c77116100d157806350877c77146101b257806354cf2aeb146101e2578063564a7d3314610206578063715018a61461022657600080fd5b806329575f6a1461010357806334e19907146101405780633f6a336f1461016257806341858c4b14610192575b600080fd5b34801561010f57600080fd5b50600454610123906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b5061016061015b366004611068565b610370565b005b34801561016e57600080fd5b5061018261017d3660046110e2565b6103a8565b6040519015158152602001610137565b34801561019e57600080fd5b506101606101ad36600461115e565b6105bb565b3480156101be57600080fd5b506101826101cd366004611068565b60026020526000908152604090205460ff1681565b3480156101ee57600080fd5b506101f860065481565b604051908152602001610137565b34801561021257600080fd5b5061012361022136600461117b565b6106b0565b34801561023257600080fd5b506101606107b5565b34801561024757600080fd5b5061016061025636600461115e565b610829565b34801561026757600080fd5b50600354610123906001600160a01b031681565b34801561028757600080fd5b506101f860075481565b61018261029f3660046111bd565b61091d565b3480156102b057600080fd5b50600554610123906001600160a01b031681565b3480156102d057600080fd5b506101606102df366004611068565b610c53565b3480156102f057600080fd5b506101606102ff36600461115e565b610caa565b34801561031057600080fd5b5061012361031f36600461115e565b6000602081905290815260409020546001600160a01b031681565b34801561034657600080fd5b5061012361035536600461115e565b6001602052600090815260409020546001600160a01b031681565b6003546001600160a01b031633146103a35760405162461bcd60e51b815260040161039a90611219565b60405180910390fd5b600655565b6003546000906001600160a01b031633146103d55760405162461bcd60e51b815260040161039a90611219565b60008781526002602052604090205460ff161561042c5760405162461bcd60e51b81526020600482015260156024820152746273632074782066696c6c656420616c726561647960581b604482015260640161039a565b6001600160a01b0380871660009081526020819052604090205416806104945760405162461bcd60e51b815260206004820152601b60248201527f6e6f2073776170207061697220666f72207468697320746f6b656e0000000000604482015260640161039a565b600085116104e45760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e742073686f756c642062652067726561746572207468616e203000604482015260640161039a565b6040516340c10f1960e01b81526001600160a01b038781166004830152602482018790528216906340c10f1990604401600060405180830381600087803b15801561052e57600080fd5b505af1158015610542573d6000803e3d6000fd5b50505060008981526002602052604090819020805460ff19166001179055516001600160a01b0380891692508a91908416907f8eac1ad2f4b466e338a4198e29e27931e0f96470c72e793faa04bff794b27e9f906105a5908a908a908a90611277565b60405180910390a4506001979650505050505050565b6004546001600160a01b031633146105e55760405162461bcd60e51b815260040161039a9061129a565b6001600160a01b0381166106545760405162461bcd60e51b815260206004820152603060248201527f53757065722041646d696e3a206e65772073757065722061646d696e2069732060448201526f746865207a65726f206164647265737360801b606482015260840161039a565b6004546040516001600160a01b038084169216907f6a7fb6694616d75391385b86c21a1cc2628072753f9c7da9731e7b1b083a55e490600090a3600480546001600160a01b0319166001600160a01b0392909216919091179055565b6003546000906001600160a01b031633146106dd5760405162461bcd60e51b815260040161039a90611219565b6001600160a01b03838116600090815260208190526040902054161561073c5760405162461bcd60e51b8152602060048201526014602482015273323ab83634b1b0ba32b21039bbb0b8103830b4b960611b604482015260640161039a565b6001600160a01b0380841660008181526020818152604080832080549588166001600160a01b03199687168117909155808452600190925280832080549095168417909455925191929187917fdc78f0c3e5f70feecd229e98ab9506c76d747bf4e8628ae491fd143641fb8b4391a450805b9392505050565b6004546001600160a01b031633146107df5760405162461bcd60e51b815260040161039a9061129a565b6003546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600380546001600160a01b0319169055565b6004546001600160a01b031633146108535760405162461bcd60e51b815260040161039a9061129a565b6001600160a01b0381166108c15760405162461bcd60e51b815260206004820152602f60248201527f4665652052656365697665723a206e657720666565207265636569766572206160448201526e032323932b9b99034b9903d32b9379608d1b606482015260840161039a565b6005546040516001600160a01b038084169216907fa92ff4390fe6943f0b30e8fe715dde86f85ab79b2b2c640a10fc094cc4036cc890600090a3600580546001600160a01b0319166001600160a01b0392909216919091179055565b6000333b1561096e5760405162461bcd60e51b815260206004820152601f60248201527f636f6e7472616374206973206e6f7420616c6c6f77656420746f207377617000604482015260640161039a565b3332146109b35760405162461bcd60e51b81526020600482015260136024820152721b9bc81c1c9bde1e481a5cc8185b1b1bddd959606a1b604482015260640161039a565b6001600160a01b038086166000908152600160205260409020541680610a1b5760405162461bcd60e51b815260206004820152601b60248201527f6e6f2073776170207061697220666f72207468697320746f6b656e0000000000604482015260640161039a565b600654341015610a665760405162461bcd60e51b81526020600482015260166024820152750e6eec2e040cccaca40d2e640dcdee840cadcdeeaced60531b604482015260640161039a565b60008511610ab65760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e742073686f756c642062652067726561746572207468616e203000604482015260640161039a565b68056bc75e2d6310000060075410610ae05760405162461bcd60e51b815260040161039a906112e4565b60075460009015610b3957600754610af9908790610d95565b9050610b0e8168056bc75e2d63100000610da1565b9050610b1a8682610dad565b600554909650610b39906001600160a01b038981169133911684610db9565b3415610b7a576003546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015610b78573d6000803e3d6000fd5b505b610b8f6001600160a01b038816333089610db9565b604051630852cd8d60e31b8152600481018790526001600160a01b038816906342966c6890602401600060405180830381600087803b158015610bd157600080fd5b505af1158015610be5573d6000803e3d6000fd5b50505050336001600160a01b0316826001600160a01b0316886001600160a01b03167fec268b6a5d292537c63e1fa9a2a389fe2c3dc6817c3af2d5e80765d817c8ad398934868b8b604051610c3e95949392919061132d565b60405180910390a45060019695505050505050565b6003546001600160a01b03163314610c7d5760405162461bcd60e51b815260040161039a90611219565b68056bc75e2d631000008110610ca55760405162461bcd60e51b815260040161039a906112e4565b600755565b6004546001600160a01b03163314610cd45760405162461bcd60e51b815260040161039a9061129a565b6001600160a01b038116610d395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161039a565b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006107ae8284611369565b60006107ae8284611388565b60006107ae82846113aa565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610e13908590610e19565b50505050565b6000610e6e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610ef09092919063ffffffff16565b805190915015610eeb5780806020019051810190610e8c91906113c1565b610eeb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161039a565b505050565b6060610eff8484600085610f07565b949350505050565b606082471015610f685760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161039a565b843b610fb65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161039a565b600080866001600160a01b03168587604051610fd2919061140f565b60006040518083038185875af1925050503d806000811461100f576040519150601f19603f3d011682016040523d82523d6000602084013e611014565b606091505b509150915061102482828661102f565b979650505050505050565b6060831561103e5750816107ae565b82511561104e5782518084602001fd5b8160405162461bcd60e51b815260040161039a919061142b565b60006020828403121561107a57600080fd5b5035919050565b6001600160a01b038116811461109657600080fd5b50565b60008083601f8401126110ab57600080fd5b50813567ffffffffffffffff8111156110c357600080fd5b6020830191508360208285010111156110db57600080fd5b9250929050565b60008060008060008060a087890312156110fb57600080fd5b86359550602087013561110d81611081565b9450604087013561111d81611081565b935060608701359250608087013567ffffffffffffffff81111561114057600080fd5b61114c89828a01611099565b979a9699509497509295939492505050565b60006020828403121561117057600080fd5b81356107ae81611081565b60008060006060848603121561119057600080fd5b8335925060208401356111a281611081565b915060408401356111b281611081565b809150509250925092565b600080600080606085870312156111d357600080fd5b84356111de81611081565b935060208501359250604085013567ffffffffffffffff81111561120157600080fd5b61120d87828801611099565b95989497509550505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b83815260406020820152600061129160408301848661124e565b95945050505050565b6020808252602a908201527f53757065722041646d696e3a2063616c6c6572206973206e6f742074686520736040820152693ab832b91030b236b4b760b11b606082015260800190565b60208082526029908201527f66656550657263656e74616765496e53747265616d3a2047726561746572207460408201526868616e20313030202560b81b606082015260800190565b85815284602082015283604082015260806060820152600061102460808301848661124e565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561138357611383611353565b500290565b6000826113a557634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156113bc576113bc611353565b500390565b6000602082840312156113d357600080fd5b815180151581146107ae57600080fd5b60005b838110156113fe5781810151838201526020016113e6565b83811115610e135750506000910152565b600082516114218184602087016113e3565b9190910192915050565b602081526000825180602084015261144a8160408501602087016113e3565b601f01601f1916919091016040019291505056fea2646970667358221220e27e4a46170c1902a5648d03cbef73e715679df908f5ddc5f83c9f1f3a8ee8e064736f6c634300080b00330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000146faf5dacd5aa63cc2a4a81f07d01946b821500000000000000000000000047326ae17c5f4343322c558f38d294678e7e82f4
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000146faf5dacd5aa63cc2a4a81f07d01946b821500000000000000000000000047326ae17c5f4343322c558f38d294678e7e82f4
-----Decoded View---------------
Arg [0] : fee_Native (uint256): 0
Arg [1] : fee_PerStream (uint256): 0
Arg [2] : fee_Receiver (address): 0x00146faf5dacd5aa63cc2a4a81f07d01946b8215
Arg [3] : super_Admin (address): 0x47326ae17c5f4343322c558f38d294678e7e82f4
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 00000000000000000000000000146faf5dacd5aa63cc2a4a81f07d01946b8215
Arg [3] : 00000000000000000000000047326ae17c5f4343322c558f38d294678e7e82f4
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.