forked from ethereum/remix-live
-
Notifications
You must be signed in to change notification settings - Fork 0
/
278.plugin-etherscan.1692636579028.js.map
1 lines (1 loc) · 1.76 KB
/
278.plugin-etherscan.1692636579028.js.map
1
{"version":3,"file":"278.plugin-etherscan.1692636579028.js","mappings":";;;;;;;;;;AAAA,iEAAe,mCAAmC,wCAAwC,0EAA0E,QAAQ,wDAAwD,YAAY,iDAAiD,QAAQ,sDAAsD,QAAQ,2BAA2B,SAAS,gJAAgJ,sEAAsE,aAAa,uNAAuN,aAAa,0RAA0R,oEAAoE,4DAA4D,8DAA8D,8CAA8C,CAAC","sources":["webpack:///../../libs/remix-ws-templates/src/templates/gnosisSafeMultisig/scripts/web3-lib.ts"],"sourcesContent":["export default \"import Web3 from 'web3'\\nimport { Contract, ContractSendMethod, Options } from 'web3-eth-contract'\\n\\n/**\\n * Deploy the given contract\\n * @param {string} contractName name of the contract to deploy\\n * @param {Array<any>} args list of constructor' parameters\\n * @param {string} from account used to send the transaction\\n * @param {number} gas gas limit\\n * @return {Options} deployed contract\\n */\\nexport const deploy = async (contractName: string, args: Array<any>, from?: string, gas?: number): Promise<Options> => {\\n\\n const web3 = new Web3(web3Provider)\\n console.log(`deploying ${contractName}`)\\n // Note that the script needs the ABI which is generated from the compilation artifact.\\n // Make sure contract is compiled and artifacts are generated\\n const artifactsPath = `browser/contracts/artifacts/${contractName}.json`\\n\\n const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))\\n\\n const accounts = await web3.eth.getAccounts()\\n\\n const contract: Contract = new web3.eth.Contract(metadata.abi)\\n\\n const contractSend: ContractSendMethod = contract.deploy({\\n data: metadata.data.bytecode.object,\\n arguments: args\\n })\\n\\n const newContractInstance = await contractSend.send({\\n from: from || accounts[0],\\n gas: gas || 1500000\\n })\\n return newContractInstance.options \\n}\";"],"names":[],"sourceRoot":""}