-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreateMorph.js
More file actions
44 lines (39 loc) · 42.7 KB
/
createMorph.js
File metadata and controls
44 lines (39 loc) · 42.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const { ethers } = require('ethers');
require('dotenv').config()
const rpc = process.env.RPC
const pk = process.env.PK
const oofAddress = process.env.OOFAddress
const ABI = [
{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address[]", "name": "signers", "type": "address[]" }, { "indexed": false, "internalType": "uint256", "name": "signerThreshold", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "payout", "type": "address" }], "name": "contractSetup", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "string", "name": "name", "type": "string" }, { "indexed": false, "internalType": "string", "name": "description", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "decimal", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timelsot", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "feedId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "mode", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "price", "type": "uint256" }], "name": "feedAdded", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "feedId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "roundId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "timestamp", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "signer", "type": "address" }], "name": "feedSigned", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "feedId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "supportvalue", "type": "uint256" }], "name": "feedSupported", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "newFee", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "cost", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "feed", "type": "uint256" }], "name": "newFeedCost", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "payout", "type": "address" }], "name": "newPayoutAddress", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "uintValue", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "addressValue", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "oracleType", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "proposer", "type": "address" }], "name": "newProposal", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "mode", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "feed", "type": "uint256" }], "name": "newRevenueMode", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "signer", "type": "address" }], "name": "newSigner", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "newThreshold", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "proposalId", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "signer", "type": "address" }], "name": "proposalSigned", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "sender", "type": "address" }], "name": "routerFeeTaken", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "signer", "type": "address" }], "name": "signerRemoved", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newPass", "type": "uint256" }], "name": "subscriptionPassPriceUpdated", "type": "event" }, { "inputs": [{ "internalType": "address", "name": "buyer", "type": "address" }, { "internalType": "uint256", "name": "duration", "type": "uint256" }], "name": "buyPass", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "string[]", "name": "names", "type": "string[]" }, { "internalType": "string[]", "name": "descriptions", "type": "string[]" }, { "internalType": "uint256[]", "name": "decimals", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "timeslots", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "feedCosts", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "revenueModes", "type": "uint256[]" }], "name": "createNewFeeds", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "uintValue", "type": "uint256" }, { "internalType": "address", "name": "addressValue", "type": "address" }, { "internalType": "uint256", "name": "proposalType", "type": "uint256" }, { "internalType": "uint256", "name": "feedId", "type": "uint256" }], "name": "createProposal", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "factoryContract", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "feedSupport", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "feedID", "type": "uint256" }], "name": "getFeed", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getFeedLength", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "feedIDs", "type": "uint256[]" }], "name": "getFeedList", "outputs": [{ "internalType": "string[]", "name": "", "type": "string[]" }, { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "feedIDs", "type": "uint256[]" }], "name": "getFeeds", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "feedIDs", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "timestamps", "type": "uint256[]" }], "name": "getHistoricalFeeds", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[]", "name": "signers_", "type": "address[]" }, { "internalType": "uint256", "name": "signerThreshold_", "type": "uint256" }, { "internalType": "address payable", "name": "payoutAddress_", "type": "address" }, { "internalType": "uint256", "name": "subscriptionPassPrice_", "type": "uint256" }, { "internalType": "address", "name": "factoryContract_", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "payoutAddress", "outputs": [{ "internalType": "address payable", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "proposalList", "outputs": [{ "internalType": "uint256", "name": "uintValue", "type": "uint256" }, { "internalType": "address", "name": "addressValue", "type": "address" }, { "internalType": "address", "name": "proposer", "type": "address" }, { "internalType": "uint256", "name": "proposalType", "type": "uint256" }, { "internalType": "uint256", "name": "proposalFeedId", "type": "uint256" }, { "internalType": "uint256", "name": "proposalActive", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "proposalId", "type": "uint256" }], "name": "signProposal", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "signerLength", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "signerThreshold", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "signers", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "feedIDs", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "values", "type": "uint256[]" }], "name": "submitFeed", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "feedIDs", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "durations", "type": "uint256[]" }, { "internalType": "address", "name": "buyer", "type": "address" }], "name": "subscribeToFeed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "subscriptionPassPrice", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "feedIds", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "values", "type": "uint256[]" }], "name": "supportFeeds", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "withdrawFunds", "outputs": [], "stateMutability": "nonpayable", "type": "function" }
];
const bc = '0x6080604052600160045534801561001557600080fd5b50613ce4806100256000396000f3fe6080604052600436106101145760003560e01c80638c604296116100a0578063c37219ba11610064578063c37219ba1461037a578063c4c1d0bf146103a3578063c6311e3f146103ce578063de11c94a14610410578063ecb76d901461043b57610114565b80638c604296146102a25780638e486eec146102be5780639da6553b146102e9578063a4a4f39014610326578063ab2730161461035157610114565b80634a45ea5c116100e75780634a45ea5c146101c15780635b8d02d714610202578063639b55ba1461022d5780637f5090041461025d578063882fd7821461028657610114565b80630f3c80b2146101195780632079fb9a1461014257806324600fc31461017f57806330c942e014610196575b600080fd5b34801561012557600080fd5b50610140600480360381019061013b9190612b3f565b61047a565b005b34801561014e57600080fd5b5061016960048036038101906101649190612d3e565b610869565b60405161017691906134c9565b60405180910390f35b34801561018b57600080fd5b506101946108a8565b005b3480156101a257600080fd5b506101ab610a1a565b6040516101b89190613836565b60405180910390f35b3480156101cd57600080fd5b506101e860048036038101906101e39190612c91565b610a20565b6040516101f995949392919061355f565b60405180910390f35b34801561020e57600080fd5b50610217610e0d565b60405161022491906134e4565b60405180910390f35b61024760048036038101906102429190612bce565b610e33565b604051610254919061353d565b60405180910390f35b34801561026957600080fd5b50610284600480360381019061027f9190612cd2565b61110d565b005b6102a0600480360381019061029b9190612cd2565b61132d565b005b6102bc60048036038101906102b79190612b03565b611508565b005b3480156102ca57600080fd5b506102d3611764565b6040516102e09190613836565b60405180910390f35b3480156102f557600080fd5b50610310600480360381019061030b9190612d3e565b61176a565b60405161031d9190613836565b60405180910390f35b34801561033257600080fd5b5061033b611782565b6040516103489190613836565b60405180910390f35b34801561035d57600080fd5b5061037860048036038101906103739190612d3e565b611788565b005b34801561038657600080fd5b506103a1600480360381019061039c9190612d67565b611b64565b005b3480156103af57600080fd5b506103b8612059565b6040516103c59190613836565b60405180910390f35b3480156103da57600080fd5b506103f560048036038101906103f09190612d3e565b612066565b6040516104079695949392919061387a565b60405180910390f35b34801561041c57600080fd5b506104256120f2565b60405161043291906134c9565b60405180910390f35b34801561044757600080fd5b50610462600480360381019061045d9190612d3e565b612116565b60405161047193929190613957565b60405180910390f35b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610509576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050090613756565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057090613696565b60405180910390fd5b60008414156105bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b490613676565b60405180910390fd5b8451841115610601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f8906136f6565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600481905550846003908051906020019061065e929190612774565b5060005b6003805490508110156107b257600073ffffffffffffffffffffffffffffffffffffffff166003828154811061069457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070d90613776565b60405180910390fd5b6001600660006003848154811061072957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610662565b50845160028190555082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a819055507ff4955da0e7ea6f8c9297d8046c39168f24abc71dd60d47c7e4e2172f28f0c93385600454600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660405161085a939291906134ff565b60405180910390a15050505050565b6003818154811061087957600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156109ae5760005b6003805490508110156109a8576003818154811061091c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600380549050478161096e57fe5b049081150290604051600060405180830381858888f1935050505015801561099a573d6000803e3d6000fd5b508080600101915050610902565b50610a18565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610a16573d6000803e3d6000fd5b505b565b60025481565b606080606080606060008651905060008167ffffffffffffffff81118015610a4757600080fd5b50604051908082528060200260200182016040528015610a765781602001602082028036833780820191505090505b50905060008267ffffffffffffffff81118015610a9257600080fd5b50604051908082528060200260200182016040528015610ac15781602001602082028036833780820191505090505b50905060008367ffffffffffffffff81118015610add57600080fd5b50604051908082528060200260200182016040528015610b0c5781602001602082028036833780820191505090505b50905060008467ffffffffffffffff81118015610b2857600080fd5b50604051908082528060200260200182016040528015610b5c57816020015b6060815260200190600190039081610b475790505b50905060008567ffffffffffffffff81118015610b7857600080fd5b50604051908082528060200260200182016040528015610bac57816020015b6060815260200190600190039081610b975790505b50905060005b8c51811015610dee57610bd78d8281518110610bca57fe5b6020026020010151612116565b888481518110610be357fe5b60200260200101888581518110610bf657fe5b60200260200101888681518110610c0957fe5b6020026020010183815250838152508381525050505060098d8281518110610c2d57fe5b602002602001015181548110610c3f57fe5b90600052602060002090600502016000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ce45780601f10610cb957610100808354040283529160200191610ce4565b820191906000526020600020905b815481529060010190602001808311610cc757829003601f168201915b5050505050838281518110610cf557fe5b602002602001018190525060098d8281518110610d0e57fe5b602002602001015181548110610d2057fe5b90600052602060002090600502016001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dc55780601f10610d9a57610100808354040283529160200191610dc5565b820191906000526020600020905b815481529060010190602001808311610da857829003601f168201915b5050505050828281518110610dd657fe5b60200260200101819052508080600101915050610bb2565b5084848484849a509a509a509a509a5050505050505091939590929450565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60608351855114610e79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e70906137b6565b60405180910390fd5b600080855167ffffffffffffffff81118015610e9457600080fd5b50604051908082528060200260200182016040528015610ec35781602001602082028036833780820191505090505b50905060005b87518110156110ff5760096040518060a001604052808a8481518110610eeb57fe5b60200260200101518152602001898481518110610f0457fe5b602002602001015181526020016000815260200160008152602001888481518110610f2b57fe5b602002602001015181525090806001815401808255809150506001900390600052602060002090600502016000909190919091506000820151816000019080519060200190610f7b9291906127fe565b506020820151816001019080519060200190610f989291906127fe565b506040820151816002015560608201518160030155608082015181600401555050848181518110610fc557fe5b602002602001015183019250611012858281518110610fe057fe5b60200260200101516007600060016009805490500381526020019081526020016000205461219590919063ffffffff16565b6007600060016009805490500381526020019081526020016000208190555060016009805490500382828151811061104657fe5b6020026020010181815250503483111561105f57600080fd5b7f98ac65ad6bf71843f1769c45ecb493aa19386b60a5eab908f85b751c90921df988828151811061108c57fe5b60200260200101518883815181106110a057fe5b60200260200101518784815181106110b457fe5b60200260200101518985815181106110c857fe5b60200260200101516001600980549050036040516110ea9594939291906135d5565b60405180910390a18080600101915050610ec9565b508092505050949350505050565b61111561221d565b8151815114611159576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115090613656565b60405180910390fd5b60005b81518110156112e1577f1460389a0c6c9278fbbacb076aa3f9f3f3696a186cd48b77be133a0cf86ba61683828151811061119257fe5b60200260200101518383815181106111a657fe5b602002602001015142336040516111c0949392919061398e565b60405180910390a14260098483815181106111d757fe5b6020026020010151815481106111e957fe5b90600052602060002090600502016003018190555081818151811061120a57fe5b6020026020010151600984838151811061122057fe5b60200260200101518154811061123257fe5b9060005260206000209060050201600201819055507fefcb85d3d3269dda28c4e34557d65acac42881bb77f9784a7ee168ddcdc83ab383828151811061127457fe5b602002602001015183838151811061128857fe5b6020026020010151426040516112a093929190613957565b60405180910390a16000600760008584815181106112ba57fe5b6020026020010151815260200190815260200160002081905550808060010191505061115c565b503373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611328573d6000803e3d6000fd5b505050565b8051825114611371576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611368906137b6565b60405180910390fd5b600080600090505b835181101561147c576113ce83828151811061139157fe5b6020026020010151600760008785815181106113a957fe5b602002602001015181526020019081526020016000205461219590919063ffffffff16565b600760008684815181106113de57fe5b602002602001015181526020019081526020016000208190555082818151811061140457fe5b6020026020010151820191507f3444f0007ac07416465c167c0d7657d48e9d410b498f8849035fc9cf9523976d84828151811061143d57fe5b602002602001015184838151811061145157fe5b60200260200101516040516114679291906138db565b60405180910390a18080600101915050611379565b50803410156114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b790613716565b60405180910390fd5b7f103515a9d6bc0233f6381d5e58df739f3078b58635e20d5dd204e558769ddc42606482816114eb57fe5b04336040516114fb929190613851565b60405180910390a1505050565b6000600a54141561154e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611545906137f6565b60405180910390fd5b610e10811015611593576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158a90613636565b60405180910390fd5b6201518081600a5402816115a357fe5b043410156115e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115dd906137d6565b60405180910390fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116116875761163f814261219590919063ffffffff16565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061171d565b6116d981600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219590919063ffffffff16565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b7f103515a9d6bc0233f6381d5e58df739f3078b58635e20d5dd204e558769ddc426032348161174857fe5b0433604051611758929190613851565b60405180910390a15050565b600a5481565b60076020528060005260406000206000915090505481565b60045481565b61179061221d565b6000600c828154811061179f57fe5b90600052602060002090600602016005015414156117f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e9906136d6565b60405180910390fd5b6001600d600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f163fd1b723c0447962b4aca81cc014e8103ab3753a07542f4edbed3e59444d67813360405161188c929190613851565b60405180910390a1600080600090505b60038054905081101561195957600d60008481526020019081526020016000206000600383815481106118cb57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561194c5781806001019250505b808060010191505061189c565b506004548110611b60576000600c838154811061197257fe5b90600052602060002090600602016003015414156119b6576119b1600c838154811061199a57fe5b9060005260206000209060060201600001546122ab565b611b3b565b6001600c83815481106119c557fe5b90600052602060002090600602016003015414156119e257611b3a565b6002600c83815481106119f157fe5b9060005260206000209060060201600301541415611a5557611a50600c8381548110611a1957fe5b906000526020600020906006020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166122ec565b611b39565b6003600c8381548110611a6457fe5b9060005260206000209060060201600301541415611ac857611ac3600c8381548110611a8c57fe5b906000526020600020906006020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166124b7565b611b38565b6004600c8381548110611ad757fe5b9060005260206000209060060201600301541415611b3757611b36600c8381548110611aff57fe5b906000526020600020906006020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166126f9565b5b5b5b5b5b6000600c8381548110611b4a57fe5b9060005260206000209060060201600501819055505b5050565b611b6c61221d565b6000600c8054905090506000831480611b855750600183145b80611b905750600783145b15611cd957600c6040518060c00160405280878152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200185815260200160008152602001600181525090806001815401808255809150506001900390600052602060002090600602016000909190919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a082015181600501555050611f71565b6005831480611ce85750600683145b15611e3057600c6040518060c00160405280878152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600181525090806001815401808255809150506001900390600052602060002090600602016000909190919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a082015181600501555050611f70565b600c6040518060c00160405280600081526020018673ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff16815260200185815260200160008152602001600181525090806001815401808255809150506001900390600052602060002090600602016000909190919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015550505b5b6001600d600083815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fa7105ed77601732b2ee4362ad1a2ca325d1983be801d553d907e0aa29dcdb79a8186868633604051612011959493929190613904565b60405180910390a17f163fd1b723c0447962b4aca81cc014e8103ab3753a07542f4edbed3e59444d67813360405161204a929190613851565b60405180910390a15050505050565b6000600980549050905090565b600c818154811061207657600080fd5b90600052602060002090600602016000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030154908060040154908060050154905086565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806000806009878154811061212c57fe5b90600052602060002090600502016002015492506009878154811061214d57fe5b90600052602060002090600502016003015491506009878154811061216e57fe5b90600052602060002090600502016004015490508282829550955095505050509193909250565b600080828401905083811015612213576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166122a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a0906136b6565b60405180910390fd5b565b80600a819055507f35a14b8b09dda49419beccb57b8ab7a2333bfeb9634690a2fdd9e62ca2b73dea816040516122e19190613836565b60405180910390a150565b60005b6003805490508110156123af578173ffffffffffffffffffffffffffffffffffffffff166003828154811061232057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156123a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239990613796565b60405180910390fd5b80806001019150506122ef565b506003819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600081548092919060010191905055506001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f3dc2a8437aef0e8d2839b5e75d0d93e6c7f43b3acf5d2ef2db79beb54cb47b3d816040516124ac91906134c9565b60405180910390a150565b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253a90613816565b60405180910390fd5b6004546001600380549050031015612590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161258790613736565b60405180910390fd5b60005b6003805490508110156126f5578173ffffffffffffffffffffffffffffffffffffffff16600382815481106125c457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156126e8576003818154811061261857fe5b9060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600260008154809291906001900391905055506000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507ffa15964370ccf7acface74df78a85aa4857e703226c446d3e24a69663dc302e7826040516126df91906134c9565b60405180910390a15b8080600101915050612593565b5050565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4bc0293774d2baff337ab66d049d9fb89b31c492a1c82fd1b53d43ac85e8da518160405161276991906134c9565b60405180910390a150565b8280548282559060005260206000209081019282156127ed579160200282015b828111156127ec5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612794565b5b5090506127fa919061288c565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282612834576000855561287b565b82601f1061284d57805160ff191683800117855561287b565b8280016001018555821561287b579182015b8281111561287a57825182559160200191906001019061285f565b5b509050612888919061288c565b5090565b5b808211156128a557600081600090555060010161288d565b5090565b60006128bc6128b784613a04565b6139d3565b905080838252602082019050828560208602820111156128db57600080fd5b60005b8581101561290b57816128f18882612a1c565b8452602084019350602083019250506001810190506128de565b5050509392505050565b600061292861292384613a30565b6139d3565b9050808382526020820190508260005b85811015612968578135850161294e8882612ac4565b845260208401935060208301925050600181019050612938565b5050509392505050565b600061298561298084613a5c565b6139d3565b905080838252602082019050828560208602820111156129a457600080fd5b60005b858110156129d457816129ba8882612aee565b8452602084019350602083019250506001810190506129a7565b5050509392505050565b60006129f16129ec84613a88565b6139d3565b905082815260208101848484011115612a0957600080fd5b612a14848285613c14565b509392505050565b600081359050612a2b81613c69565b92915050565b600081359050612a4081613c80565b92915050565b600082601f830112612a5757600080fd5b8135612a678482602086016128a9565b91505092915050565b600082601f830112612a8157600080fd5b8135612a91848260208601612915565b91505092915050565b600082601f830112612aab57600080fd5b8135612abb848260208601612972565b91505092915050565b600082601f830112612ad557600080fd5b8135612ae58482602086016129de565b91505092915050565b600081359050612afd81613c97565b92915050565b60008060408385031215612b1657600080fd5b6000612b2485828601612a1c565b9250506020612b3585828601612aee565b9150509250929050565b600080600080600060a08688031215612b5757600080fd5b600086013567ffffffffffffffff811115612b7157600080fd5b612b7d88828901612a46565b9550506020612b8e88828901612aee565b9450506040612b9f88828901612a31565b9350506060612bb088828901612aee565b9250506080612bc188828901612a1c565b9150509295509295909350565b60008060008060808587031215612be457600080fd5b600085013567ffffffffffffffff811115612bfe57600080fd5b612c0a87828801612a70565b945050602085013567ffffffffffffffff811115612c2757600080fd5b612c3387828801612a70565b935050604085013567ffffffffffffffff811115612c5057600080fd5b612c5c87828801612a9a565b925050606085013567ffffffffffffffff811115612c7957600080fd5b612c8587828801612a9a565b91505092959194509250565b600060208284031215612ca357600080fd5b600082013567ffffffffffffffff811115612cbd57600080fd5b612cc984828501612a9a565b91505092915050565b60008060408385031215612ce557600080fd5b600083013567ffffffffffffffff811115612cff57600080fd5b612d0b85828601612a9a565b925050602083013567ffffffffffffffff811115612d2857600080fd5b612d3485828601612a9a565b9150509250929050565b600060208284031215612d5057600080fd5b6000612d5e84828501612aee565b91505092915050565b60008060008060808587031215612d7d57600080fd5b6000612d8b87828801612aee565b9450506020612d9c87828801612a1c565b9350506040612dad87828801612aee565b9250506060612dbe87828801612aee565b91505092959194509250565b6000612dd68383612e2c565b60208301905092915050565b6000612dee8383612f7b565b905092915050565b6000612e0283836134ab565b60208301905092915050565b612e1781613bde565b82525050565b612e2681613ba2565b82525050565b612e3581613b90565b82525050565b612e4481613b90565b82525050565b6000612e5582613ae8565b612e5f8185613b3b565b9350612e6a83613ab8565b8060005b83811015612e9b578151612e828882612dca565b9750612e8d83613b14565b925050600181019050612e6e565b5085935050505092915050565b6000612eb382613af3565b612ebd8185613b4c565b935083602082028501612ecf85613ac8565b8060005b85811015612f0b5784840389528151612eec8582612de2565b9450612ef783613b21565b925060208a01995050600181019050612ed3565b50829750879550505050505092915050565b6000612f2882613afe565b612f328185613b5d565b9350612f3d83613ad8565b8060005b83811015612f6e578151612f558882612df6565b9750612f6083613b2e565b925050600181019050612f41565b5085935050505092915050565b6000612f8682613b09565b612f908185613b6e565b9350612fa0818560208601613c23565b612fa981613c58565b840191505092915050565b6000612fbf82613b09565b612fc98185613b7f565b9350612fd9818560208601613c23565b612fe281613c58565b840191505092915050565b6000612ffa601a83613b7f565b91507f4d696e696d756d20737562736372697074696f6e2069732031680000000000006000830152602082019050919050565b600061303a602b83613b7f565b91507f56616c7565206c656e67746820616e6420666565644944206c656e677468206460008301527f6f206e6f74206d617463680000000000000000000000000000000000000000006020830152604082019050919050565b60006130a0601383613b7f565b91507f5468726573686f6c642063616e742062652030000000000000000000000000006000830152602082019050919050565b60006130e0601783613b7f565b91507f666163746f72792063616e206e6f74206265206e756c6c0000000000000000006000830152602082019050919050565b6000613120602583613b7f565b91507f4f6e6c792061207369676e65722063616e20706572666f726d2074686973206160008301527f6374696f6e0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613186601383613b7f565b91507f50726f706f73616c206e6f7420616374697665000000000000000000000000006000830152602082019050919050565b60006131c6602883613b7f565b91507f5468726573686f6c642063616e74206265206d6f7265207468656e207369676e60008301527f657220636f756e740000000000000000000000000000000000000000000000006020830152604082019050919050565b600061322c602683613b7f565b91507f4d73672e76616c756520646f6573206e6f74206d65657420737570706f72742060008301527f76616c75657300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613292601b83613b7f565b91507f4c657373207369676e657273207468616e207468726573686f6c6400000000006000830152602082019050919050565b60006132d2601383613b7f565b91507f616c726561647920696e697469616c697a6564000000000000000000000000006000830152602082019050919050565b6000613312601083613b7f565b91507f4e6f74207a65726f2061646472657373000000000000000000000000000000006000830152602082019050919050565b6000613352601583613b7f565b91507f5369676e657220616c72656164792065786973747300000000000000000000006000830152602082019050919050565b6000613392600f83613b7f565b91507f4c656e677468206d69736d6174636800000000000000000000000000000000006000830152602082019050919050565b60006133d2601283613b7f565b91507f4e6f7420656e6f756768207061796d656e7400000000000000000000000000006000830152602082019050919050565b6000613412601c83613b7f565b91507f537562736372697074696f6e2050617373207475726e6564206f6666000000006000830152602082019050919050565b6000613452602483613b7f565b91507f4164647265737320746f2072656d6f76652068617320746f206265206120736960008301527f676e6572000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6134b481613bd4565b82525050565b6134c381613bd4565b82525050565b60006020820190506134de6000830184612e3b565b92915050565b60006020820190506134f96000830184612e1d565b92915050565b600060608201905081810360008301526135198186612e4a565b905061352860208301856134ba565b6135356040830184612e0e565b949350505050565b600060208201905081810360008301526135578184612f1d565b905092915050565b600060a08201905081810360008301526135798188612f1d565b9050818103602083015261358d8187612f1d565b905081810360408301526135a18186612f1d565b905081810360608301526135b58185612ea8565b905081810360808301526135c98184612ea8565b90509695505050505050565b600060a08201905081810360008301526135ef8188612fb4565b905081810360208301526136038187612fb4565b905061361260408301866134ba565b61361f60608301856134ba565b61362c60808301846134ba565b9695505050505050565b6000602082019050818103600083015261364f81612fed565b9050919050565b6000602082019050818103600083015261366f8161302d565b9050919050565b6000602082019050818103600083015261368f81613093565b9050919050565b600060208201905081810360008301526136af816130d3565b9050919050565b600060208201905081810360008301526136cf81613113565b9050919050565b600060208201905081810360008301526136ef81613179565b9050919050565b6000602082019050818103600083015261370f816131b9565b9050919050565b6000602082019050818103600083015261372f8161321f565b9050919050565b6000602082019050818103600083015261374f81613285565b9050919050565b6000602082019050818103600083015261376f816132c5565b9050919050565b6000602082019050818103600083015261378f81613305565b9050919050565b600060208201905081810360008301526137af81613345565b9050919050565b600060208201905081810360008301526137cf81613385565b9050919050565b600060208201905081810360008301526137ef816133c5565b9050919050565b6000602082019050818103600083015261380f81613405565b9050919050565b6000602082019050818103600083015261382f81613445565b9050919050565b600060208201905061384b60008301846134ba565b92915050565b600060408201905061386660008301856134ba565b6138736020830184612e0e565b9392505050565b600060c08201905061388f60008301896134ba565b61389c6020830188612e3b565b6138a96040830187612e3b565b6138b660608301866134ba565b6138c360808301856134ba565b6138d060a08301846134ba565b979650505050505050565b60006040820190506138f060008301856134ba565b6138fd60208301846134ba565b9392505050565b600060a08201905061391960008301886134ba565b61392660208301876134ba565b6139336040830186612e3b565b61394060608301856134ba565b61394d6080830184612e0e565b9695505050505050565b600060608201905061396c60008301866134ba565b61397960208301856134ba565b61398660408301846134ba565b949350505050565b60006080820190506139a360008301876134ba565b6139b060208301866134ba565b6139bd60408301856134ba565b6139ca6060830184612e0e565b95945050505050565b6000604051905081810181811067ffffffffffffffff821117156139fa576139f9613c56565b5b8060405250919050565b600067ffffffffffffffff821115613a1f57613a1e613c56565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613a4b57613a4a613c56565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613a7757613a76613c56565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613aa357613aa2613c56565b5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613b9b82613bb4565b9050919050565b6000613bad82613bb4565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000613be982613bf0565b9050919050565b6000613bfb82613c02565b9050919050565b6000613c0d82613bb4565b9050919050565b82818337600083830152505050565b60005b83811015613c41578082015181840152602081019050613c26565b83811115613c50576000848401525b50505050565bfe5b6000601f19601f8301169050919050565b613c7281613b90565b8114613c7d57600080fd5b50565b613c8981613ba2565b8114613c9457600080fd5b50565b613ca081613bd4565b8114613cab57600080fd5b5056fea2646970667358221220cce46530637a16ba8d0c2a273c6f04c051a218eac4003bf7ceabc9c6b03786ad64736f6c63430007060033';
const provider = new ethers.providers.JsonRpcProvider(rpc);
const walletWithProvider = new ethers.Wallet(pk, provider);
//const signers = ['0x00f0000000f11a5380da5a184f0c563b5995fee2'];
const threshold = 1
async function init() {
console.log("Deploying your Morpheus contract");
// Get the ABI (Application Binary Interface) of the contract
// Replace with the actual ABI of your contract
const wallet = new ethers.Wallet(pk, provider);
const signer = wallet.connect(provider);
const contractFactory = new ethers.ContractFactory(ABI, bc, signer);
const signers = [wallet.address];
console.log(signers);
const deployedContract = await contractFactory.deploy();
await deployedContract.deployed();
console.log("Contract address:", deployedContract.address);
// Create a contract object
const contract = new ethers.Contract(deployedContract.address, ABI, walletWithProvider);
try {
let tx = await contract.initialize(signers, threshold, '0x0000000000000000000000000000000000000000', 0, '0x0000000000000000000000000000000000000001');
const { events, cumulativeGasUsed, gasUsed, transactionHash } = await tx.wait();
console.log(`Cumulative: ${cumulativeGasUsed.toNumber()}`);
console.log(`Gas: ${gasUsed.toNumber()}`)
console.log(`hash: ${transactionHash.toString()}`)
console.log("oracle ready")
} catch (e) {
console.log(e)
}
}
init()