foundry-devops's People
Forkers
mds1 matic0209 big-aaron bornedzed gustavoguimaraes ekmanss pterameta mon-1 fakemonkgin xaiksan1 visiok09 allwin199 chefaharoni edwinliavaa alfheimrshiven code-stan comverser feed-dev rizoom rocknet kalbhairavaa klkvr shikhar229169 kumailnaqvi354 tilakmaddy 0xhaz monteago30 noorahsmith jeremylgl2 danail-vasilev pacelliv ikpong-joseph manu-acho jjoshm gogog01-29-2021 splashbeyond eridianalpha 0xjonaseb11 snowieoxs brefo-2986286 mill1995 killer-block-coder-95 bunsdev pitrikyan pr0x2b okpainmo fabieugene nastyqueen jessandrichfoundry-devops's Issues
Facing Error - No contract deployed
Doesn't work with foundry-zksync
Run the test suite with foundry-zksync, and the tests fail
[Improvement] use `fs_permission` instead of `ffi`
I just went through your course, and you propose to change the code to work with Foundry fs_permission
instead of allowing ffi
Example of where it can be useful in Cyfrin course lesson
avoid deployment of library contract
on the 0.1.0 tag:
if you call the get_most_recent_deployment function outside the broadcast and then deploy a contract in the same script it will deploy an additional DevOpsTools contract as a library.
on the master branch:
if you provide 3 arguments to the get_most_recent_deployment outside the broadcast and then deploy a contract in the same script it will deploy an additional DevOpsTools contract as a library.
PR: #19
Add Details to update forge-std library
As mentioned in the above comment cheat codes like Vm.DirEntry[]
and vm.keyExists
are available only in the versions above 6.0.
Another issue I noticed is If we don't update forge-std lib. During contract verification, only the DevOpsTools
contract is verified.
Adding commands mentioned in the original PR will help.
forge rm forge-std -f
forge install foundry-rs/[email protected]
I am willing to make these changes.
Import Errors in DevOpsTools.sol
foundry-devops/src/DevOpsTools.sol
Lines 5 to 8 in 53e22e4
While using the above lines of code. I am getting an error file not found.
I have replaced it with relative paths and it worked.
import {Vm} from "../../forge-std/src/Vm.sol";
import {stdJson} from "../../forge-std/src/StdJson.sol";
import {StdCheatsSafe} from "../../forge-std/src/StdCheats.sol";
import {console} from "../../forge-std/src/console.sol";
Let me know If I am missing something.
`vm.keyExists` has been deprecated
I'm currently writing the Lesson 19: Create integration
tutorial from Section 1: Fund Me
. In there we use the DevOpsTools.get_most_recent_deployment
function to get the most recently deployed address of FundMe
. The project doesn't build for the following reason:
[⠰] Compiling...
[⠒] Compiling 29 files with Solc 0.8.19
[⠢] Solc 0.8.19 finished in 578.90ms
Error:
Compiler run failed:
Error (9582): Member "keyExists" not found or not visible after argument-dependent lookup in contract Vm.
--> lib/foundry-devops/src/DevOpsTools.sol:119:13:
|
119 | if (vm.keyExists(json, "$.transactions[0].rpc")) {
|
Searching for keyExists
in the Foundry Handbook we find out that this cheatcode has been deprecated in favor of keyExistsJson
.
I tried replacing the keyExists
in lib/foundry-devops/src/DevOpsTools.sol:119
with keyExistsJson
but it errored out due to:
[⠰] Compiling...
[⠊] Compiling 29 files with Solc 0.8.19
[⠒] Solc 0.8.19 finished in 559.33ms
Error:
Compiler run failed:
Error (9582): Member "keyExistsJson" not found or not visible after argument-dependent lookup in contract Vm.
--> lib/foundry-devops/src/DevOpsTools.sol:119:13:
|
119 | if (vm.keyExistsJson(json, "$.transactions[0].rpc")) {
| ^^^^^^^^^^^^^^^^
I searched for this function in the Vm.sol
of the forge-std
that foundry-devops
uses and it's not there because the forge-std
is too old.
Please update the forge-std
libray and replace vm.keyExists
with vm.keyExistsJson
at foundry-devops/src/DevOpsTools.sol:119
"No contract deployed" error, no known non-standard file location
Hi, I'd like to sort out a "no contract deployed" error while deploying to the Arbitrum testnet. Here were the steps I took:
- forge init
- install foundry-devops
- deploy "ConfigManager" contract from
src/ConfigManager.sol
with scriptConfigManager.s.sol
(below) - confirm that
broadcast/ConfigManager.s.sol/421613/run-latest.json
exists - attempt to run
GetConfigManager.s.sol
which uses foundry-devops to retrieve the latest deployment - get "No contract deployed" error
- check paths/try relative/absolute paths - nothing seems to be misplaced, still getting error
- scratch head for a while, time to ask the expert. glad to provide any other info
Thanks in advance for any advice!
-curion
ConfigManager.s.sol:
pragma solidity ^0.8.15;
import {ConfigManager} from "src/ConfigManager.sol";
import "lib/forge-std/src/Script.sol";
contract ConfigDeployScript is Script {
ConfigManager public config;
function run() public {
vm.startBroadcast(vm.envUint("PRIVATE_KEY"));
config = new ConfigManager();
vm.stopBroadcast();
}
}
GetConfigManager.s.sol:
pragma solidity ^0.8.15;
import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol";
import {ConfigManager} from "src/ConfigManager.sol";
import "lib/forge-std/src/Script.sol";
contract GetConfigScript is Script {
ConfigManager public config;
uint256 public CHAIN_ID = 421613;
function run() public {
vm.startBroadcast(vm.envUint("PRIVATE_KEY"));
address configAddress = DevOpsTools.get_most_recent_deployment("ConfigManager", CHAIN_ID);
config = ConfigManager(configAddress);
vm.stopBroadcast();
}
}
Traces:
[777837] → new DevOpsTools@0x4B56260B13555A87725dF82Fe524E0e7afB74409
└─ ← 3885 bytes of code
[362678] → new GetConfigScript@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
└─ ← 1477 bytes of code
[76886] GetConfigScript::run()
├─ [0] VM::envUint(PRIVATE_KEY) [staticcall]
│ └─ ← <env var value>
├─ [0] VM::startBroadcast(<pk>)
│ └─ ← ()
├─ [46254] DevOpsTools::e374cdf1(00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000066eed000000000000000000000000000000000000000000000000000000000000000d436f6e6669674d616e6167657200000000000000000000000000000000000000) [delegatecall]
│ ├─ [0] VM::ffi([pwd])
│ │ └─ ← 0x2f686f6d652f637572696f6e2f63727970746f5f6465762f7a4b6172726f742f6b6172726f742d617262
│ ├─ [0] VM::toString(421613) [staticcall]
│ │ └─ ← 0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000063432313631330000000000000000000000000000000000000000000000000000
│ ├─ [0] VM::ffi([bash, /home/curion/crypto_dev/projectname/projectname-arb/lib/foundry-devops/src/get_recent_deployment.sh, ConfigManager, 421613, /home/curion/crypto_dev/projectname/projectname-arb//broadcast])
│ │ └─ ← 0x0000000000000000000000000000000000000000
│ ├─ [0] console::log(Return Data:) [staticcall]
│ │ └─ ← ()
│ ├─ [0] console::log(0x0000000000000000000000000000000000000000) [staticcall]
│ │ └─ ← ()
│ └─ ← 0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000144e6f20636f6e7472616374206465706c6f796564000000000000000000000000
└─ ← "No contract deployed"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.