Scripts
Most of Vulcan's modules used for testing can be used in Scripts but not all the functions are
recommended to be used in this context. A few examples are:
Accounts: Only the functions in theaccountsSafelibrary should be used. If there is a need to useunsafefunctions use theaccountsUnsafemodule exported invulcan/script.sol.Context: Only the functions in thectxSafelibrary should be used. If there is a need to useunsafefunctions use thectxUnsafemodule exported invulcan/script.sol;Forks: None of the functions in this module should be used. If there is a need to useunsafefunctions use theforksUnsafemodule exported invulcan/script.sol.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import {MyContract} from "src/MyContract.sol";
import {Script, ctx, println, request} from "vulcan/script.sol";
contract DeployScript is Script {
function run() public {
ctx.startBroadcast();
new MyContract();
ctx.stopBroadcast();
println("Notifying API");
request
.create()
.post("https://my-api.io/webhook/notify/deployment")
.send()
.expect("Failed to trigger webhook");
}
}