Contract Overview
Contract Name:
MimoOracle
Compiler Version
v0.8.20+commit.a1b79de6
pragma solidity ^0.8.20; interface IMimoRouter { function getAmountsOut(uint256 amountIn, address[] memory path) external view returns (uint256[] memory amounts); } contract MimoOracle { address public immutable WIOTX; IMimoRouter public immutable router; constructor(address _router, address _wiotx) { WIOTX = _wiotx; router = IMimoRouter(_router); } // TODO: set path for each token function getAmount(address _tokenAddr, uint256 _amountIn) public view returns (uint256) { address[] memory _path = new address[](2); _path[0] = _tokenAddr; _path[1] = WIOTX; uint256[] memory outs = router.getAmountsOut(_amountIn, _path); return outs[_path.length - 1]; } }
[{"inputs":[{"internalType":"address","name":"_router","type":"address"},{"internalType":"address","name":"_wiotx","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WIOTX","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddr","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"}],"name":"getAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IMimoRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600436106100415760003560e01c806311a90be014610046578063e0b999a11461008a578063f887ea40146100ab575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61009d610098366004610237565b6100d2565b604051908152602001610081565b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60408051600280825260608201835260009283929190602083019080368337019050509050838160008151811061010b5761010b610285565b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000000000000000000000000000000000000000000008160018151811061015f5761015f610285565b6001600160a01b03928316602091820292909201015260405163d06ca61f60e01b81526000917f0000000000000000000000000000000000000000000000000000000000000000169063d06ca61f906101be908790869060040161029b565b600060405180830381865afa1580156101db573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261020391908101906102f2565b9050806001835161021491906103b0565b8151811061022457610224610285565b6020026020010151925050505b92915050565b6000806040838503121561024a57600080fd5b82356001600160a01b038116811461026157600080fd5b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000604082018483526020604081850152818551808452606086019150828701935060005b818110156102e55784516001600160a01b0316835293830193918301916001016102c0565b5090979650505050505050565b6000602080838503121561030557600080fd5b825167ffffffffffffffff8082111561031d57600080fd5b818501915085601f83011261033157600080fd5b8151818111156103435761034361026f565b8060051b604051601f19603f830116810181811085821117156103685761036861026f565b60405291825284820192508381018501918883111561038657600080fd5b938501935b828510156103a45784518452938501939285019261038b565b98975050505050505050565b8181038181111561023157634e487b7160e01b600052601160045260246000fdfea264697066735822122061cc3b1455e721a7c634c77d1421e4357cd63d2827e439f3b430ea59252761c364736f6c63430008140033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for
interesting conversations.