You have not set a script to run. Set it with @custom:dev-run-script NatSpec tag
I have written a simple program of Hello World in the Remix IDE.
You have not set a script to run. Set it with @custom:dev-run-script NatSpec tag
I have written a simple program of Hello World in the Remix IDE.
It's an easy fix - Just add these lines before declaring your contract.
/**
* @title ContractName
* @dev ContractDescription
* @custom:dev-run-script file_path
*/
contract ContractName {}
Learn more from here
The default workshop includes two scripts to deploy contracts:
scripts/deploy_with_ethers.ts
scripts/deploy_with_web3.ts
If you choose the first one, you have to edit it to set the name of the contract to edit, the default value is Storage
from 1_Storage.sol
.
import { deploy } from './ethers-lib'
(async () => {
try {
const result = await deploy('Storage', [])
console.log(`address: ${result.address}`)
} catch (e) {
console.log(e.message)
}
})()
Then you add at the beginning of your contract:
/**
* @title ContractName
* @dev ContractDescription
* @custom:dev-run-script scripts/deploy_with_ethers.ts
*/
contract ContractName {}
Now when you hit control+shift+S
, the contract is saved and published to the network configured in the "Deploy & run transaction" section (last icon from top to bottom on the left margin).
© 2022 - 2024 — McMap. All rights reserved.