better function wrapping

pull/5370/head
yann300 2 years ago committed by Aniket
parent 5106a4441f
commit 15eff257e6
  1. 17
      apps/remix-ide/src/app/plugins/solidity-script.tsx

@ -22,11 +22,18 @@ export class SolidityScript extends Plugin {
this.call('terminal', 'log', `running ${path}...`)
let content = await this.call('fileManager', 'readFile', path)
const params = await this.call('solidity', 'getCompilerParameters')
content = `
import "hardhat/console.sol";
contract SolidityScript {
${content}
}`
import "${path}";
contract SolidityScript {
constructor () {}
function remixRun () public {
run();
}
}`
const targets = { 'script.sol': { content } }
// compile
@ -65,7 +72,7 @@ export class SolidityScript extends Plugin {
tx = {
from: accounts[0],
to: receipt.contractAddress,
data: '0xc0406226' // function run() public
data: '0x69d4394b' // function remixRun() public
}
const receiptCall = await web3.eth.sendTransaction(tx)

Loading…
Cancel
Save