Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 961 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Call Sc | 23886877 | 3 hrs ago | IN | 0 ETH | 0.00005156 | ||||
| Call Sc | 23886872 | 3 hrs ago | IN | 0 ETH | 0.0000515 | ||||
| Deposit To Sc Ga... | 23886147 | 6 hrs ago | IN | 0 ETH | 0.00009391 | ||||
| Deposit To Sc Ga... | 23885861 | 7 hrs ago | IN | 0 ETH | 0.00000841 | ||||
| Call Sc | 23885846 | 7 hrs ago | IN | 0 ETH | 0.00000389 | ||||
| Call Sc | 23885827 | 7 hrs ago | IN | 0 ETH | 0.00000154 | ||||
| Call Sc | 23885762 | 7 hrs ago | IN | 0 ETH | 0.00000187 | ||||
| Call Sc | 23884243 | 12 hrs ago | IN | 0 ETH | 0.00005095 | ||||
| Deposit To Sc Ga... | 23881840 | 20 hrs ago | IN | 0 ETH | 0.00000556 | ||||
| Call Sc | 23879247 | 29 hrs ago | IN | 0 ETH | 0.0000141 | ||||
| Call Sc | 23878935 | 30 hrs ago | IN | 0 ETH | 0.00000503 | ||||
| Deposit To Sc Ga... | 23878604 | 31 hrs ago | IN | 0 ETH | 0.00009447 | ||||
| Call Sc | 23878477 | 32 hrs ago | IN | 0 ETH | 0.00000396 | ||||
| Call Sc | 23877302 | 36 hrs ago | IN | 0 ETH | 0.00005327 | ||||
| Deposit To Sc Ga... | 23877132 | 36 hrs ago | IN | 0 ETH | 0.00011349 | ||||
| Call Sc | 23875919 | 40 hrs ago | IN | 0 ETH | 0.00001254 | ||||
| Call Sc | 23875524 | 42 hrs ago | IN | 0 ETH | 0.00000216 | ||||
| Deposit To Sc Ga... | 23875519 | 42 hrs ago | IN | 0 ETH | 0.00000411 | ||||
| Deposit To Sc Ga... | 23874155 | 46 hrs ago | IN | 0 ETH | 0.00000386 | ||||
| Deposit To Sc Ga... | 23873997 | 47 hrs ago | IN | 0 ETH | 0.00000464 | ||||
| Deposit To Sc Ga... | 23872572 | 2 days ago | IN | 0 ETH | 0.00010554 | ||||
| Deposit To Sc Ga... | 23872530 | 2 days ago | IN | 0 ETH | 0.00010499 | ||||
| Call Sc | 23872328 | 2 days ago | IN | 0 ETH | 0.00001418 | ||||
| Call Sc | 23871667 | 2 days ago | IN | 0 ETH | 0.00005248 | ||||
| Call Sc | 23871195 | 2 days ago | IN | 0 ETH | 0.0000059 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ScUtils
Compiler Version
v0.8.20+commit.a1b79de6
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "Shared.sol";
import "IStateChainGateway.sol";
import "IScUtils.sol";
import "SafeERC20.sol";
/**
* @title State Chain Utils Contract
* @notice Contract that allows users to deposit assets into Chainflip contracts (Vault,
* State Chain Gateway or other) and perform arbitrary calls to the State Chain
* in a single transaction. The arbitrary call to the State Chain is a `bytes`
* parameter that will be interpreted by the State Chain.
* @dev There is a function for each contract (Vault, State Chain Gateway) to make
* the engine's witnessing and parsing of events easier and less prone to error.
* Also to guarantee that FLIP is transferred to the SCGateway contract.
* We emit both the msg.sender and tx.origin to give the maximum amount of
* flexibility to the State Chain to execute the call.
*/
contract ScUtils is Shared, IScUtils {
using SafeERC20 for IERC20;
// solhint-disable-next-line var-name-mixedcase
address public immutable SC_GATEWAY;
// solhint-disable-next-line var-name-mixedcase
address public immutable CF_VAULT;
// solhint-disable-next-line var-name-mixedcase
constructor(address _SC_GATEWAY, address _CF_VAULT) {
SC_GATEWAY = _SC_GATEWAY;
CF_VAULT = _CF_VAULT;
}
/**
* @notice Deposit an amount of FLIP to the State Chain Gateway contract and perform
* a call to the State Chain.
* @dev There is no minimum amount of FLIP required for the deposit. It would be
* arbitrary to hardcode one and updating it via governance key is unnecessary.
* It is simpler to just have a minimum on the engine, like for minimum deposit
* channel deposit amounts.
* @param amount Amount of FLIP to transfer to the State Chain Gateway contract.
* @param scCall Arbitrary State Chain call bytes
*/
function depositToScGateway(uint256 amount, bytes calldata scCall) public override {
address flip = _getFlip();
_depositFrom(amount, flip, SC_GATEWAY);
// solhint-disable-next-line avoid-tx-origin
emit DepositToScGatewayAndScCall(msg.sender, tx.origin, amount, scCall);
}
/**
* @notice Deposit an amount of any token or ETH to the Vault contract and perform
* a call to the State Chain.
* @param amount Amount to transfer to the State Chain Gateway contract.
* @param scCall Arbitrary State Chain call bytes
*/
function depositToVault(uint256 amount, address token, bytes calldata scCall) public payable override {
_depositFrom(amount, token, CF_VAULT);
// solhint-disable-next-line avoid-tx-origin
emit DepositToVaultAndScCall(msg.sender, tx.origin, amount, token, scCall);
}
/**
* @notice Deposit an amount of any token or ETH to the an address and perform
* a call to the State Chain.
* @dev To be used in the future if new features are added.
* @param amount Amount to transfer to the State Chain Gateway contract.
* @param scCall Arbitrary State Chain call bytes
*/
function depositTo(uint256 amount, address token, address to, bytes calldata scCall) public payable override {
_depositFrom(amount, token, to);
// solhint-disable-next-line avoid-tx-origin
emit DepositAndScCall(msg.sender, tx.origin, amount, token, to, scCall);
}
/**
* @notice Perform a call to the State Chain.
* @param scCall Arbitrary State Chain call bytes
*/
function callSc(bytes calldata scCall) public override {
// solhint-disable-next-line avoid-tx-origin
emit CallSc(msg.sender, tx.origin, scCall);
}
function _depositFrom(uint256 amount, address token, address to) private {
if (token != _NATIVE_ADDR) {
require(msg.value == 0, "ScUtils: value not zero");
// Assumption of set token allowance by the user
IERC20(token).safeTransferFrom(msg.sender, to, amount);
} else {
require(amount == msg.value, "ScUtils: value missmatch");
// solhint-disable-next-line avoid-low-level-calls
(bool success, ) = to.call{value: msg.value}("");
require(success);
}
}
/**
* @notice Receive a CCM swap from Chainflip and execute a deposit and SC Call.
* This can be useful to have a swap + delegation, swap + staking without
* having to add that logic into the SC.
* @dev Using address(0) when coming from a cross-chain swap as the tx.origin
* will be the Chainflip validator's key, which shouldn't be used.
* @param message Message containing the SC Call and the destination address to deposit
* the assets. This contract's address is used to signal that it
* should be used to fund a State Chain account.
* @param token Address of the token received. _NATIVE_ADDR if it's native tokens.
* @param amount Amount of tokens received. This will match msg.value for native tokens.
*/
function cfReceive(
uint32,
bytes calldata,
bytes calldata message,
address token,
uint256 amount
) external payable override onlyCfVault {
(address to, bytes memory data) = abi.decode(message, (address, bytes));
// Using `address(this)` as a way to signal that it's `fundStateChainAccount`
// so we don't need nested `abi.encode`.
if (to == address(this)) {
// Fund State Chain account
address flip = _getFlip();
require(token == flip, "ScUtils: token not FLIP");
require(IERC20(flip).approve(SC_GATEWAY, amount));
IStateChainGateway(SC_GATEWAY).fundStateChainAccount(bytes32(data), amount);
} else if (to == SC_GATEWAY) {
// Deposit to ScGateway
address flip = _getFlip();
require(token == flip, "ScUtils: token not FLIP");
_deposit(amount, flip, SC_GATEWAY);
emit DepositToScGatewayAndScCall(msg.sender, address(0), amount, data);
} else if (to == CF_VAULT) {
// Deposit to Vault
_deposit(amount, token, CF_VAULT);
emit DepositToVaultAndScCall(msg.sender, address(0), amount, token, data);
} else {
_deposit(amount, token, to);
emit DepositAndScCall(msg.sender, address(0), amount, token, to, data);
}
}
function _deposit(uint256 amount, address token, address to) private {
if (token != _NATIVE_ADDR) {
require(msg.value == 0, "ScUtils: value not zero");
IERC20(token).safeTransfer(to, amount);
} else {
require(amount == msg.value, "ScUtils: value missmatch");
// solhint-disable-next-line avoid-low-level-calls
(bool success, ) = to.call{value: msg.value}("");
require(success);
}
}
function _getFlip() private view returns (address) {
address flip = address(IStateChainGateway(SC_GATEWAY).getFLIP());
require(flip != address(0), "ScUtils: FLIP not set");
return flip;
}
/// @dev Check that the sender is the Chainflip's Vault.
modifier onlyCfVault() {
require(msg.sender == CF_VAULT, "ScUtils: caller not Cf Vault");
_;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IShared.sol";
/**
* @title Shared contract
* @notice Holds constants and modifiers that are used in multiple contracts
* @dev It would be nice if this could be a library, but modifiers can't be exported :(
*/
abstract contract Shared is IShared {
/// @dev The address used to indicate whether transfer should send native or a token
address internal constant _NATIVE_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address internal constant _ZERO_ADDR = address(0);
bytes32 internal constant _NULL = "";
uint256 internal constant _E_18 = 1e18;
/// @dev Checks that a uint isn't zero/empty
modifier nzUint(uint256 u) {
require(u != 0, "Shared: uint input is empty");
_;
}
/// @dev Checks that an address isn't zero/empty
modifier nzAddr(address a) {
require(a != _ZERO_ADDR, "Shared: address input is empty");
_;
}
/// @dev Checks that a bytes32 isn't zero/empty
modifier nzBytes32(bytes32 b) {
require(b != _NULL, "Shared: bytes32 input is empty");
_;
}
/// @dev Checks that the pubKeyX is populated
modifier nzKey(Key memory key) {
require(key.pubKeyX != 0, "Shared: pubKeyX is empty");
_;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IERC20.sol";
/**
* @title Shared interface
* @notice Holds structs needed by other interfaces
*/
interface IShared {
/**
* @dev SchnorrSECP256K1 requires that each key has a public key part (x coordinate),
* a parity for the y coordinate (0 if the y ordinate of the public key is even, 1
* if it's odd)
*/
struct Key {
uint256 pubKeyX;
uint8 pubKeyYParity;
}
/**
* @dev Contains a signature and the nonce used to create it. Also the recovered address
* to check that the signature is valid
*/
struct SigData {
uint256 sig;
uint256 nonce;
address kTimesGAddress;
}
/**
* @param token The address of the token to be transferred
* @param recipient The address of the recipient of the transfer
* @param amount The amount to transfer, in wei (uint)
*/
struct TransferParams {
address token;
address payable recipient;
uint256 amount;
}
/**
* @param swapID The unique identifier for this swap (bytes32), used for create2
* @param token The token to be transferred
*/
struct DeployFetchParams {
bytes32 swapID;
address token;
}
/**
* @param fetchContract The address of the deployed Deposit contract
* @param token The token to be transferred
*/
struct FetchParams {
address payable fetchContract;
address token;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
/**
* @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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IFLIP.sol";
import "IAggKeyNonceConsumer.sol";
import "IGovernanceCommunityGuarded.sol";
import "IFlipIssuer.sol";
/**
* @title StateChainGateway interface
*/
interface IStateChainGateway is IGovernanceCommunityGuarded, IFlipIssuer, IAggKeyNonceConsumer {
event Funded(bytes32 indexed nodeID, uint256 amount, address funder);
event RedemptionRegistered(
bytes32 indexed nodeID,
uint256 amount,
address indexed redeemAddress,
uint48 startTime,
uint48 expiryTime,
address executor
);
event RedemptionExecuted(bytes32 indexed nodeID, uint256 amount);
event RedemptionExpired(bytes32 indexed nodeID, uint256 amount);
event MinFundingChanged(uint256 oldMinFunding, uint256 newMinFunding);
event GovernanceWithdrawal(address to, uint256 amount);
event FLIPSet(address flip);
event FlipSupplyUpdated(uint256 oldSupply, uint256 newSupply, uint256 stateChainBlockNumber);
struct Redemption {
uint256 amount;
address redeemAddress;
// 48 so that 160 (from redeemAddress) + 48 + 48 is 256 they can all be packed
// into a single 256 bit slot
uint48 startTime;
uint48 expiryTime;
address executor;
}
/**
* @notice Sets the FLIP address after initialization. We can't do this in the constructor
* because FLIP contract requires this contract's address on deployment for minting.
* First this contract is deployed, then the FLIP contract and finally setFLIP
* should be called. OnlyDeployer modifer for added security since tokens will be
* minted to this contract before calling setFLIP.
* @param flip FLIP token address
*/
function setFlip(IFLIP flip) external;
/**
* @notice Add FLIP funds to a StateChain account identified with a nodeID
* @dev Requires the funder to have called `approve` in FLIP
* @param amount The amount of FLIP tokens
* @param nodeID The nodeID of the account to fund
*/
function fundStateChainAccount(bytes32 nodeID, uint256 amount) external;
/**
* @notice Redeem FLIP from the StateChain. The State Chain will determine the amount
* that can be redeemed, but a basic calculation for a validator would be:
* amount redeemable = stake + rewards - penalties.
* @param sigData Struct containing the signature data over the message
* to verify, signed by the aggregate key.
* @param nodeID The nodeID of the account redeeming the FLIP
* @param amount The amount of funds to be locked up
* @param redeemAddress The redeemAddress who will receive the FLIP
* @param expiryTime The last valid timestamp that can execute this redemption (uint48)
*/
function registerRedemption(
SigData calldata sigData,
bytes32 nodeID,
uint256 amount,
address redeemAddress,
uint48 expiryTime,
address executor
) external;
/**
* @notice Execute a pending redemption to get back funds. Cannot execute a pending
* redemption before 48h have passed after registering it, or after the specified
* expiry time
* @dev No need for nzUint(nodeID) since that is handled by `redemption.expiryTime > 0`
* @param nodeID The nodeID of the account redeeming the FLIP
* @return The address that received the FLIP and the amount
*/
function executeRedemption(bytes32 nodeID) external returns (address, uint256);
/**
* @notice Compares a given new FLIP supply against the old supply and mints or burns
* FLIP tokens from this contract as appropriate.
* It requires a message signed by the aggregate key.
* @param sigData Struct containing the signature data over the message
* to verify, signed by the aggregate key.
* @param newTotalSupply new total supply of FLIP
* @param stateChainBlockNumber State Chain block number for the new total supply
*/
function updateFlipSupply(SigData calldata sigData, uint256 newTotalSupply, uint256 stateChainBlockNumber) external;
/**
* @notice Updates the address that is allowed to issue FLIP tokens. This will be used when this
* contract needs an upgrade. A new contract will be deployed and all the FLIP will be
* transferred to it via the redemption process. Finally the right to issue FLIP will be transferred.
* @param sigData Struct containing the signature data over the message
* to verify, signed by the aggregate key.
* @param newIssuer New contract that will issue FLIP tokens.
* @param omitChecks Allow the omission of the extra checks in a special case
*/
function updateFlipIssuer(SigData calldata sigData, address newIssuer, bool omitChecks) external;
/**
* @notice Set the minimum amount of funds needed for `fundStateChainAccount` to be able
* to be called. Used to prevent spamming of funding.
* @param newMinFunding The new minimum funding amount
*/
function setMinFunding(uint256 newMinFunding) external;
/**
* @notice Withdraw all FLIP to governance address in case of emergency. This withdrawal needs
* to be approved by the Community, it is a last resort. Used to rectify an emergency.
* The governance address is also updated as the issuer of FLIP.
*/
function govWithdraw() external;
/**
* @notice Update the FLIP Issuer address with the governance address in case of emergency.
* This needs to be approved by the Community, it is a last resort. Used to rectify
* an emergency.
*/
function govUpdateFlipIssuer() external;
//////////////////////////////////////////////////////////////
// //
// Non-state-changing functions //
// //
//////////////////////////////////////////////////////////////
/**
* @notice Get the minimum amount of funds that's required for funding
* an account on the StateChain.
* @return The minimum amount (uint)
*/
function getMinimumFunding() external view returns (uint256);
/**
* @notice Get the pending redemption for the input nodeID. If there was never
* a pending redemption for this nodeID, or it has already been executed
* (and therefore deleted), it'll return (0, 0x00..., 0, 0)
* @param nodeID The nodeID which has a pending redemption
* @return The redemption (Redemption struct)
*/
function getPendingRedemption(bytes32 nodeID) external view returns (Redemption memory);
/**
* @notice Get the last state chain block number that the supply was updated at
* @return The state chain block number of the last update
*/
function getLastSupplyUpdateBlockNumber() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IERC20.sol";
/**
* @title FLIP interface for the FLIP utility token
*/
interface IFLIP is IERC20 {
event IssuerUpdated(address oldIssuer, address newIssuer);
//////////////////////////////////////////////////////////////
// //
// State-changing functions //
// //
//////////////////////////////////////////////////////////////
function mint(address account, uint amount) external;
function burn(address account, uint amount) external;
function updateIssuer(address newIssuer) external;
//////////////////////////////////////////////////////////////
// //
// Non-state-changing functions //
// //
//////////////////////////////////////////////////////////////
function getIssuer() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IShared.sol";
import "IKeyManager.sol";
/**
* @title AggKeyNonceConsumer interface
*/
interface IAggKeyNonceConsumer is IShared {
event UpdatedKeyManager(address keyManager);
//////////////////////////////////////////////////////////////
// //
// State-changing functions //
// //
//////////////////////////////////////////////////////////////
/**
* @notice Update KeyManager reference. Used if KeyManager contract is updated
* @param sigData Struct containing the signature data over the message
* to verify, signed by the aggregate key.
* @param keyManager New KeyManager's address
* @param omitChecks Allow the omission of the extra checks in a special case
*/
function updateKeyManager(SigData calldata sigData, IKeyManager keyManager, bool omitChecks) external;
//////////////////////////////////////////////////////////////
// //
// Getters //
// //
//////////////////////////////////////////////////////////////
/**
* @notice Get the KeyManager address/interface that's used to validate sigs
* @return The KeyManager (IKeyManager)
*/
function getKeyManager() external view returns (IKeyManager);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IShared.sol";
/**
* @title KeyManager interface
* @notice The interface for functions KeyManager implements
*/
interface IKeyManager is IShared {
event AggKeySetByAggKey(Key oldAggKey, Key newAggKey);
event AggKeySetByGovKey(Key oldAggKey, Key newAggKey);
event GovKeySetByAggKey(address oldGovKey, address newGovKey);
event GovKeySetByGovKey(address oldGovKey, address newGovKey);
event CommKeySetByAggKey(address oldCommKey, address newCommKey);
event CommKeySetByCommKey(address oldCommKey, address newCommKey);
event SignatureAccepted(SigData sigData, address signer);
event GovernanceAction(bytes32 message);
//////////////////////////////////////////////////////////////
// //
// State-changing functions //
// //
//////////////////////////////////////////////////////////////
function consumeKeyNonce(SigData memory sigData, bytes32 contractMsgHash) external;
function setAggKeyWithAggKey(SigData memory sigData, Key memory newAggKey) external;
function setAggKeyWithGovKey(Key memory newAggKey) external;
function setGovKeyWithAggKey(SigData calldata sigData, address newGovKey) external;
function setGovKeyWithGovKey(address newGovKey) external;
function setCommKeyWithAggKey(SigData calldata sigData, address newCommKey) external;
function setCommKeyWithCommKey(address newCommKey) external;
function govAction(bytes32 message) external;
//////////////////////////////////////////////////////////////
// //
// Non-state-changing functions //
// //
//////////////////////////////////////////////////////////////
function getAggregateKey() external view returns (Key memory);
function getGovernanceKey() external view returns (address);
function getCommunityKey() external view returns (address);
function isNonceUsedByAggKey(uint256 nonce) external view returns (bool);
function getLastValidateTime() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IShared.sol";
/**
* @title GovernanceCommunityGuarded interface
*/
interface IGovernanceCommunityGuarded is IShared {
event CommunityGuardDisabled(bool communityGuardDisabled);
event Suspended(bool suspended);
//////////////////////////////////////////////////////////////
// //
// State-changing functions //
// //
//////////////////////////////////////////////////////////////
/**
* @notice Enable Community Guard
*/
function enableCommunityGuard() external;
/**
* @notice Disable Community Guard
*/
function disableCommunityGuard() external;
/**
* @notice Can be used to suspend contract execution - only executable by
* governance and only to be used in case of emergency.
*/
function suspend() external;
/**
* @notice Resume contract execution
*/
function resume() external;
//////////////////////////////////////////////////////////////
// //
// Getters //
// //
//////////////////////////////////////////////////////////////
/**
* @notice Get the Community Key
* @return The CommunityKey
*/
function getCommunityKey() external view returns (address);
/**
* @notice Get the Community Guard state
* @return The Community Guard state
*/
function getCommunityGuardDisabled() external view returns (bool);
/**
* @notice Get suspended state
* @return The suspended state
*/
function getSuspendedState() external view returns (bool);
/**
* @notice Get governor address
* @return The governor address
*/
function getGovernor() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "IFLIP.sol";
/**
* @title Flip Issuer interface
* @notice This interface is required when updating the FLIP issuer.
* Additionally, any contract inheriting this should implement the
* mint and burn capabilities to interact with the FLIP contract.
*/
interface IFlipIssuer {
/**
* @notice Get the FLIP token address
* @return The address of FLIP
*/
function getFLIP() external view returns (IFLIP);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IScUtils {
event DepositToScGatewayAndScCall(address sender, address signer, uint256 amount, bytes scCall);
event DepositToVaultAndScCall(address sender, address signer, uint256 amount, address token, bytes scCall);
event DepositAndScCall(address sender, address signer, uint256 amount, address token, address to, bytes scCall);
event CallSc(address sender, address signer, bytes scCall);
function depositToScGateway(uint256 amount, bytes calldata scCall) external;
function depositToVault(uint256 amount, address token, bytes calldata scCall) external payable;
function depositTo(uint256 amount, address token, address to, bytes calldata scCall) external payable;
function callSc(bytes calldata scCall) external;
function cfReceive(uint32, bytes calldata, bytes calldata message, address token, uint256 amount) external payable;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "IERC20.sol";
import "draft-IERC20Permit.sol";
import "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));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @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/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @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
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}{
"evmVersion": "paris",
"optimizer": {
"enabled": true,
"runs": 800
},
"libraries": {
"ScUtils.sol": {}
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_SC_GATEWAY","type":"address"},{"internalType":"address","name":"_CF_VAULT","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"bytes","name":"scCall","type":"bytes"}],"name":"CallSc","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes","name":"scCall","type":"bytes"}],"name":"DepositAndScCall","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"scCall","type":"bytes"}],"name":"DepositToScGatewayAndScCall","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"bytes","name":"scCall","type":"bytes"}],"name":"DepositToVaultAndScCall","type":"event"},{"inputs":[],"name":"CF_VAULT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SC_GATEWAY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"scCall","type":"bytes"}],"name":"callSc","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"cfReceive","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"scCall","type":"bytes"}],"name":"depositTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"scCall","type":"bytes"}],"name":"depositToScGateway","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"bytes","name":"scCall","type":"bytes"}],"name":"depositToVault","outputs":[],"stateMutability":"payable","type":"function"}]Contract Creation Code
60c060405234801561001057600080fd5b5060405161147838038061147883398101604081905261002f91610062565b6001600160a01b039182166080521660a052610095565b80516001600160a01b038116811461005d57600080fd5b919050565b6000806040838503121561007557600080fd5b61007e83610046565b915061008c60208401610046565b90509250929050565b60805160a05161137a6100fe6000396000818160ff015281816101d4015281816105210152818161055f0152610669015260008181609c015281816102ee0152818161037d0152818161040c015281816104b7015281816106e70152610888015261137a6000f3fe6080604052600436106100705760003560e01c80635438cf091161004e5780635438cf09146100ed5780636305eaf7146101215780638410776f14610141578063bbbfd2311461015457600080fd5b8063052ced801461007557806311fc17951461008a5780634904ac5f146100da575b600080fd5b610088610083366004610da0565b610174565b005b34801561009657600080fd5b506100be7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100886100e8366004610e13565b6101c9565b3480156100f957600080fd5b506100be7f000000000000000000000000000000000000000000000000000000000000000081565b34801561012d57600080fd5b5061008861013c366004610ebc565b610621565b61008861014f366004610efe565b610662565b34801561016057600080fd5b5061008861016f366004610f5a565b6106d4565b61017f858585610742565b7f3f79507b9eef505bb4007604f01ed0909a7e455b0e4bdc47ff457d9fcadd2652333287878787876040516101ba9796959493929190610fcf565b60405180910390a15050505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146102465760405162461bcd60e51b815260206004820152601c60248201527f53635574696c733a2063616c6c6572206e6f74204366205661756c740000000060448201526064015b60405180910390fd5b60008061025585870187611035565b9092509050306001600160a01b0383160361040a576000610274610883565b9050806001600160a01b0316856001600160a01b0316146102d75760405162461bcd60e51b815260206004820152601760248201527f53635574696c733a20746f6b656e206e6f7420464c4950000000000000000000604482015260640161023d565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301526024820186905282169063095ea7b3906044016020604051808303816000875af1158015610346573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036a91906110f9565b61037357600080fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016636055409b6103ab84611122565b866040518363ffffffff1660e01b81526004016103d2929190918252602082015260400190565b600060405180830381600087803b1580156103ec57600080fd5b505af1158015610400573d6000803e3d6000fd5b5050505050610616565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361051f57600061044d610883565b9050806001600160a01b0316856001600160a01b0316146104b05760405162461bcd60e51b815260206004820152601760248201527f53635574696c733a20746f6b656e206e6f7420464c4950000000000000000000604482015260640161023d565b6104db84827f0000000000000000000000000000000000000000000000000000000000000000610965565b7f40a5faa64eff632bf7ddf015e8d65cbf9faab2112f4eb0d8bce4db1fb46207d233600086856040516105119493929190611199565b60405180910390a150610616565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316036105c85761058383857f0000000000000000000000000000000000000000000000000000000000000000610965565b7f0f2f6e6461d611b90673bdc0271a9fefc1e8320ec6a340d627f8de773077d0863360008587856040516105bb9594939291906111d5565b60405180910390a1610616565b6105d3838584610965565b7f3f79507b9eef505bb4007604f01ed0909a7e455b0e4bdc47ff457d9fcadd26523360008587868660405161060d9695949392919061120f565b60405180910390a15b505050505050505050565b7fa541342047f1e37635c73b84b6eb4cb344ff4e2005e558ca8eaacef87a3122ea33328484604051610656949392919061125d565b60405180910390a15050565b61068d84847f0000000000000000000000000000000000000000000000000000000000000000610742565b7f0f2f6e6461d611b90673bdc0271a9fefc1e8320ec6a340d627f8de773077d0863332868686866040516106c69695949392919061128a565b60405180910390a150505050565b60006106de610883565b905061070b84827f0000000000000000000000000000000000000000000000000000000000000000610742565b7f40a5faa64eff632bf7ddf015e8d65cbf9faab2112f4eb0d8bce4db1fb46207d233328686866040516106c69594939291906112c5565b6001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146107ce5734156107b45760405162461bcd60e51b815260206004820152601760248201527f53635574696c733a2076616c7565206e6f74207a65726f000000000000000000604482015260640161023d565b6107c96001600160a01b0383163383866109eb565b505050565b34831461081d5760405162461bcd60e51b815260206004820152601860248201527f53635574696c733a2076616c7565206d6973736d617463680000000000000000604482015260640161023d565b6000816001600160a01b03163460405160006040518083038185875af1925050503d806000811461086a576040519150601f19603f3d011682016040523d82523d6000602084013e61086f565b606091505b505090508061087d57600080fd5b50505050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631ae8299c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090891906112f8565b90506001600160a01b0381166109605760405162461bcd60e51b815260206004820152601560248201527f53635574696c733a20464c4950206e6f74207365740000000000000000000000604482015260640161023d565b919050565b6001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146107ce5734156109d75760405162461bcd60e51b815260206004820152601760248201527f53635574696c733a2076616c7565206e6f74207a65726f000000000000000000604482015260640161023d565b6107c96001600160a01b0383168285610a83565b6040516001600160a01b038085166024830152831660448201526064810182905261087d9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610ab3565b6040516001600160a01b0383166024820152604481018290526107c990849063a9059cbb60e01b90606401610a1f565b6000610b08826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610b989092919063ffffffff16565b8051909150156107c95780806020019051810190610b2691906110f9565b6107c95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161023d565b6060610ba78484600085610baf565b949350505050565b606082471015610c275760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161023d565b600080866001600160a01b03168587604051610c439190611315565b60006040518083038185875af1925050503d8060008114610c80576040519150601f19603f3d011682016040523d82523d6000602084013e610c85565b606091505b5091509150610c9687838387610ca1565b979650505050505050565b60608315610d10578251600003610d09576001600160a01b0385163b610d095760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161023d565b5081610ba7565b610ba78383815115610d255781518083602001fd5b8060405162461bcd60e51b815260040161023d9190611331565b6001600160a01b0381168114610d5457600080fd5b50565b60008083601f840112610d6957600080fd5b50813567ffffffffffffffff811115610d8157600080fd5b602083019150836020828501011115610d9957600080fd5b9250929050565b600080600080600060808688031215610db857600080fd5b853594506020860135610dca81610d3f565b93506040860135610dda81610d3f565b9250606086013567ffffffffffffffff811115610df657600080fd5b610e0288828901610d57565b969995985093965092949392505050565b600080600080600080600060a0888a031215610e2e57600080fd5b873563ffffffff81168114610e4257600080fd5b9650602088013567ffffffffffffffff80821115610e5f57600080fd5b610e6b8b838c01610d57565b909850965060408a0135915080821115610e8457600080fd5b50610e918a828b01610d57565b9095509350506060880135610ea581610d3f565b809250506080880135905092959891949750929550565b60008060208385031215610ecf57600080fd5b823567ffffffffffffffff811115610ee657600080fd5b610ef285828601610d57565b90969095509350505050565b60008060008060608587031215610f1457600080fd5b843593506020850135610f2681610d3f565b9250604085013567ffffffffffffffff811115610f4257600080fd5b610f4e87828801610d57565b95989497509550505050565b600080600060408486031215610f6f57600080fd5b83359250602084013567ffffffffffffffff811115610f8d57600080fd5b610f9986828701610d57565b9497909650939450505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b03808a1683528089166020840152876040840152808716606084015280861660808401525060c060a083015261101260c083018486610fa6565b9998505050505050505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561104857600080fd5b823561105381610d3f565b9150602083013567ffffffffffffffff8082111561107057600080fd5b818501915085601f83011261108457600080fd5b8135818111156110965761109661101f565b604051601f8201601f19908116603f011681019083821181831017156110be576110be61101f565b816040528281528860208487010111156110d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561110b57600080fd5b8151801515811461111b57600080fd5b9392505050565b80516020808301519190811015611143576000198160200360031b1b821691505b50919050565b60005b8381101561116457818101518382015260200161114c565b50506000910152565b60008151808452611185816020860160208601611149565b601f01601f19169290920160200192915050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526111cb608083018461116d565b9695505050505050565b60006001600160a01b038088168352808716602084015285604084015280851660608401525060a06080830152610c9660a083018461116d565b60006001600160a01b0380891683528088166020840152866040840152808616606084015280851660808401525060c060a083015261125160c083018461116d565b98975050505050505050565b60006001600160a01b038087168352808616602084015250606060408301526111cb606083018486610fa6565b60006001600160a01b038089168352808816602084015286604084015280861660608401525060a0608083015261125160a083018486610fa6565b60006001600160a01b03808816835280871660208401525084604083015260806060830152610c96608083018486610fa6565b60006020828403121561130a57600080fd5b815161111b81610d3f565b60008251611327818460208701611149565b9190910192915050565b60208152600061111b602083018461116d56fea2646970667358221220ebf886a22e92b6f86405be2aab56ba5341280e52280d0a13b43d28657456b81e64736f6c634300081400330000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd000000000000000000000000f5e10380213880111522dd0efd3dbb45b9f62bcc
Deployed Bytecode
0x6080604052600436106100705760003560e01c80635438cf091161004e5780635438cf09146100ed5780636305eaf7146101215780638410776f14610141578063bbbfd2311461015457600080fd5b8063052ced801461007557806311fc17951461008a5780634904ac5f146100da575b600080fd5b610088610083366004610da0565b610174565b005b34801561009657600080fd5b506100be7f0000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd81565b6040516001600160a01b03909116815260200160405180910390f35b6100886100e8366004610e13565b6101c9565b3480156100f957600080fd5b506100be7f000000000000000000000000f5e10380213880111522dd0efd3dbb45b9f62bcc81565b34801561012d57600080fd5b5061008861013c366004610ebc565b610621565b61008861014f366004610efe565b610662565b34801561016057600080fd5b5061008861016f366004610f5a565b6106d4565b61017f858585610742565b7f3f79507b9eef505bb4007604f01ed0909a7e455b0e4bdc47ff457d9fcadd2652333287878787876040516101ba9796959493929190610fcf565b60405180910390a15050505050565b336001600160a01b037f000000000000000000000000f5e10380213880111522dd0efd3dbb45b9f62bcc16146102465760405162461bcd60e51b815260206004820152601c60248201527f53635574696c733a2063616c6c6572206e6f74204366205661756c740000000060448201526064015b60405180910390fd5b60008061025585870187611035565b9092509050306001600160a01b0383160361040a576000610274610883565b9050806001600160a01b0316856001600160a01b0316146102d75760405162461bcd60e51b815260206004820152601760248201527f53635574696c733a20746f6b656e206e6f7420464c4950000000000000000000604482015260640161023d565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd811660048301526024820186905282169063095ea7b3906044016020604051808303816000875af1158015610346573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036a91906110f9565b61037357600080fd5b6001600160a01b037f0000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd16636055409b6103ab84611122565b866040518363ffffffff1660e01b81526004016103d2929190918252602082015260400190565b600060405180830381600087803b1580156103ec57600080fd5b505af1158015610400573d6000803e3d6000fd5b5050505050610616565b7f0000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd6001600160a01b0316826001600160a01b03160361051f57600061044d610883565b9050806001600160a01b0316856001600160a01b0316146104b05760405162461bcd60e51b815260206004820152601760248201527f53635574696c733a20746f6b656e206e6f7420464c4950000000000000000000604482015260640161023d565b6104db84827f0000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd610965565b7f40a5faa64eff632bf7ddf015e8d65cbf9faab2112f4eb0d8bce4db1fb46207d233600086856040516105119493929190611199565b60405180910390a150610616565b7f000000000000000000000000f5e10380213880111522dd0efd3dbb45b9f62bcc6001600160a01b0316826001600160a01b0316036105c85761058383857f000000000000000000000000f5e10380213880111522dd0efd3dbb45b9f62bcc610965565b7f0f2f6e6461d611b90673bdc0271a9fefc1e8320ec6a340d627f8de773077d0863360008587856040516105bb9594939291906111d5565b60405180910390a1610616565b6105d3838584610965565b7f3f79507b9eef505bb4007604f01ed0909a7e455b0e4bdc47ff457d9fcadd26523360008587868660405161060d9695949392919061120f565b60405180910390a15b505050505050505050565b7fa541342047f1e37635c73b84b6eb4cb344ff4e2005e558ca8eaacef87a3122ea33328484604051610656949392919061125d565b60405180910390a15050565b61068d84847f000000000000000000000000f5e10380213880111522dd0efd3dbb45b9f62bcc610742565b7f0f2f6e6461d611b90673bdc0271a9fefc1e8320ec6a340d627f8de773077d0863332868686866040516106c69695949392919061128a565b60405180910390a150505050565b60006106de610883565b905061070b84827f0000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd610742565b7f40a5faa64eff632bf7ddf015e8d65cbf9faab2112f4eb0d8bce4db1fb46207d233328686866040516106c69594939291906112c5565b6001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146107ce5734156107b45760405162461bcd60e51b815260206004820152601760248201527f53635574696c733a2076616c7565206e6f74207a65726f000000000000000000604482015260640161023d565b6107c96001600160a01b0383163383866109eb565b505050565b34831461081d5760405162461bcd60e51b815260206004820152601860248201527f53635574696c733a2076616c7565206d6973736d617463680000000000000000604482015260640161023d565b6000816001600160a01b03163460405160006040518083038185875af1925050503d806000811461086a576040519150601f19603f3d011682016040523d82523d6000602084013e61086f565b606091505b505090508061087d57600080fd5b50505050565b6000807f0000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd6001600160a01b0316631ae8299c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090891906112f8565b90506001600160a01b0381166109605760405162461bcd60e51b815260206004820152601560248201527f53635574696c733a20464c4950206e6f74207365740000000000000000000000604482015260640161023d565b919050565b6001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146107ce5734156109d75760405162461bcd60e51b815260206004820152601760248201527f53635574696c733a2076616c7565206e6f74207a65726f000000000000000000604482015260640161023d565b6107c96001600160a01b0383168285610a83565b6040516001600160a01b038085166024830152831660448201526064810182905261087d9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152610ab3565b6040516001600160a01b0383166024820152604481018290526107c990849063a9059cbb60e01b90606401610a1f565b6000610b08826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610b989092919063ffffffff16565b8051909150156107c95780806020019051810190610b2691906110f9565b6107c95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161023d565b6060610ba78484600085610baf565b949350505050565b606082471015610c275760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161023d565b600080866001600160a01b03168587604051610c439190611315565b60006040518083038185875af1925050503d8060008114610c80576040519150601f19603f3d011682016040523d82523d6000602084013e610c85565b606091505b5091509150610c9687838387610ca1565b979650505050505050565b60608315610d10578251600003610d09576001600160a01b0385163b610d095760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161023d565b5081610ba7565b610ba78383815115610d255781518083602001fd5b8060405162461bcd60e51b815260040161023d9190611331565b6001600160a01b0381168114610d5457600080fd5b50565b60008083601f840112610d6957600080fd5b50813567ffffffffffffffff811115610d8157600080fd5b602083019150836020828501011115610d9957600080fd5b9250929050565b600080600080600060808688031215610db857600080fd5b853594506020860135610dca81610d3f565b93506040860135610dda81610d3f565b9250606086013567ffffffffffffffff811115610df657600080fd5b610e0288828901610d57565b969995985093965092949392505050565b600080600080600080600060a0888a031215610e2e57600080fd5b873563ffffffff81168114610e4257600080fd5b9650602088013567ffffffffffffffff80821115610e5f57600080fd5b610e6b8b838c01610d57565b909850965060408a0135915080821115610e8457600080fd5b50610e918a828b01610d57565b9095509350506060880135610ea581610d3f565b809250506080880135905092959891949750929550565b60008060208385031215610ecf57600080fd5b823567ffffffffffffffff811115610ee657600080fd5b610ef285828601610d57565b90969095509350505050565b60008060008060608587031215610f1457600080fd5b843593506020850135610f2681610d3f565b9250604085013567ffffffffffffffff811115610f4257600080fd5b610f4e87828801610d57565b95989497509550505050565b600080600060408486031215610f6f57600080fd5b83359250602084013567ffffffffffffffff811115610f8d57600080fd5b610f9986828701610d57565b9497909650939450505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006001600160a01b03808a1683528089166020840152876040840152808716606084015280861660808401525060c060a083015261101260c083018486610fa6565b9998505050505050505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561104857600080fd5b823561105381610d3f565b9150602083013567ffffffffffffffff8082111561107057600080fd5b818501915085601f83011261108457600080fd5b8135818111156110965761109661101f565b604051601f8201601f19908116603f011681019083821181831017156110be576110be61101f565b816040528281528860208487010111156110d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561110b57600080fd5b8151801515811461111b57600080fd5b9392505050565b80516020808301519190811015611143576000198160200360031b1b821691505b50919050565b60005b8381101561116457818101518382015260200161114c565b50506000910152565b60008151808452611185816020860160208601611149565b601f01601f19169290920160200192915050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526111cb608083018461116d565b9695505050505050565b60006001600160a01b038088168352808716602084015285604084015280851660608401525060a06080830152610c9660a083018461116d565b60006001600160a01b0380891683528088166020840152866040840152808616606084015280851660808401525060c060a083015261125160c083018461116d565b98975050505050505050565b60006001600160a01b038087168352808616602084015250606060408301526111cb606083018486610fa6565b60006001600160a01b038089168352808816602084015286604084015280861660608401525060a0608083015261125160a083018486610fa6565b60006001600160a01b03808816835280871660208401525084604083015260806060830152610c96608083018486610fa6565b60006020828403121561130a57600080fd5b815161111b81610d3f565b60008251611327818460208701611149565b9190910192915050565b60208152600061111b602083018461116d56fea2646970667358221220ebf886a22e92b6f86405be2aab56ba5341280e52280d0a13b43d28657456b81e64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd000000000000000000000000f5e10380213880111522dd0efd3dbb45b9f62bcc
-----Decoded View---------------
Arg [0] : _SC_GATEWAY (address): 0x6995Ab7c4D7F4B03f467Cf4c8E920427d9621DBd
Arg [1] : _CF_VAULT (address): 0xF5e10380213880111522dd0efD3dbb45b9f62Bcc
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000006995ab7c4d7f4b03f467cf4c8e920427d9621dbd
Arg [1] : 000000000000000000000000f5e10380213880111522dd0efd3dbb45b9f62bcc
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.