@arbitrum/sdk
Version:
Typescript library client-side interactions with Arbitrum
403 lines (402 loc) • 17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Multicall2__factory = void 0;
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
const ethers_1 = require("ethers");
const _abi = [
{
inputs: [
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall2.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "aggregate",
outputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
{
internalType: "bytes[]",
name: "returnData",
type: "bytes[]",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall2.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "blockAndAggregate",
outputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
{
components: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
internalType: "struct Multicall2.Result[]",
name: "returnData",
type: "tuple[]",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
],
name: "getBlockHash",
outputs: [
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getBlockNumber",
outputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockCoinbase",
outputs: [
{
internalType: "address",
name: "coinbase",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockDifficulty",
outputs: [
{
internalType: "uint256",
name: "difficulty",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockGasLimit",
outputs: [
{
internalType: "uint256",
name: "gaslimit",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getCurrentBlockTimestamp",
outputs: [
{
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "addr",
type: "address",
},
],
name: "getEthBalance",
outputs: [
{
internalType: "uint256",
name: "balance",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getLastBlockHash",
outputs: [
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bool",
name: "requireSuccess",
type: "bool",
},
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall2.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "tryAggregate",
outputs: [
{
components: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
internalType: "struct Multicall2.Result[]",
name: "returnData",
type: "tuple[]",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bool",
name: "requireSuccess",
type: "bool",
},
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall2.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "tryAggregateGasRation",
outputs: [
{
components: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
internalType: "struct Multicall2.Result[]",
name: "returnData",
type: "tuple[]",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bool",
name: "requireSuccess",
type: "bool",
},
{
components: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
],
internalType: "struct Multicall2.Call[]",
name: "calls",
type: "tuple[]",
},
],
name: "tryBlockAndAggregate",
outputs: [
{
internalType: "uint256",
name: "blockNumber",
type: "uint256",
},
{
internalType: "bytes32",
name: "blockHash",
type: "bytes32",
},
{
components: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
internalType: "struct Multicall2.Result[]",
name: "returnData",
type: "tuple[]",
},
],
stateMutability: "nonpayable",
type: "function",
},
];
const _bytecode = "0x608060405234801561001057600080fd5b50610ba8806100206000396000f3fe608060405234801561001057600080fd5b50600436106100bf5760003560e01c80634d2301cc1161007c5780634d2301cc1461014a57806372425d9d1461016557806386d516e81461016b578063a8b0574e14610171578063bce38bd71461017f578063c3077fa914610192578063ee82ac5e146101a557600080fd5b80630f28c97d146100c4578063252dba42146100d957806327e86d6e146100fa5780632935cd9014610102578063399542e91461012257806342cbb15c14610144575b600080fd5b425b6040519081526020015b60405180910390f35b6100ec6100e736600461086a565b6101b7565b6040516100d09291906108f6565b6100c661033e565b610115610110366004610960565b610351565b6040516100d09190610a1f565b610135610130366004610960565b6104f2565b6040516100d093929190610a39565b436100c6565b6100c6610158366004610a61565b6001600160a01b03163190565b446100c6565b456100c6565b6040514181526020016100d0565b61011561018d366004610960565b61050a565b6101356101a036600461086a565b610689565b6100c66101b3366004610a7c565b4090565b805143906060906001600160401b038111156101d5576101d56106a6565b60405190808252806020026020018201604052801561020857816020015b60608152602001906001900390816101f35790505b50905060005b83518110156103385760008085838151811061022c5761022c610a95565b6020026020010151600001516001600160a01b031686848151811061025357610253610a95565b60200260200101516020015160405161026c9190610aab565b6000604051808303816000865af19150503d80600081146102a9576040519150601f19603f3d011682016040523d82523d6000602084013e6102ae565b606091505b5091509150816103055760405162461bcd60e51b815260206004820181905260248201527f4d756c746963616c6c206167677265676174653a2063616c6c206661696c656460448201526064015b60405180910390fd5b8084848151811061031857610318610a95565b60200260200101819052505050808061033090610add565b91505061020e565b50915091565b600061034b600143610af6565b40905090565b606081516001600160401b0381111561036c5761036c6106a6565b6040519080825280602002602001820160405280156103b257816020015b60408051808201909152600081526060602082015281526020019060019003908161038a5790505b509050600082515a6103c49190610b0f565b905060005b83518110156104ea576000808583815181106103e7576103e7610a95565b6020026020010151600001516001600160a01b0316845a11610409575a61040b565b845b87858151811061041d5761041d610a95565b6020026020010151602001516040516104369190610aab565b60006040518083038160008787f1925050503d8060008114610474576040519150601f19603f3d011682016040523d82523d6000602084013e610479565b606091505b509150915086156104a157816104a15760405162461bcd60e51b81526004016102fc90610b31565b60405180604001604052808315158152602001828152508584815181106104ca576104ca610a95565b6020026020010181905250505080806104e290610add565b9150506103c9565b505092915050565b4380406060610501858561050a565b90509250925092565b606081516001600160401b03811115610525576105256106a6565b60405190808252806020026020018201604052801561056b57816020015b6040805180820190915260008152606060208201528152602001906001900390816105435790505b50905060005b82518110156106825760008084838151811061058f5761058f610a95565b6020026020010151600001516001600160a01b03168584815181106105b6576105b6610a95565b6020026020010151602001516040516105cf9190610aab565b6000604051808303816000865af19150503d806000811461060c576040519150601f19603f3d011682016040523d82523d6000602084013e610611565b606091505b5091509150851561063957816106395760405162461bcd60e51b81526004016102fc90610b31565b604051806040016040528083151581526020018281525084848151811061066257610662610a95565b60200260200101819052505050808061067a90610add565b915050610571565b5092915050565b60008060606106996001856104f2565b9196909550909350915050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156106de576106de6106a6565b60405290565b604051601f8201601f191681016001600160401b038111828210171561070c5761070c6106a6565b604052919050565b80356001600160a01b038116811461072b57600080fd5b919050565b6000601f838184011261074257600080fd5b823560206001600160401b038083111561075e5761075e6106a6565b8260051b61076d8382016106e4565b938452868101830193838101908986111561078757600080fd5b84890192505b8583101561085d578235848111156107a55760008081fd5b89016040601f19828d0381018213156107be5760008081fd5b6107c66106bc565b6107d1898501610714565b815282840135888111156107e55760008081fd5b8085019450508d603f8501126107fb5760008081fd5b888401358881111561080f5761080f6106a6565b61081e8a848e840116016106e4565b92508083528e848287010111156108355760008081fd5b808486018b85013760009083018a01528089019190915284525050918401919084019061078d565b9998505050505050505050565b60006020828403121561087c57600080fd5b81356001600160401b0381111561089257600080fd5b61089e84828501610730565b949350505050565b60005b838110156108c15781810151838201526020016108a9565b50506000910152565b600081518084526108e28160208601602086016108a6565b601f01601f19169290920160200192915050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b8281101561095257605f198887030184526109408683516108ca565b95509284019290840190600101610924565b509398975050505050505050565b6000806040838503121561097357600080fd5b8235801515811461098357600080fd5b915060208301356001600160401b0381111561099e57600080fd5b6109aa85828601610730565b9150509250929050565b600081518084526020808501808196508360051b8101915082860160005b85811015610a12578284038952815180511515855285015160408686018190526109fe818701836108ca565b9a87019a95505050908401906001016109d2565b5091979650505050505050565b602081526000610a3260208301846109b4565b9392505050565b838152826020820152606060408201526000610a5860608301846109b4565b95945050505050565b600060208284031215610a7357600080fd5b610a3282610714565b600060208284031215610a8e57600080fd5b5035919050565b634e487b7160e01b600052603260045260246000fd5b60008251610abd8184602087016108a6565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b600060018201610aef57610aef610ac7565b5060010190565b81810381811115610b0957610b09610ac7565b92915050565b600082610b2c57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526021908201527f4d756c746963616c6c32206167677265676174653a2063616c6c206661696c656040820152601960fa1b60608201526080019056fea2646970667358221220ffd34cb82d11c5daeefde39fe8d5fdb03e0c5da090b53ff1be34a50ffab085d664736f6c63430008100033";
const isSuperArgs = (xs) => xs.length > 1;
class Multicall2__factory extends ethers_1.ContractFactory {
constructor(...args) {
if (isSuperArgs(args)) {
super(...args);
}
else {
super(_abi, _bytecode, args[0]);
}
this.contractName = "Multicall2";
}
deploy(overrides) {
return super.deploy(overrides || {});
}
getDeployTransaction(overrides) {
return super.getDeployTransaction(overrides || {});
}
attach(address) {
return super.attach(address);
}
connect(signer) {
return super.connect(signer);
}
static createInterface() {
return new ethers_1.utils.Interface(_abi);
}
static connect(address, signerOrProvider) {
return new ethers_1.Contract(address, _abi, signerOrProvider);
}
}
exports.Multicall2__factory = Multicall2__factory;
Multicall2__factory.bytecode = _bytecode;
Multicall2__factory.abi = _abi;