编译器
0.8.10+commit.fc410830
文件 1 的 15:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
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");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
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");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 15:Config.sol
pragma solidity ^0.8.0;
contract Config {
bytes4 public constant POSTPROCESS_SIG = 0xc2722916;
uint256 public constant PERCENTAGE_BASE = 1 ether;
enum HandlerType {Token, Custom, Others}
}
文件 3 的 15:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
文件 4 的 15:IFeeRuleRegistry.sol
pragma solidity ^0.8.0;
interface IFeeRuleRegistry {
function rules(uint256) external view returns (address);
function counter() external view returns (uint256);
function basisFeeRate() external view returns (uint256);
function feeCollector() external view returns (address);
function BASE() external view returns (uint256);
function setBasisFeeRate(uint256) external;
function setFeeCollector(address) external;
function registerRule(address rule) external;
function unregisterRule(uint256 ruleIndex) external;
function calFeeRateMulti(address usr, uint256[] calldata ruleIndexes) external view returns (uint256 scaledRate);
function calFeeRate(address usr, uint256 ruleIndex) external view returns (uint256 scaledRate);
function calFeeRateMultiWithoutBasis(address usr, uint256[] calldata ruleIndexes) external view returns (uint256 scaledRate);
function calFeeRateWithoutBasis(address usr, uint256 ruleIndex) external view returns (uint256 scaledRate);
}
文件 5 的 15:IProxy.sol
pragma solidity ^0.8.0;
interface IProxy {
function batchExec(address[] calldata tos, bytes32[] calldata configs, bytes[] memory datas, uint256[] calldata ruleIndexes) external payable;
function execs(address[] calldata tos, bytes32[] calldata configs, bytes[] memory datas) external payable;
}
文件 6 的 15:IRegistry.sol
pragma solidity ^0.8.0;
interface IRegistry {
function handlers(address) external view returns (bytes32);
function callers(address) external view returns (bytes32);
function bannedAgents(address) external view returns (uint256);
function fHalt() external view returns (bool);
function isValidHandler(address handler) external view returns (bool);
function isValidCaller(address handler) external view returns (bool);
}
文件 7 的 15:LibCache.sol
pragma solidity ^0.8.0;
library LibCache {
function set(
mapping(bytes32 => bytes32) storage _cache,
bytes32 _key,
bytes32 _value
) internal {
_cache[_key] = _value;
}
function setAddress(
mapping(bytes32 => bytes32) storage _cache,
bytes32 _key,
address _value
) internal {
_cache[_key] = bytes32(uint256(uint160(_value)));
}
function setUint256(
mapping(bytes32 => bytes32) storage _cache,
bytes32 _key,
uint256 _value
) internal {
_cache[_key] = bytes32(_value);
}
function getAddress(
mapping(bytes32 => bytes32) storage _cache,
bytes32 _key
) internal view returns (address ret) {
ret = address(uint160(uint256(_cache[_key])));
}
function getUint256(
mapping(bytes32 => bytes32) storage _cache,
bytes32 _key
) internal view returns (uint256 ret) {
ret = uint256(_cache[_key]);
}
function get(mapping(bytes32 => bytes32) storage _cache, bytes32 _key)
internal
view
returns (bytes32 ret)
{
ret = _cache[_key];
}
}
文件 8 的 15:LibFeeStorage.sol
pragma solidity ^0.8.0;
import "./LibCache.sol";
import "../Storage.sol";
library LibFeeStorage {
using LibCache for mapping(bytes32 => bytes32);
bytes32 public constant FEE_RATE_KEY = 0x142183525227cae0e4300fd0fc77d7f3b08ceb0fd9cb2a6c5488668fa0ea5ffa;
bytes32 public constant FEE_COLLECTOR_KEY = 0x60d7a7cc0a45d852bd613e4f527aaa2e4b81fff918a69a2aab88b6458751d614;
function _setFeeRate(
mapping(bytes32 => bytes32) storage _cache,
uint256 _feeRate
) internal {
require(_getFeeRate(_cache) == 0, "Fee rate not zero");
_cache.setUint256(FEE_RATE_KEY, _feeRate);
}
function _resetFeeRate(mapping(bytes32 => bytes32) storage _cache)
internal
{
_cache.setUint256(FEE_RATE_KEY, 0);
}
function _getFeeRate(mapping(bytes32 => bytes32) storage _cache)
internal
view
returns (uint256)
{
return _cache.getUint256(FEE_RATE_KEY);
}
function _setFeeCollector(
mapping(bytes32 => bytes32) storage _cache,
address _collector
) internal {
require(
_getFeeCollector(_cache) == address(0),
"Fee collector is initialized"
);
_cache.setAddress(FEE_COLLECTOR_KEY, _collector);
}
function _resetFeeCollector(mapping(bytes32 => bytes32) storage _cache)
internal
{
_cache.setAddress(FEE_COLLECTOR_KEY, address(0));
}
function _getFeeCollector(mapping(bytes32 => bytes32) storage _cache)
internal
view
returns (address)
{
return _cache.getAddress(FEE_COLLECTOR_KEY);
}
}
文件 9 的 15:LibParam.sol
pragma solidity ^0.8.0;
library LibParam {
bytes32 private constant STATIC_MASK =
0x0100000000000000000000000000000000000000000000000000000000000000;
bytes32 private constant PARAMS_MASK =
0x0000000000000000000000000000000000000000000000000000000000000001;
bytes32 private constant REFS_MASK =
0x00000000000000000000000000000000000000000000000000000000000000FF;
bytes32 private constant RETURN_NUM_MASK =
0x00FF000000000000000000000000000000000000000000000000000000000000;
uint256 private constant REFS_LIMIT = 22;
uint256 private constant PARAMS_SIZE_LIMIT = 64;
uint256 private constant RETURN_NUM_OFFSET = 240;
function isStatic(bytes32 conf) internal pure returns (bool) {
if (conf & STATIC_MASK == 0) return true;
else return false;
}
function isReferenced(bytes32 conf) internal pure returns (bool) {
if (getReturnNum(conf) == 0) return false;
else return true;
}
function getReturnNum(bytes32 conf) internal pure returns (uint256 num) {
bytes32 temp = (conf & RETURN_NUM_MASK) >> RETURN_NUM_OFFSET;
num = uint256(temp);
}
function getParams(bytes32 conf)
internal
pure
returns (uint256[] memory refs, uint256[] memory params)
{
require(!isStatic(conf), "Static params");
uint256 n = REFS_LIMIT;
while (conf & REFS_MASK == REFS_MASK && n > 0) {
n--;
conf = conf >> 8;
}
require(n > 0, "No dynamic param");
refs = new uint256[](n);
params = new uint256[](n);
for (uint256 i = 0; i < n; i++) {
refs[i] = uint256(conf & REFS_MASK);
conf = conf >> 8;
}
uint256 locCount = 0;
for (uint256 k = 0; k < PARAMS_SIZE_LIMIT; k++) {
if (conf & PARAMS_MASK != 0) {
require(locCount < n, "Location count exceeds ref count");
params[locCount] = k * 32 + 4;
locCount++;
}
conf = conf >> 1;
}
require(locCount == n, "Location count less than ref count");
}
}
文件 10 的 15:LibStack.sol
pragma solidity ^0.8.0;
import "../Config.sol";
library LibStack {
function setAddress(bytes32[] storage _stack, address _input) internal {
_stack.push(bytes32(uint256(uint160(_input))));
}
function set(bytes32[] storage _stack, bytes32 _input) internal {
_stack.push(_input);
}
function setHandlerType(bytes32[] storage _stack, Config.HandlerType _input)
internal
{
_stack.push(bytes12(uint96(_input)));
}
function getAddress(bytes32[] storage _stack)
internal
returns (address ret)
{
ret = address(uint160(uint256(peek(_stack))));
_stack.pop();
}
function getSig(bytes32[] storage _stack) internal returns (bytes4 ret) {
ret = bytes4(peek(_stack));
_stack.pop();
}
function get(bytes32[] storage _stack) internal returns (bytes32 ret) {
ret = peek(_stack);
_stack.pop();
}
function peek(bytes32[] storage _stack)
internal
view
returns (bytes32 ret)
{
uint256 length = _stack.length;
require(length > 0, "stack empty");
ret = _stack[length - 1];
}
function peek(bytes32[] storage _stack, uint256 _index)
internal
view
returns (bytes32 ret)
{
uint256 length = _stack.length;
require(length > 0, "stack empty");
require(length > _index, "not enough elements in stack");
ret = _stack[length - _index - 1];
}
}
文件 11 的 15:Proxy.sol
pragma solidity 0.8.10;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./interface/IProxy.sol";
import "./interface/IRegistry.sol";
import "./interface/IFeeRuleRegistry.sol";
import "./Config.sol";
import "./Storage.sol";
import "./lib/LibParam.sol";
import "./lib/LibFeeStorage.sol";
contract Proxy is IProxy, Storage, Config {
using Address for address;
using SafeERC20 for IERC20;
using LibParam for bytes32;
using LibStack for bytes32[];
using Strings for uint256;
using LibFeeStorage for mapping(bytes32 => bytes32);
event LogBegin(
address indexed handler,
bytes4 indexed selector,
bytes payload
);
event LogEnd(
address indexed handler,
bytes4 indexed selector,
bytes result
);
event ChargeFee(address indexed tokenIn, uint256 feeAmount);
modifier isNotBanned() {
require(registry.bannedAgents(address(this)) == 0, "Banned");
_;
}
modifier isNotHalted() {
require(registry.fHalt() == false, "Halted");
_;
}
address private constant NATIVE_TOKEN =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
IRegistry public immutable registry;
IFeeRuleRegistry public immutable feeRuleRegistry;
constructor(address registry_, address feeRuleRegistry_) {
registry = IRegistry(registry_);
feeRuleRegistry = IFeeRuleRegistry(feeRuleRegistry_);
}
fallback() external payable isNotHalted isNotBanned isInitialized {
require(_isValidCaller(msg.sender), "Invalid caller");
address target = address(bytes20(registry.callers(msg.sender)));
bytes memory result = _exec(target, msg.data, type(uint256).max);
uint256 size = result.length;
assembly {
let loc := add(result, 0x20)
return(loc, size)
}
}
receive() external payable {
require(Address.isContract(msg.sender), "Not allowed from EOA");
}
function batchExec(
address[] calldata tos,
bytes32[] calldata configs,
bytes[] memory datas,
uint256[] calldata ruleIndexes
) external payable override isNotHalted isNotBanned {
_preProcess(ruleIndexes);
_execs(tos, configs, datas);
_postProcess();
}
function execs(
address[] calldata tos,
bytes32[] calldata configs,
bytes[] memory datas
) external payable override isNotHalted isNotBanned isInitialized {
require(msg.sender == address(this), "Does not allow external calls");
_execs(tos, configs, datas);
}
function _execs(
address[] memory tos,
bytes32[] memory configs,
bytes[] memory datas
) internal {
bytes32[256] memory localStack;
uint256 index;
uint256 counter;
require(
tos.length == datas.length,
"Tos and datas length inconsistent"
);
require(
tos.length == configs.length,
"Tos and configs length inconsistent"
);
for (uint256 i = 0; i < tos.length; i++) {
address to = tos[i];
bytes32 config = configs[i];
bytes memory data = datas[i];
if (!config.isStatic()) {
_trim(data, config, localStack, index);
}
bytes4 selector = _getSelector(data);
emit LogBegin(to, selector, data);
bytes memory result = _exec(to, data, counter);
counter++;
emit LogEnd(to, selector, result);
if (config.isReferenced()) {
uint256 num = config.getReturnNum();
uint256 newIndex = _parse(localStack, result, index);
require(
newIndex == index + num,
"Return num and parsed return num not matched"
);
index = newIndex;
}
_setPostProcess(to);
}
}
function _trim(
bytes memory data,
bytes32 config,
bytes32[256] memory localStack,
uint256 index
) internal pure {
(uint256[] memory refs, uint256[] memory params) = config.getParams();
for (uint256 i = 0; i < refs.length; i++) {
require(refs[i] < index, "Reference to out of localStack");
bytes32 ref = localStack[refs[i]];
uint256 offset = params[i];
uint256 base = PERCENTAGE_BASE;
assembly {
let loc := add(add(data, 0x20), offset)
let m := mload(loc)
if iszero(iszero(m)) {
let p := mul(m, ref)
if iszero(eq(div(p, m), ref)) {
revert(0, 0)
}
ref := div(p, base)
}
mstore(loc, ref)
}
}
}
function _parse(
bytes32[256] memory localStack,
bytes memory ret,
uint256 index
) internal pure returns (uint256 newIndex) {
uint256 len = ret.length;
require(len % 32 == 0, "illegal length for _parse");
newIndex = index + len / 32;
require(newIndex <= 256, "stack overflow");
assembly {
let offset := shl(5, index)
for {
let i := 0
} lt(i, len) {
i := add(i, 0x20)
} {
mstore(
add(localStack, add(i, offset)),
mload(add(add(ret, i), 0x20))
)
}
}
}
function _exec(
address to_,
bytes memory data_,
uint256 counter_
) internal returns (bytes memory result) {
require(_isValidHandler(to_), "Invalid handler");
bool success;
assembly {
success := delegatecall(
sub(gas(), 5000),
to_,
add(data_, 0x20),
mload(data_),
0,
0
)
let size := returndatasize()
result := mload(0x40)
mstore(
0x40,
add(result, and(add(add(size, 0x20), 0x1f), not(0x1f)))
)
mstore(result, size)
returndatacopy(add(result, 0x20), 0, size)
}
if (!success) {
if (result.length < 68) revert("_exec");
assembly {
result := add(result, 0x04)
}
if (counter_ == type(uint256).max) {
revert(abi.decode(result, (string)));
} else {
revert(
string(
abi.encodePacked(
counter_.toString(),
"_",
abi.decode(result, (string))
)
)
);
}
}
}
function _setPostProcess(address to_) internal {
if (stack.length == 0) {
return;
} else if (
stack.peek() == bytes32(bytes12(uint96(HandlerType.Custom))) &&
bytes4(stack.peek(1)) != 0x00000000
) {
stack.pop();
stack.setAddress(to_);
stack.setHandlerType(HandlerType.Custom);
}
}
function _preProcess(uint256[] memory ruleIndexes_)
internal
virtual
isStackEmpty
{
_setSender();
cache._setFeeCollector(feeRuleRegistry.feeCollector());
uint256 feeRate =
feeRuleRegistry.calFeeRateMulti(_getSender(), ruleIndexes_);
require(feeRate <= PERCENTAGE_BASE, "fee rate out of range");
cache._setFeeRate(feeRate);
if (msg.value > 0 && feeRate > 0) {
uint256 feeEth = _calFee(msg.value, feeRate);
address collector = cache._getFeeCollector();
(bool success, ) = collector.call{value: feeEth}("");
require(success, "Send fee to collector failed");
emit ChargeFee(NATIVE_TOKEN, feeEth);
}
}
function _postProcess() internal {
while (stack.length > 0) {
bytes32 top = stack.get();
HandlerType handlerType = HandlerType(uint96(bytes12(top)));
if (handlerType == HandlerType.Token) {
address addr = address(uint160(uint256(top)));
uint256 tokenAmount = IERC20(addr).balanceOf(address(this));
if (tokenAmount > 0)
IERC20(addr).safeTransfer(msg.sender, tokenAmount);
} else if (handlerType == HandlerType.Custom) {
address addr = stack.getAddress();
_exec(
addr,
abi.encodeWithSelector(POSTPROCESS_SIG),
type(uint256).max
);
} else {
revert("Invalid handler type");
}
}
uint256 amount = address(this).balance;
if (amount > 0) payable(msg.sender).transfer(amount);
cache._resetFeeCollector();
cache._resetFeeRate();
_resetSender();
}
function _isValidHandler(address handler) internal view returns (bool) {
return registry.isValidHandler(handler);
}
function _isValidCaller(address caller) internal view returns (bool) {
return registry.isValidCaller(caller);
}
function _getSelector(bytes memory payload)
internal
pure
returns (bytes4 selector)
{
selector =
payload[0] |
(bytes4(payload[1]) >> 8) |
(bytes4(payload[2]) >> 16) |
(bytes4(payload[3]) >> 24);
}
function _calFee(uint256 amount, uint256 feeRate)
internal
pure
returns (uint256)
{
return (amount * feeRate) / PERCENTAGE_BASE;
}
}
文件 12 的 15:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
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));
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
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");
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 13 的 15:Storage.sol
pragma solidity ^0.8.0;
import "./lib/LibCache.sol";
import "./lib/LibStack.sol";
contract Storage {
using LibCache for mapping(bytes32 => bytes32);
using LibStack for bytes32[];
bytes32[] public stack;
mapping(bytes32 => bytes32) public cache;
bytes32 public constant MSG_SENDER_KEY = 0xb2f2618cecbbb6e7468cc0f2aa43858ad8d153e0280b22285e28e853bb9d453a;
modifier isStackEmpty() {
require(stack.length == 0, "Stack not empty");
_;
}
modifier isInitialized() {
require(_getSender() != address(0), "Sender is not initialized");
_;
}
modifier isNotInitialized() {
require(_getSender() == address(0), "Sender is initialized");
_;
}
function _setSender() internal isNotInitialized {
cache.setAddress(MSG_SENDER_KEY, msg.sender);
}
function _resetSender() internal {
cache.setAddress(MSG_SENDER_KEY, address(0));
}
function _getSender() internal view returns (address) {
return cache.getAddress(MSG_SENDER_KEY);
}
}
文件 14 的 15:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
文件 15 的 15:draft-IERC20Permit.sol
pragma solidity ^0.8.0;
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
{
"compilationTarget": {
"contracts/Proxy.sol": "Proxy"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"registry_","type":"address"},{"internalType":"address","name":"feeRuleRegistry_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"}],"name":"ChargeFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"handler","type":"address"},{"indexed":true,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"bytes","name":"payload","type":"bytes"}],"name":"LogBegin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"handler","type":"address"},{"indexed":true,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"bytes","name":"result","type":"bytes"}],"name":"LogEnd","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"MSG_SENDER_KEY","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENTAGE_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POSTPROCESS_SIG","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tos","type":"address[]"},{"internalType":"bytes32[]","name":"configs","type":"bytes32[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"},{"internalType":"uint256[]","name":"ruleIndexes","type":"uint256[]"}],"name":"batchExec","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"cache","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tos","type":"address[]"},{"internalType":"bytes32[]","name":"configs","type":"bytes32[]"},{"internalType":"bytes[]","name":"datas","type":"bytes[]"}],"name":"execs","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"feeRuleRegistry","outputs":[{"internalType":"contract IFeeRuleRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract IRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stack","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]