In remix Ide what does this notification means? "You have not set a script to run. Set it with @custom:dev-run-script NatSpec tag"
Asked Answered
S

2

7

You have not set a script to run. Set it with @custom:dev-run-script NatSpec tag

The notification message

I have written a simple program of Hello World in the Remix IDE.

Strega answered 18/11, 2022 at 16:13 Comment(0)
A
5

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

Armilda answered 21/11, 2022 at 5:30 Comment(0)
P
1

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).

Pathognomy answered 29/3, 2023 at 1:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.