MetaRouterGateway
0xce8f24a58d85ed5c5a6824f7be1f8d4711a0eb4c
Verification
Verified
v0.8.19+commit.7dd6d404
Type
Contract
1,412 bytes
ABI entries
3
1 read · 1 write
License
none
Contract information
- Address
- 0xce8f24a58d85ed5c5a6824f7be1f8d4711a0eb4c
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.19+commit.7dd6d404
- Optimization
- Enabled
- Creator
- 0x6dCB5E43B0…172C32be33
- Creation tx
- 0xc272ebb286…9eff74a733
Token
Not a token
This contract does not expose ERC-20 metadata.
Read contract (1)
metaRouterExecutorDontApprove() → address
ABI
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"components": [
{
"internalType": "bytes",
"name": "firstSwapCalldata",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "secondSwapCalldata",
"type": "bytes"
},
{
"internalType": "address[]",
"name": "approvedTokens",
"type": "address[]"
},
{
"internalType": "address",
"name": "firstDexRouter",
"type": "address"
},
{
"internalType": "address",
"name": "secondDexRouter",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "bool",
"name": "nativeIn",
"type": "bool"
},
{
"internalType": "address",
"name": "relayRecipient",
"type": "address"
},
{
"internalType": "bytes",
"name": "otherSideCalldata",
"type": "bytes"
}
],
"internalType": "struct MetaRouteStructs.MetaRouteTransaction",
"name": "_metarouteTransaction",
"type": "tuple"
}
],
"name": "metaRoute",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "metaRouterExecutorDontApprove",
"outputs": [
{
"internalType": "contract MetaRouterExecutorDontApprove",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]Source code
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
import "@uniswap/lib/contracts/libraries/TransferHelper.sol";
import "./MetaRouterExecutorDontApprove.sol";
import "./MetaRouteStructs.sol";
/**
* @title MetaRouterGateway
* @notice During the `metaRoute` transaction `MetaRouterGateway` sends user's tokens
* to `MetaRouterExecutorDontApprove` contract which then operates with them.
*/
contract MetaRouterGateway {
MetaRouterExecutorDontApprove public metaRouterExecutorDontApprove;
constructor() {
metaRouterExecutorDontApprove = new MetaRouterExecutorDontApprove();
}
function metaRoute(
MetaRouteStructs.MetaRouteTransaction calldata _metarouteTransaction
) external payable {
if (!_metarouteTransaction.nativeIn) {
TransferHelper.safeTransferFrom( _metarouteTransaction.approvedTokens[0], msg.sender, address(metaRouterExecutorDontApprove), _metarouteTransaction.amount);
}
metaRouterExecutorDontApprove.metaRoute{value: msg.value}(_metarouteTransaction);
}
}
Chain explorer9030msChain node73ms