Skip to content

Commit

Permalink
Resolve Solhint issues in Script
Browse files Browse the repository at this point in the history
  • Loading branch information
YamenMerhi committed Jul 27, 2024
1 parent a469741 commit 9bba319
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions script/Greeting.s.sol
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "forge-std/Script.sol";
import {VyperDeployer} from "../lib/utils/VyperDeployer.sol";
import {IGreeting} from "../interfaces/IGreeting.sol";
import {Script} from "forge-std/Script.sol";

///@notice This cheat codes interface is named _CheatCodes so you can use the CheatCodes interface in other testing files without errors
// solhint-disable-next-line contract-name-camelcase
interface _CheatCodes {
function ffi(string[] calldata) external returns (bytes memory);
}

contract GreetingScript is Script {
address constant HEVM_ADDRESS =
address public constant HEVM_ADDRESS =
address(bytes20(uint160(uint256(keccak256("hevm cheat code")))));

/// @notice Initializes cheat codes in order to use ffi to compile Vyper contracts
_CheatCodes cheatCodes = _CheatCodes(HEVM_ADDRESS);
_CheatCodes public cheatCodes = _CheatCodes(HEVM_ADDRESS);

string public constant INITIAL_GREETING = "yoSnakes";
function run() external {
Expand All @@ -36,11 +35,13 @@ contract GreetingScript is Script {

///@notice deploy the bytecode with the create instruction
address deployedAddress;
// solhint-disable-next-line no-inline-assembly
assembly {
deployedAddress := create(0, add(bytecode, 0x20), mload(bytecode))
}

///@notice check that the deployment was successful
// solhint-disable-next-line gas-custom-errors
require(deployedAddress != address(0), "Could not deploy contract");

vm.stopBroadcast();
Expand Down

0 comments on commit 9bba319

Please sign in to comment.