@ethsub/sol
Version:
ethsub contracts
285 lines (278 loc) • 11.7 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers";
import { Provider, TransactionRequest } from "@ethersproject/providers";
import type {
GenericHandler,
GenericHandlerInterface,
} from "../GenericHandler";
const _abi = [
{
inputs: [
{
internalType: "address",
name: "bridgeAddress",
type: "address",
},
],
stateMutability: "nonpayable",
type: "constructor",
},
{
inputs: [],
name: "_bridgeAddress",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "_contractAddressToDepositFunctionDepositerOffset",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "_contractAddressToDepositFunctionSignature",
outputs: [
{
internalType: "bytes4",
name: "",
type: "bytes4",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "_contractAddressToExecuteFunctionSignature",
outputs: [
{
internalType: "bytes4",
name: "",
type: "bytes4",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "_contractAddressToResourceID",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "_contractWhitelist",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
name: "_resourceIDToContractAddress",
outputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "resourceID",
type: "bytes32",
},
{
internalType: "address",
name: "contractAddress",
type: "address",
},
{
internalType: "bytes4",
name: "depositFunctionSig",
type: "bytes4",
},
{
internalType: "uint256",
name: "depositFunctionDepositerOffset",
type: "uint256",
},
{
internalType: "bytes4",
name: "executeFunctionSig",
type: "bytes4",
},
],
name: "setResource",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "resourceID",
type: "bytes32",
},
{
internalType: "address",
name: "depositer",
type: "address",
},
{
internalType: "bytes",
name: "data",
type: "bytes",
},
],
name: "deposit",
outputs: [
{
internalType: "bytes",
name: "",
type: "bytes",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "resourceID",
type: "bytes32",
},
{
internalType: "bytes",
name: "data",
type: "bytes",
},
],
name: "executeProposal",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
];
const _bytecode =
"0x60a060405234801561001057600080fd5b50604051610b80380380610b8083398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c610aec610094600039806101a452806105de5250610aec6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063c54c2a1111610066578063c54c2a1114610141578063cb62446314610154578063de319d9914610167578063e248cff21461017c578063ec97d3b41461018f5761009e565b8063318c136e146100a35780637f79bea8146100c1578063a5c3a985146100e1578063aa50800b14610101578063b07e54bb14610121575b600080fd5b6100ab6101a2565b6040516100b8919061089f565b60405180910390f35b6100d46100cf36600461070c565b6101c6565b6040516100b891906108b3565b6100f46100ef36600461070c565b6101db565b6040516100b891906108c7565b61011461010f36600461070c565b6101f0565b6040516100b891906108be565b61013461012f3660046107af565b610202565b6040516100b891906108dc565b6100ab61014f36600461072e565b6103f5565b6100f461016236600461070c565b610410565b61017a610175366004610746565b610425565b005b61017a61018a366004610808565b610441565b61011461019d36600461070c565b6105c1565b7f000000000000000000000000000000000000000000000000000000000000000081565b60056020526000908152604090205460ff1681565b60046020526000908152604090205460e01b81565b60036020526000908152604090205481565b606061020c6105d3565b6000606061021c8486018661072e565b915061022e6020808401908688610a45565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508b815260208181526040808320546001600160a01b031680845260039092529091205494955093925050811590506102ce57828101602001516001600160a01b038916606082901c146102cc5760405162461bcd60e51b81526004016102c39061098c565b60405180910390fd5b505b6001600160a01b03821660009081526005602052604090205460ff166103065760405162461bcd60e51b81526004016102c3906109c3565b6001600160a01b03821660009081526002602052604090205460e01b6001600160e01b03198116156103e75760608185604051602001610347929190610852565b604051602081830303815290604052905060006060856001600160a01b0316836040516103749190610883565b6000604051808303816000865af19150503d80600081146103b1576040519150601f19603f3d011682016040523d82523d6000602084013e6103b6565b606091505b5091509150816103d85760405162461bcd60e51b81526004016102c390610a0e565b97506103ed9650505050505050565b50505050505b949350505050565b6000602081905290815260409020546001600160a01b031681565b60026020526000908152604090205460e01b81565b61042d6105d3565b61043a858585858561061d565b5050505050565b6104496105d3565b600060606104598385018561072e565b915061046b6020808401908587610a45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525089815260208181526040808320546001600160a01b03168084526005909252909120549495509360ff1692506104e69150505760405162461bcd60e51b81526004016102c3906109c3565b6001600160a01b03811660009081526004602052604090205460e01b6001600160e01b03198116156105b85760608184604051602001610527929190610852565b60405160208183030381529060405290506000836001600160a01b0316826040516105529190610883565b6000604051808303816000865af19150503d806000811461058f576040519150601f19603f3d011682016040523d82523d6000602084013e610594565b606091505b50509050806105b55760405162461bcd60e51b81526004016102c390610946565b50505b50505050505050565b60016020526000908152604090205481565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461061b5760405162461bcd60e51b81526004016102c39061090f565b565b60008581526020818152604080832080546001600160a01b039098166001600160a01b03199098168817905595825260018082528683209790975560028152858220805460e096871c63ffffffff199182161790915560038252868320949094556004815285822080549390951c92909316919091179092556005905220805460ff19169091179055565b80356001600160a01b03811681146106bf57600080fd5b92915050565b60008083601f8401126106d6578182fd5b50813567ffffffffffffffff8111156106ed578182fd5b60208301915083602082850101111561070557600080fd5b9250929050565b60006020828403121561071d578081fd5b61072783836106a8565b9392505050565b60006020828403121561073f578081fd5b5035919050565b600080600080600060a0868803121561075d578081fd5b8535945060208601356001600160a01b038116811461077a578182fd5b9350604086013561078a81610a9d565b92506060860135915060808601356107a181610a9d565b809150509295509295909350565b600080600080606085870312156107c4578384fd5b843593506107d586602087016106a8565b9250604085013567ffffffffffffffff8111156107f0578283fd5b6107fc878288016106c5565b95989497509550505050565b60008060006040848603121561081c578283fd5b83359250602084013567ffffffffffffffff811115610839578283fd5b610845868287016106c5565b9497909650939450505050565b6001600160e01b0319831681528151600090610875816004850160208701610a6d565b919091016004019392505050565b60008251610895818460208701610a6d565b9190910192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b6001600160e01b031991909116815260200190565b60006020825282518060208401526108fb816040850160208701610a6d565b601f01601f19169190910160400192915050565b6020808252601e908201527f73656e646572206d7573742062652062726964676520636f6e74726163740000604082015260600190565b60208082526026908201527f64656c656761746563616c6c20746f20636f6e7472616374416464726573732060408201526519985a5b195960d21b606082015260800190565b6020808252601f908201527f696e636f7272656374206465706f736974657220696e20746865206461746100604082015260600190565b6020808252602b908201527f70726f766964656420636f6e747261637441646472657373206973206e6f742060408201526a1dda1a5d195b1a5cdd195960aa1b606082015260800190565b6020808252601e908201527f63616c6c20746f20636f6e747261637441646472657373206661696c65640000604082015260600190565b60008085851115610a54578182fd5b83861115610a60578182fd5b5050820193919092039150565b60005b83811015610a88578181015183820152602001610a70565b83811115610a97576000848401525b50505050565b6001600160e01b031981168114610ab357600080fd5b5056fea26469706673582212206629f1b20a59266ba81cd21a0a9659a1ccffc5bda3d96cf6d3743ab5f1eab7cf64736f6c634300060c0033";
type GenericHandlerConstructorParams =
| [signer?: Signer]
| ConstructorParameters<typeof ContractFactory>;
const isSuperArgs = (
xs: GenericHandlerConstructorParams
): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1;
export class GenericHandler__factory extends ContractFactory {
constructor(...args: GenericHandlerConstructorParams) {
if (isSuperArgs(args)) {
super(...args);
} else {
super(_abi, _bytecode, args[0]);
}
}
deploy(
bridgeAddress: string,
overrides?: Overrides & { from?: string | Promise<string> }
): Promise<GenericHandler> {
return super.deploy(
bridgeAddress,
overrides || {}
) as Promise<GenericHandler>;
}
getDeployTransaction(
bridgeAddress: string,
overrides?: Overrides & { from?: string | Promise<string> }
): TransactionRequest {
return super.getDeployTransaction(bridgeAddress, overrides || {});
}
attach(address: string): GenericHandler {
return super.attach(address) as GenericHandler;
}
connect(signer: Signer): GenericHandler__factory {
return super.connect(signer) as GenericHandler__factory;
}
static readonly bytecode = _bytecode;
static readonly abi = _abi;
static createInterface(): GenericHandlerInterface {
return new utils.Interface(_abi) as GenericHandlerInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): GenericHandler {
return new Contract(address, _abi, signerOrProvider) as GenericHandler;
}
}