forked from ethereum/remix-live
-
Notifications
You must be signed in to change notification settings - Fork 0
/
3606.plugin-etherscan.1692636579028.js.map
1 lines (1 loc) · 1.64 KB
/
3606.plugin-etherscan.1692636579028.js.map
1
{"version":3,"file":"3606.plugin-etherscan.1692636579028.js","mappings":";;;;;;;;;;AAAA,iEAAe,UAAU,SAAS,+DAA+D,QAAQ,wDAAwD,YAAY,iDAAiD,QAAQ,iEAAiE,UAAU,sJAAsJ,+BAA+B,aAAa,uNAAuN,aAAa,oeAAoe,iFAAiF,CAAC","sources":["webpack:///../../libs/remix-ws-templates/src/templates/ozerc1155/scripts/ethers-lib.ts"],"sourcesContent":["export default \"import { ethers } from 'ethers'\\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 {Number} accountIndex account index from the exposed account\\n * @return {Contract} deployed contract\\n */\\nexport const deploy = async (contractName: string, args: Array<any>, accountIndex?: number): Promise<ethers.Contract> => { \\n\\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` // Change this for different path\\n\\n const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))\\n // 'web3Provider' is a remix global variable object\\n \\n const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner(accountIndex)\\n\\n const factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer)\\n\\n const contract = await factory.deploy(...args) \\n\\n // The contract is NOT deployed yet; we must wait until it is mined\\n await contract.deployed()\\n return contract\\n}\";"],"names":[],"sourceRoot":""}