@etherspot/contracts
Version:
Etherspot Solidity contracts
255 lines • 73.3 kB
JSON
{
"address": "0x9d70f5253949Eb67850C3f1e7371f15b955ee073",
"abi": [
{
"inputs": [],
"name": "CBSlippageTooLow",
"type": "error"
},
{
"inputs": [],
"name": "CannotBridgeToSameNetwork",
"type": "error"
},
{
"inputs": [],
"name": "InvalidAmount",
"type": "error"
},
{
"inputs": [],
"name": "ReentrancyError",
"type": "error"
},
{
"inputs": [],
"name": "TokenAddressIsZero",
"type": "error"
},
{
"inputs": [],
"name": "ZeroAddressProvided",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "cBridge",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "chainId",
"type": "uint256"
}
],
"name": "CBInitialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "string",
"name": "bridgeUsed",
"type": "string"
},
{
"indexed": false,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "qty",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "chainIdTo",
"type": "uint256"
}
],
"name": "CBTransferStarted",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "newAddress",
"type": "address"
}
],
"name": "CBUpdatedBridge",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "newSlippage",
"type": "uint256"
}
],
"name": "CBUpdatedSlippageTolerance",
"type": "event"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint64",
"name": "dstChainId",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "nonce",
"type": "uint64"
},
{
"internalType": "uint256",
"name": "qty",
"type": "uint256"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"internalType": "struct CBridgeFacet.CBridgeData",
"name": "_cbData",
"type": "tuple"
}
],
"name": "cbBridgeTokens",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_cbBridge",
"type": "address"
}
],
"name": "cbInitialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_newAddress",
"type": "address"
}
],
"name": "cbUpdateBridge",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint32",
"name": "_newSlippage",
"type": "uint32"
}
],
"name": "cbUpdateSlippageTolerance",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x6b2f2dfd2f724949422b80464b10ad71fd064efe6bafbdefb2d26e464d6a388e",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0x326b2D4f29E19C7089D038EA5E06f090Afa6FB7f",
"contractAddress": null,
"transactionIndex": 1,
"gasUsed": "1247338",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x8fd699faeb1893249cd2484a60f095176e5ff67c0e2e961240e70fd6fed78535",
"transactionHash": "0x6b2f2dfd2f724949422b80464b10ad71fd064efe6bafbdefb2d26e464d6a388e",
"logs": [],
"blockNumber": 156717,
"cumulativeGasUsed": "1247338",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "8d42885a5f19da22f710ffc8b637c191",
"metadata": "{\"compiler\":{\"version\":\"0.8.4+commit.c7e474f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"CBSlippageTooLow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotBridgeToSameNetwork\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrancyError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenAddressIsZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressProvided\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"cBridge\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"CBInitialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"bridgeUsed\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"qty\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainIdTo\",\"type\":\"uint256\"}],\"name\":\"CBTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"CBUpdatedBridge\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newSlippage\",\"type\":\"uint256\"}],\"name\":\"CBUpdatedSlippageTolerance\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"dstChainId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"qty\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"internalType\":\"struct CBridgeFacet.CBridgeData\",\"name\":\"_cbData\",\"type\":\"tuple\"}],\"name\":\"cbBridgeTokens\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_cbBridge\",\"type\":\"address\"}],\"name\":\"cbInitialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newAddress\",\"type\":\"address\"}],\"name\":\"cbUpdateBridge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_newSlippage\",\"type\":\"uint32\"}],\"name\":\"cbUpdateSlippageTolerance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"cbBridgeTokens((uint64,uint64,uint256,address,address))\":{\"params\":{\"_cbData\":\": provides necessary data for cBridge transfer\"}},\"cbInitialize(address)\":{\"params\":{\"_cbBridge\":\"address of the CBridge router contract\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"cbBridgeTokens((uint64,uint64,uint256,address,address))\":{\"notice\":\"initiates token bridging\"},\"cbInitialize(address)\":{\"notice\":\"initializes state variables for the cBridge facet\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/bridges/facets/CBridgeFacet.sol\":\"CBridgeFacet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"src/bridges/errors/CBridgeErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable-next-line\\npragma solidity 0.8.4;\\n\\nerror CBSlippageTooLow();\\n\",\"keccak256\":\"0x03cb94f117b0cca4864a126a41add3f939b7ec3ca8e398eb901c78788a7176c8\",\"license\":\"MIT\"},\"src/bridges/errors/GenericErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable-next-line\\npragma solidity 0.8.4;\\n\\nerror InvalidAmount();\\nerror TokenAddressIsZero();\\nerror CannotBridgeToSameNetwork();\\nerror ZeroPostSwapBalance();\\nerror InvalidBridgeConfigLength();\\nerror NoSwapDataProvided();\\nerror NativeValueWithERC();\\nerror ContractCallNotAllowed();\\nerror NullAddrIsNotAValidSpender();\\nerror NullAddrIsNotAnERC20Token();\\nerror NoTransferToNullAddress();\\nerror NativeAssetTransferFailed();\\nerror InvalidContract();\\nerror InvalidConfig();\\nerror ZeroAddressProvided();\\n\",\"keccak256\":\"0x8fbb39c8e0b8f0ed9b37b799fec0e47bbd9f209c290a8dd290e44241dedaceda\",\"license\":\"MIT\"},\"src/bridges/facets/CBridgeFacet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable-next-line\\npragma solidity 0.8.4;\\n\\n/// @title CBridgeFacet\\n/// @author Luke Wickens <luke@pillarproject.io>\\n/// @notice cBridge intergration for bridging tokens\\n\\nimport {ICBridge} from \\\"../interfaces/ICBridge.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {ReentrancyGuard} from \\\"../../common/helpers/DiamondReentrancyGuard.sol\\\";\\nimport {CannotBridgeToSameNetwork, InvalidAmount, InvalidConfig, TokenAddressIsZero, ZeroAddressProvided} from \\\"../errors/GenericErrors.sol\\\";\\nimport {CBSlippageTooLow} from \\\"../errors/CBridgeErrors.sol\\\";\\nimport {LibDiamond} from \\\"../libs/LibDiamond.sol\\\";\\n\\ncontract CBridgeFacet is ReentrancyGuard {\\n using SafeERC20 for IERC20;\\n //////////////////////////////////////////////////////////////\\n /////////////////////////// Events ///////////////////////////\\n //////////////////////////////////////////////////////////////\\n event CBInitialized(address cBridge, uint256 chainId);\\n event CBTransferStarted(\\n string bridgeUsed,\\n address token,\\n address from,\\n address to,\\n uint256 qty,\\n uint256 chainIdTo\\n );\\n event CBUpdatedBridge(address newAddress);\\n event CBUpdatedSlippageTolerance(uint256 newSlippage);\\n //////////////////////////////////////////////////////////////\\n ////////////////////////// Storage ///////////////////////////\\n //////////////////////////////////////////////////////////////\\n\\n bytes32 internal constant NAMESPACE =\\n keccak256(\\\"io.etherspot.facets.cbridge\\\");\\n struct Storage {\\n address cbBridge;\\n uint256 cbChainId;\\n uint32 cbSlippage;\\n }\\n\\n //////////////////////////////////////////////////////////////\\n ////////////////////////// Structs ///////////////////////////\\n //////////////////////////////////////////////////////////////\\n\\n struct CBridgeData {\\n uint64 dstChainId;\\n uint64 nonce;\\n uint256 qty;\\n address to;\\n address token;\\n }\\n\\n /// @notice initializes state variables for the cBridge facet\\n /// @param _cbBridge address of the CBridge router contract\\n function cbInitialize(address _cbBridge) external {\\n LibDiamond.enforceIsContractOwner();\\n if (_cbBridge == address(0)) revert ZeroAddressProvided();\\n Storage storage s = getStorage();\\n s.cbBridge = _cbBridge;\\n s.cbChainId = block.chainid;\\n s.cbSlippage = 10000; // equates to 1% - has to be > 0.5% (slippage * 1M)\\n emit CBInitialized(_cbBridge, block.chainid);\\n }\\n\\n /// @notice initiates token bridging\\n /// @param _cbData: provides necessary data for cBridge transfer\\n\\n function cbBridgeTokens(CBridgeData calldata _cbData)\\n external\\n payable\\n nonReentrant\\n {\\n if (block.chainid == _cbData.dstChainId)\\n revert CannotBridgeToSameNetwork();\\n if (_cbData.to == address(0)) revert ZeroAddressProvided();\\n if (_cbData.qty <= 0) revert InvalidAmount();\\n if (_cbData.token == address(0)) revert TokenAddressIsZero();\\n\\n Storage storage s = getStorage();\\n address bridge = s.cbBridge;\\n\\n // this contract calls stargate swap()\\n IERC20(_cbData.token).safeTransferFrom(\\n msg.sender,\\n address(this),\\n _cbData.qty\\n );\\n IERC20(_cbData.token).safeApprove(address(bridge), _cbData.qty);\\n\\n ICBridge(bridge).send(\\n _cbData.to,\\n _cbData.token,\\n _cbData.qty,\\n _cbData.dstChainId,\\n _cbData.nonce,\\n s.cbSlippage\\n );\\n\\n emit CBTransferStarted(\\n \\\"cbridge\\\",\\n _cbData.token,\\n msg.sender,\\n _cbData.to,\\n _cbData.qty,\\n _cbData.dstChainId\\n );\\n }\\n\\n function cbUpdateSlippageTolerance(uint32 _newSlippage) external {\\n // should be > 0.5% (5000)\\n if (_newSlippage <= 5000) revert CBSlippageTooLow();\\n LibDiamond.enforceIsContractOwner();\\n Storage storage s = getStorage();\\n s.cbSlippage = _newSlippage;\\n emit CBUpdatedSlippageTolerance(_newSlippage);\\n }\\n\\n function cbUpdateBridge(address _newAddress) external {\\n LibDiamond.enforceIsContractOwner();\\n if (_newAddress == address(0)) revert ZeroAddressProvided();\\n Storage storage s = getStorage();\\n s.cbBridge = _newAddress;\\n emit CBUpdatedBridge(_newAddress);\\n }\\n\\n //////////////////////////////////////////////////////////////\\n ////////////////////// Private Functions /////////////////////\\n //////////////////////////////////////////////////////////////\\n\\n /// @dev fetch local storage\\n function getStorage() private pure returns (Storage storage s) {\\n bytes32 namespace = NAMESPACE;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n s.slot := namespace\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1555eba16c57843a441f5886a70a86f82ad73507f24dabdc44d6ec9e9c87ee9d\",\"license\":\"MIT\"},\"src/bridges/interfaces/ICBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable-next-line\\npragma solidity 0.8.4;\\n\\ninterface ICBridge {\\n function send(\\n address _receiver,\\n address _token,\\n uint256 _amount,\\n uint64 _dstChinId,\\n uint64 _nonce,\\n uint32 _maxSlippage\\n ) external;\\n\\n function sendNative(\\n address _receiver,\\n uint256 _amount,\\n uint64 _dstChinId,\\n uint64 _nonce,\\n uint32 _maxSlippage\\n ) external payable;\\n\\n function relay(\\n bytes calldata _relayRequest,\\n bytes[] calldata _sigs,\\n address[] calldata _signers,\\n uint256[] calldata _powers\\n ) external;\\n}\\n\",\"keccak256\":\"0x1d9e1f4ef38e6d8f810869d4e4126af4d3c5b70cf23ae0f61abb63151ef1c43c\",\"license\":\"MIT\"},\"src/bridges/interfaces/IDiamondCut.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4 <0.9.0;\\n\\ninterface IDiamondCut {\\n enum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n }\\n // Add=0, Replace=1, Remove=2\\n\\n struct FacetCut {\\n address facetAddress;\\n FacetCutAction action;\\n bytes4[] functionSelectors;\\n }\\n\\n /// @notice Add/replace/remove any number of functions and optionally execute\\n /// a function with delegatecall\\n /// @param _diamondCut Contains the facet addresses and function selectors\\n /// @param _init The address of the contract or facet to execute _calldata\\n /// @param _calldata A function call, including function selector and arguments\\n /// _calldata is executed with delegatecall on _init\\n function diamondCut(\\n FacetCut[] calldata _diamondCut,\\n address _init,\\n bytes calldata _calldata\\n ) external;\\n\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n}\\n\",\"keccak256\":\"0xc5184a3a9a2d9698572c007846bf12cf4a693dffc47425352b4b4f92beaae4db\",\"license\":\"MIT\"},\"src/bridges/libs/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.4 <0.9.0;\\n\\nimport {IDiamondCut} from \\\"../interfaces/IDiamondCut.sol\\\";\\n\\nlibrary LibDiamond {\\n bytes32 internal constant DIAMOND_STORAGE_POSITION =\\n keccak256(\\\"diamond.standard.diamond.storage\\\");\\n\\n struct FacetAddressAndPosition {\\n address facetAddress;\\n uint96 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array\\n }\\n\\n struct FacetFunctionSelectors {\\n bytes4[] functionSelectors;\\n uint256 facetAddressPosition; // position of facetAddress in facetAddresses array\\n }\\n\\n struct DiamondStorage {\\n // maps function selector to the facet address and\\n // the position of the selector in the facetFunctionSelectors.selectors array\\n mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;\\n // maps facet addresses to function selectors\\n mapping(address => FacetFunctionSelectors) facetFunctionSelectors;\\n // facet addresses\\n address[] facetAddresses;\\n // Used to query if a contract implements an interface.\\n // Used to implement ERC-165.\\n mapping(bytes4 => bool) supportedInterfaces;\\n // owner of the contract\\n address contractOwner;\\n }\\n\\n function diamondStorage()\\n internal\\n pure\\n returns (DiamondStorage storage ds)\\n {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n ds.slot := position\\n }\\n }\\n\\n event OwnershipTransferred(\\n address indexed previousOwner,\\n address indexed newOwner\\n );\\n\\n function setContractOwner(address _newOwner) internal {\\n DiamondStorage storage ds = diamondStorage();\\n address previousOwner = ds.contractOwner;\\n ds.contractOwner = _newOwner;\\n emit OwnershipTransferred(previousOwner, _newOwner);\\n }\\n\\n function contractOwner() internal view returns (address contractOwner_) {\\n contractOwner_ = diamondStorage().contractOwner;\\n }\\n\\n function enforceIsContractOwner() internal view {\\n require(\\n msg.sender == diamondStorage().contractOwner,\\n \\\"LibDiamond: Must be contract owner\\\"\\n );\\n }\\n\\n event DiamondCut(\\n IDiamondCut.FacetCut[] _diamondCut,\\n address _init,\\n bytes _calldata\\n );\\n\\n // Internal function version of diamondCut\\n function diamondCut(\\n IDiamondCut.FacetCut[] memory _diamondCut,\\n address _init,\\n bytes memory _calldata\\n ) internal {\\n for (\\n uint256 facetIndex;\\n facetIndex < _diamondCut.length;\\n facetIndex++\\n ) {\\n IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == IDiamondCut.FacetCutAction.Add) {\\n addFunctions(\\n _diamondCut[facetIndex].facetAddress,\\n _diamondCut[facetIndex].functionSelectors\\n );\\n } else if (action == IDiamondCut.FacetCutAction.Replace) {\\n replaceFunctions(\\n _diamondCut[facetIndex].facetAddress,\\n _diamondCut[facetIndex].functionSelectors\\n );\\n } else if (action == IDiamondCut.FacetCutAction.Remove) {\\n removeFunctions(\\n _diamondCut[facetIndex].facetAddress,\\n _diamondCut[facetIndex].functionSelectors\\n );\\n } else {\\n revert(\\\"LibDiamondCut: Incorrect FacetCutAction\\\");\\n }\\n }\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n initializeDiamondCut(_init, _calldata);\\n }\\n\\n function addFunctions(\\n address _facetAddress,\\n bytes4[] memory _functionSelectors\\n ) internal {\\n require(\\n _functionSelectors.length > 0,\\n \\\"LibDiamondCut: No selectors in facet to cut\\\"\\n );\\n DiamondStorage storage ds = diamondStorage();\\n require(\\n _facetAddress != address(0),\\n \\\"LibDiamondCut: Add facet can't be address(0)\\\"\\n );\\n uint96 selectorPosition = uint96(\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.length\\n );\\n // add new facet address if it does not exist\\n if (selectorPosition == 0) {\\n addFacet(ds, _facetAddress);\\n }\\n for (\\n uint256 selectorIndex;\\n selectorIndex < _functionSelectors.length;\\n selectorIndex++\\n ) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds\\n .selectorToFacetAndPosition[selector]\\n .facetAddress;\\n require(\\n oldFacetAddress == address(0),\\n \\\"LibDiamondCut: Can't add function that already exists\\\"\\n );\\n addFunction(ds, selector, selectorPosition, _facetAddress);\\n selectorPosition++;\\n }\\n }\\n\\n function replaceFunctions(\\n address _facetAddress,\\n bytes4[] memory _functionSelectors\\n ) internal {\\n require(\\n _functionSelectors.length > 0,\\n \\\"LibDiamondCut: No selectors in facet to cut\\\"\\n );\\n DiamondStorage storage ds = diamondStorage();\\n require(\\n _facetAddress != address(0),\\n \\\"LibDiamondCut: Add facet can't be address(0)\\\"\\n );\\n uint96 selectorPosition = uint96(\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.length\\n );\\n // add new facet address if it does not exist\\n if (selectorPosition == 0) {\\n addFacet(ds, _facetAddress);\\n }\\n for (\\n uint256 selectorIndex;\\n selectorIndex < _functionSelectors.length;\\n selectorIndex++\\n ) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds\\n .selectorToFacetAndPosition[selector]\\n .facetAddress;\\n require(\\n oldFacetAddress != _facetAddress,\\n \\\"LibDiamondCut: Can't replace function with same function\\\"\\n );\\n removeFunction(ds, oldFacetAddress, selector);\\n addFunction(ds, selector, selectorPosition, _facetAddress);\\n selectorPosition++;\\n }\\n }\\n\\n function removeFunctions(\\n address _facetAddress,\\n bytes4[] memory _functionSelectors\\n ) internal {\\n require(\\n _functionSelectors.length > 0,\\n \\\"LibDiamondCut: No selectors in facet to cut\\\"\\n );\\n DiamondStorage storage ds = diamondStorage();\\n // if function does not exist then do nothing and return\\n require(\\n _facetAddress == address(0),\\n \\\"LibDiamondCut: Remove facet address must be address(0)\\\"\\n );\\n for (\\n uint256 selectorIndex;\\n selectorIndex < _functionSelectors.length;\\n selectorIndex++\\n ) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds\\n .selectorToFacetAndPosition[selector]\\n .facetAddress;\\n removeFunction(ds, oldFacetAddress, selector);\\n }\\n }\\n\\n function addFacet(DiamondStorage storage ds, address _facetAddress)\\n internal\\n {\\n enforceHasContractCode(\\n _facetAddress,\\n \\\"LibDiamondCut: New facet has no code\\\"\\n );\\n ds.facetFunctionSelectors[_facetAddress].facetAddressPosition = ds\\n .facetAddresses\\n .length;\\n ds.facetAddresses.push(_facetAddress);\\n }\\n\\n function addFunction(\\n DiamondStorage storage ds,\\n bytes4 _selector,\\n uint96 _selectorPosition,\\n address _facetAddress\\n ) internal {\\n ds\\n .selectorToFacetAndPosition[_selector]\\n .functionSelectorPosition = _selectorPosition;\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(\\n _selector\\n );\\n ds.selectorToFacetAndPosition[_selector].facetAddress = _facetAddress;\\n }\\n\\n function removeFunction(\\n DiamondStorage storage ds,\\n address _facetAddress,\\n bytes4 _selector\\n ) internal {\\n require(\\n _facetAddress != address(0),\\n \\\"LibDiamondCut: Can't remove function that doesn't exist\\\"\\n );\\n // an immutable function is a function defined directly in a diamond\\n require(\\n _facetAddress != address(this),\\n \\\"LibDiamondCut: Can't remove immutable function\\\"\\n );\\n // replace selector with last selector, then delete last selector\\n uint256 selectorPosition = ds\\n .selectorToFacetAndPosition[_selector]\\n .functionSelectorPosition;\\n uint256 lastSelectorPosition = ds\\n .facetFunctionSelectors[_facetAddress]\\n .functionSelectors\\n .length - 1;\\n // if not the same then replace _selector with lastSelector\\n if (selectorPosition != lastSelectorPosition) {\\n bytes4 lastSelector = ds\\n .facetFunctionSelectors[_facetAddress]\\n .functionSelectors[lastSelectorPosition];\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors[\\n selectorPosition\\n ] = lastSelector;\\n ds\\n .selectorToFacetAndPosition[lastSelector]\\n .functionSelectorPosition = uint96(selectorPosition);\\n }\\n // delete the last selector\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.pop();\\n delete ds.selectorToFacetAndPosition[_selector];\\n\\n // if no more selectors for facet address then delete the facet address\\n if (lastSelectorPosition == 0) {\\n // replace facet address with last facet address and delete last facet address\\n uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;\\n uint256 facetAddressPosition = ds\\n .facetFunctionSelectors[_facetAddress]\\n .facetAddressPosition;\\n if (facetAddressPosition != lastFacetAddressPosition) {\\n address lastFacetAddress = ds.facetAddresses[\\n lastFacetAddressPosition\\n ];\\n ds.facetAddresses[facetAddressPosition] = lastFacetAddress;\\n ds\\n .facetFunctionSelectors[lastFacetAddress]\\n .facetAddressPosition = facetAddressPosition;\\n }\\n ds.facetAddresses.pop();\\n delete ds\\n .facetFunctionSelectors[_facetAddress]\\n .facetAddressPosition;\\n }\\n }\\n\\n function initializeDiamondCut(address _init, bytes memory _calldata)\\n internal\\n {\\n if (_init == address(0)) {\\n require(\\n _calldata.length == 0,\\n \\\"LibDiamondCut: _init is address(0) but_calldata is not empty\\\"\\n );\\n } else {\\n require(\\n _calldata.length > 0,\\n \\\"LibDiamondCut: _calldata is empty but _init is not address(0)\\\"\\n );\\n if (_init != address(this)) {\\n enforceHasContractCode(\\n _init,\\n \\\"LibDiamondCut: _init address has no code\\\"\\n );\\n }\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length > 0) {\\n // bubble up the error\\n revert(string(error));\\n } else {\\n revert(\\\"LibDiamondCut: _init function reverted\\\");\\n }\\n }\\n }\\n }\\n\\n function enforceHasContractCode(\\n address _contract,\\n string memory _errorMessage\\n ) internal view {\\n uint256 contractSize;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n contractSize := extcodesize(_contract)\\n }\\n require(contractSize > 0, _errorMessage);\\n }\\n}\\n\",\"keccak256\":\"0x135cb5bb9fc0234dcc41a8ba75e6a95ad514cd965673f1d105103dbba18017cd\",\"license\":\"MIT\"},\"src/common/helpers/DiamondReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.4;\\n\\n/// @title Reentrancy Guard\\n/// @notice Abstract contract to provide protection against reentrancy\\nabstract contract ReentrancyGuard {\\n //////////////////////////////////////////////////////////////\\n ////////////////////////// Storage ///////////////////////////\\n //////////////////////////////////////////////////////////////\\n\\n bytes32 private constant NAMESPACE =\\n keccak256(\\\"io.etherspot.helpers.reentrancyguard\\\");\\n\\n //////////////////////////////////////////////////////////////\\n ////////////////////////// Structs ///////////////////////////\\n //////////////////////////////////////////////////////////////\\n\\n struct ReentrancyStorage {\\n uint256 status;\\n }\\n\\n //////////////////////////////////////////////////////////////\\n ////////////////////////// Errors ////////////////////////////\\n //////////////////////////////////////////////////////////////\\n\\n error ReentrancyError();\\n\\n //////////////////////////////////////////////////////////////\\n ///////////////////////// Constants //////////////////////////\\n //////////////////////////////////////////////////////////////\\n\\n uint256 private constant _NOT_ENTERED = 0;\\n uint256 private constant _ENTERED = 1;\\n\\n //////////////////////////////////////////////////////////////\\n ///////////////////////// Modifiers ///////////////////////////\\n //////////////////////////////////////////////////////////////\\n\\n modifier nonReentrant() {\\n ReentrancyStorage storage s = reentrancyStorage();\\n if (s.status == _ENTERED) revert ReentrancyError();\\n s.status = _ENTERED;\\n _;\\n s.status = _NOT_ENTERED;\\n }\\n\\n //////////////////////////////////////////////////////////////\\n ////////////////////// Private Functions /////////////////////\\n //////////////////////////////////////////////////////////////\\n\\n /// @dev fetch local storage\\n function reentrancyStorage()\\n private\\n pure\\n returns (ReentrancyStorage storage data)\\n {\\n bytes32 position = NAMESPACE;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n data.slot := position\\n }\\n }\\n}\\n\",\"keccak256\":\"0x80669f5e1b6d50ad0b4020e8caeb447f515e3b904b14cad5d03cc32e345753d5\",\"license\":\"UNLICENSED\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b506115ab806100206000396000f3fe60806040526004361061003f5760003560e01c806340d280a21461004457806352434c6e1461006d5780636f395e60146100895780639e32e2e6146100b2575b600080fd5b34801561005057600080fd5b5061006b60048036038101906100669190610dac565b6100db565b005b61008760048036038101906100829190610dfe565b610204565b005b34801561009557600080fd5b506100b060048036038101906100ab9190610dac565b6105f6565b005b3480156100be57600080fd5b506100d960048036038101906100d49190610e50565b6106ef565b005b6100e36107a2565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561014a576040517f8474420100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061015461083d565b9050818160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055504681600101819055506127108160020160006101000a81548163ffffffff021916908363ffffffff1602179055507fcbfd47a07530fc4fffba96f5686a7127e5661fe26dd01503239ca2f66fcad99082466040516101f892919061112b565b60405180910390a15050565b600061020e61086a565b905060018160000154141561024f576040517f29f745a700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001816000018190555081600001602081019061026c9190610e79565b67ffffffffffffffff164614156102af576040517f4ac09ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168260600160208101906102da9190610dac565b73ffffffffffffffffffffffffffffffffffffffff161415610328576040517f8474420100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826040013511610366576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168260800160208101906103919190610dac565b73ffffffffffffffffffffffffffffffffffffffff1614156103df576040517fdc2e5e8d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006103e961083d565b905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050610457333086604001358760800160208101906104319190610dac565b73ffffffffffffffffffffffffffffffffffffffff16610897909392919063ffffffff16565b6104988185604001358660800160208101906104739190610dac565b73ffffffffffffffffffffffffffffffffffffffff166109209092919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff1663a5977fbb8560600160208101906104c79190610dac565b8660800160208101906104da9190610dac565b87604001358860000160208101906104f29190610e79565b8960200160208101906105059190610e79565b8860020160009054906101000a900463ffffffff166040518763ffffffff1660e01b815260040161053b969594939291906110ca565b600060405180830381600087803b15801561055557600080fd5b505af1158015610569573d6000803e3d6000fd5b505050507fd565a5cf794050de1a171170c91acd5d14cbf11877dc3fa020e9975495ab17578460800160208101906105a19190610dac565b338660600160208101906105b59190610dac565b87604001358860000160208101906105cd9190610e79565b6040516105de9594939291906111b6565b60405180910390a15050600081600001819055505050565b6105fe6107a2565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610665576040517f8474420100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061066f61083d565b9050818160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ae67faf3cf135d9eca1b5490d3613096d2d0610fca7496112fa46ef019fbd4e826040516106e3919061104f565b60405180910390a15050565b6113888163ffffffff1611610730576040517f9ff4125000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107386107a2565b600061074261083d565b9050818160020160006101000a81548163ffffffff021916908363ffffffff1602179055507f8d5e80c35df41e151b58f1a100ad605ae1ebcda3d0c329b22820b232767a773082604051610796919061127c565b60405180910390a15050565b6107aa610a7e565b60040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461083b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083290611176565b60405180910390fd5b565b6000807f9d7253cc9498e9cc54011bbbe9471a68adbc99d0ac1eef42369f5a452e814c4a90508091505090565b6000807fc59b5acc5a6673a6c49ca2de898f87adbd9fdfdff36f689476b1c9e0c50964b490508091505090565b61091a846323b872dd60e01b8585856040516024016108b893929190611093565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610aab565b50505050565b60008114806109b9575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b815260040161096792919061106a565b60206040518083038186803b15801561097f57600080fd5b505afa158015610993573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b79190610e27565b145b6109f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ef9061125c565b60405180910390fd5b610a798363095ea7b360e01b8484604051602401610a1792919061112b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610aab565b505050565b6000807fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90508091505090565b6000610b0d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610b729092919063ffffffff16565b9050600081511115610b6d5780806020019051810190610b2d9190610dd5565b610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b639061123c565b60405180910390fd5b5b505050565b6060610b818484600085610b8a565b90509392505050565b606082471015610bcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc690611196565b60405180910390fd5b610bd885610c9e565b610c17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0e9061121c565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610c409190611038565b60006040518083038185875af1925050503d8060008114610c7d576040519150601f19603f3d011682016040523d82523d6000602084013e610c82565b606091505b5091509150610c92828286610cc1565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315610cd157829050610d21565b600083511115610ce45782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d189190611154565b60405180910390fd5b9392505050565b600081359050610d378161152b565b92915050565b600081519050610d4c81611542565b92915050565b600060a08284031215610d6457600080fd5b81905092915050565b600081519050610d7c81611559565b92915050565b600081359050610d9181611570565b92915050565b600081359050610da681611587565b92915050565b600060208284031215610dbe57600080fd5b6000610dcc84828501610d28565b91505092915050565b600060208284031215610de757600080fd5b6000610df584828501610d3d565b91505092915050565b600060a08284031215610e1057600080fd5b6000610e1e84828501610d52565b91505092915050565b600060208284031215610e3957600080fd5b6000610e4784828501610d6d565b91505092915050565b600060208284031215610e6257600080fd5b6000610e7084828501610d82565b91505092915050565b600060208284031215610e8b57600080fd5b6000610e9984828501610d97565b91505092915050565b610eab816112c9565b82525050565b6000610ebc82611297565b610ec681856112ad565b9350610ed6818560208601611359565b80840191505092915050565b6000610eed826112a2565b610ef781856112b8565b9350610f07818560208601611359565b610f108161138c565b840191505092915050565b6000610f286022836112b8565b9150610f338261139d565b604082019050919050565b6000610f4b6026836112b8565b9150610f56826113ec565b604082019050919050565b6000610f6e6007836112b8565b9150610f798261143b565b602082019050919050565b6000610f91601d836112b8565b9150610f9c82611464565b602082019050919050565b6000610fb4602a836112b8565b9150610fbf8261148d565b604082019050919050565b6000610fd76036836112b8565b9150610fe2826114dc565b604082019050919050565b610ff681611307565b82525050565b61100581611335565b82525050565b61101481611311565b82525050565b61102381611347565b82525050565b61103281611321565b82525050565b60006110448284610eb1565b915081905092915050565b60006020820190506110646000830184610ea2565b92915050565b600060408201905061107f6000830185610ea2565b61108c6020830184610ea2565b9392505050565b60006060820190506110a86000830186610ea2565b6110b56020830185610ea2565b6110c26040830184610fed565b949350505050565b600060c0820190506110df6000830189610ea2565b6110ec6020830188610ea2565b6110f96040830187610fed565b6111066060830186611029565b6111136080830185611029565b61112060a083018461100b565b979650505050505050565b60006040820190506111406000830185610ea2565b61114d6020830184610fed565b9392505050565b6000602082019050818103600083015261116e8184610ee2565b905092915050565b6000602082019050818103600083015261118f81610f1b565b9050919050565b600060208201905081810360008301526111af81610f3e565b9050919050565b600060c08201905081810360008301526111cf81610f61565b90506111de6020830188610ea2565b6111eb6040830187610ea2565b6111f86060830186610ea2565b6112056080830185610fed565b61121260a083018461101a565b9695505050505050565b6000602082019050818103600083015261123581610f84565b9050919050565b6000602082019050818103600083015261125581610fa7565b9050919050565b6000602082019050818103600083015261127581610fca565b9050919050565b60006020820190506112916000830184610ffc565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006112d4826112e7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600067ffffffffffffffff82169050919050565b600061134082611311565b9050919050565b600061135282611321565b9050919050565b60005b8381101561137757808201518184015260208101905061135c565b83811115611386576000848401525b50505050565b6000601f19601f8301169050919050565b7f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f6362726964676500000000000000000000000000000000000000000000000000600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60008201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000602082015250565b611534816112c9565b811461153f57600080fd5b50565b61154b816112db565b811461155657600080fd5b50565b61156281611307565b811461156d57600080fd5b50565b61157981611311565b811461158457600080fd5b50565b61159081611321565b811461159b57600080fd5b5056fea164736f6c6343000804000a",
"deployedBytecode": "0x60806040526004361061003f5760003560e01c806340d280a21461004457806352434c6e1461006d5780636f395e60146100895780639e32e2e6146100b2575b600080fd5b34801561005057600080fd5b5061006b60048036038101906100669190610dac565b6100db565b005b61008760048036038101906100829190610dfe565b610204565b005b34801561009557600080fd5b506100b060048036038101906100ab9190610dac565b6105f6565b005b3480156100be57600080fd5b506100d960048036038101906100d49190610e50565b6106ef565b005b6100e36107a2565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561014a576040517f8474420100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061015461083d565b9050818160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055504681600101819055506127108160020160006101000a81548163ffffffff021916908363ffffffff1602179055507fcbfd47a07530fc4fffba96f5686a7127e5661fe26dd01503239ca2f66fcad99082466040516101f892919061112b565b60405180910390a15050565b600061020e61086a565b905060018160000154141561024f576040517f29f745a700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001816000018190555081600001602081019061026c9190610e79565b67ffffffffffffffff164614156102af576040517f4ac09ad300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168260600160208101906102da9190610dac565b73ffffffffffffffffffffffffffffffffffffffff161415610328576040517f8474420100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000826040013511610366576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168260800160208101906103919190610dac565b73ffffffffffffffffffffffffffffffffffffffff1614156103df576040517fdc2e5e8d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006103e961083d565b905060008160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050610457333086604001358760800160208101906104319190610dac565b73ffffffffffffffffffffffffffffffffffffffff16610897909392919063ffffffff16565b6104988185604001358660800160208101906104739190610dac565b73ffffffffffffffffffffffffffffffffffffffff166109209092919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff1663a5977fbb8560600160208101906104c79190610dac565b8660800160208101906104da9190610dac565b87604001358860000160208101906104f29190610e79565b8960200160208101906105059190610e79565b8860020160009054906101000a900463ffffffff166040518763ffffffff1660e01b815260040161053b969594939291906110ca565b600060405180830381600087803b15801561055557600080fd5b505af1158015610569573d6000803e3d6000fd5b505050507fd565a5cf794050de1a171170c91acd5d14cbf11877dc3fa020e9975495ab17578460800160208101906105a19190610dac565b338660600160208101906105b59190610dac565b87604001358860000160208101906105cd9190610e79565b6040516105de9594939291906111b6565b60405180910390a15050600081600001819055505050565b6105fe6107a2565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610665576040517f8474420100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061066f61083d565b9050818160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ae67faf3cf135d9eca1b5490d3613096d2d0610fca7496112fa46ef019fbd4e826040516106e3919061104f565b60405180910390a15050565b6113888163ffffffff1611610730576040517f9ff4125000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107386107a2565b600061074261083d565b9050818160020160006101000a81548163ffffffff021916908363ffffffff1602179055507f8d5e80c35df41e151b58f1a100ad605ae1ebcda3d0c329b22820b232767a773082604051610796919061127c565b60405180910390a15050565b6107aa610a7e565b60040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461083b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083290611176565b60405180910390fd5b565b6000807f9d7253cc9498e9cc54011bbbe9471a68adbc99d0ac1eef42369f5a452e814c4a90508091505090565b6000807fc59b5acc5a6673a6c49ca2de898f87adbd9fdfdff36f689476b1c9e0c50964b490508091505090565b61091a846323b872dd60e01b8585856040516024016108b893929190611093565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610aab565b50505050565b60008114806109b9575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b815260040161096792919061106a565b60206040518083038186803b15801561097f57600080fd5b505afa158015610993573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b79190610e27565b145b6109f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ef9061125c565b60405180910390fd5b610a798363095ea7b360e01b8484604051602401610a1792919061112b565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610aab565b505050565b6000807fc8fcad8db84d3cc18b4c41d551ea0ee66dd599cde068d998e57d5e09332c131c90508091505090565b6000610b0d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610b729092919063ffffffff16565b9050600081511115610b6d5780806020019051810190610b2d9190610dd5565b610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b639061123c565b60405180910390fd5b5b505050565b6060610b818484600085610b8a565b90509392505050565b606082471015610bcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc690611196565b60405180910390fd5b610bd885610c9e565b610c17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0e9061121c565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610c409190611038565b60006040518083038185875af1925050503d8060008114610c7d576040519150601f19603f3d011682016040523d82523d6000602084013e610c82565b606091505b5091509150610c92828286610cc1565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315610cd157829050610d21565b600083511115610ce45782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d189190611154565b60405180910390fd5b9392505050565b600081359050610d378161152b565b92915050565b600081519050610d4c81611542565b92915050565b600060a08284031215610d6457600080fd5b81905092915050565b600081519050610d7c81611559565b92915050565b600081359050610d9181611570565b92915050565b600081359050610da681611587565b92915050565b600060208284031215610dbe57600080fd5b6000610dcc84828501610d28565b91505092915050565b600060208284031215610de757600080fd5b6000610df584828501610d3d565b91505092915050565b600060a08284031215610e1057600080fd5b6000610e1e84828501610d52565b91505092915050565b600060208284031215610e3957600080fd5b6000610e4784828501610d6d565b91505092915050565b600060208284031215610e6257600080fd5b6000610e7084828501610d82565b91505092915050565b600060208284031215610e8b57600080fd5b6000610e9984828501610d97565b91505092915050565b610eab816112c9565b82525050565b6000610ebc82611297565b610ec681856112ad565b9350610ed6818560208601611359565b80840191505092915050565b6000610eed826112a2565b610ef781856112b8565b9350610f07818560208601611359565b610f108161138c565b840191505092915050565b6000610f286022836112b8565b9150610f338261139d565b604082019050919050565b6000610f4b6026836112b8565b9150610f56826113ec565b604082019050919050565b6000610f6e6007836112b8565b9150610f798261143b565b602082019050919050565b6000610f91601d836112b8565b9150610f9c82611464565b602082019050919050565b6000610fb4602a836112b8565b9150610fbf8261148d565b604082019050919050565b6000610fd76036836112b8565b9150610fe2826114dc565b604082019050919050565b610ff681611307565b82525050565b61100581611335565b82525050565b61101481611311565b82525050565b61102381611347565b82525050565b61103281611321565b82525050565b60006110448284610eb1565b915081905092915050565b60006020820190506110646000830184610ea2565b92915050565b600060408201905061107f6000830185610ea2565b61108c6020830184610ea2565b9392505050565b60006060820190506110a86000830186610ea2565b6110b56020830185610ea2565b6110c26040830184610fed565b949350505050565b600060c0820190506110df6000830189610ea2565b6110ec6020830188610ea2565b6110f96040830187610fed565b6111066060830186611029565b6111136080830185611029565b61112060a083018461100b565b979650505050505050565b60006040820190506111406000830185610ea2565b61114d6020830184610fed565b9392505050565b6000602082019050818103600083015261116e8184610ee2565b905092915050565b6000602082019050818103600083015261118f81610f1b565b9050919050565b600060208201905081810360008301526111af81610f3e565b9050919050565b600060c08201905081810360008301526111cf81610f61565b90506111de6020830188610ea2565b6111eb6040830187610ea2565b6111f86060830186610ea2565b6112056080830185610fed565b61121260a083018461101a565b9695505050505050565b6000602082019050818103600083015261123581610f84565b9050919050565b6000602082019050818103600083015261125581610fa7565b9050919050565b6000602082019050818103600083015261127581610fca565b9050919050565b60006020820190506112916000830184610ffc565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006112d4826112e7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600067ffffffffffffffff82169050919050565b600061134082611311565b9050919050565b600061135282611321565b9050919050565b60005b8381101561137757808201518184015260208101905061135c565b83811115611386576000848401525b50505050565b6000601f19601f8301169050919050565b7f4c69624469616d6f6e643a204d75737420626520636f6e7472616374206f776e60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f6362726964676500000000000000000000000000000000000000000000000000600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60008201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000602082015250565b611534816112c9565b811461153f57600080fd5b50565b61154b816112db565b811461155657600080fd5b50565b61156281611307565b811461156d57600080fd5b50565b61157981611311565b811461158457600080fd5b50565b61159081611321565b811461159b57600080fd5b5056fea164736f6c6343000804000a",
"devdoc": {
"kind": "dev",
"methods": {
"cbBridgeTokens((uint64,uint64,uint256,address,address))": {
"params": {
"_cbData": ": provides necessary data for cBridge transfer"
}
},
"cbInitialize(address)": {
"params": {
"_cbBridge": "address of the CBridge router contract"
}
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"cbBridgeTokens((uint64,uint64,uint256,address,address))": {
"notice": "initiates token bridging"
},
"cbInitialize(address)": {
"notice": "initializes state variables for the cBridge facet"
}
},
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}