Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
8677175c
Commit
8677175c
authored
Jul 18, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: fix deploy script
parent
2e1fb209
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
Deployer.sol
packages/contracts-bedrock/scripts/Deployer.sol
+14
-2
Executables.sol
packages/contracts-bedrock/scripts/Executables.sol
+2
-0
No files found.
packages/contracts-bedrock/scripts/Deployer.sol
View file @
8677175c
...
...
@@ -103,8 +103,8 @@ abstract contract Deployer is Script {
string memory deploymentName = deployments[i].name;
string memory deployTx = _getDeployTransactionByContractAddress(addr);
string memory contractName =
stdJson.readString(deployTx, ".contractName"
);
console.log("Syncing %s
", deploymen
tName);
string memory contractName =
_getContractNameFromDeployTransaction(deployTx
);
console.log("Syncing %s
: %s", deploymentName, contrac
tName);
string memory fqn = getFullyQualifiedName(contractName);
string[] memory args = getDeployTransactionConstructorArguments(deployTx);
...
...
@@ -261,6 +261,18 @@ abstract contract Deployer is Script {
return string(res);
}
/// @notice Returns the contract name from a deploy transaction. Removes the semver from the contract
// name if present.
function _getContractNameFromDeployTransaction(string memory _deployTx) internal returns (string memory) {
string memory contractName = stdJson.readString(_deployTx, ".contractName");
string[] memory cmd = new string[](3);
cmd[0] = Executables.bash;
cmd[1] = "-c";
cmd[2] = string.concat(Executables.echo, " ", contractName, " | ", Executables.sed, " -E 's/[.][0-9]+\\.[0-9]+\\.[0-9]+//g'");
bytes memory res = vm.ffi(cmd);
return string(res);
}
/// @notice Returns the constructor arguent of a deployment transaction given a transaction json.
function getDeployTransactionConstructorArguments(string memory _transaction) internal returns (string[] memory) {
string[] memory cmd = new string[](3);
...
...
packages/contracts-bedrock/scripts/Executables.sol
View file @
8677175c
...
...
@@ -8,4 +8,6 @@ library Executables {
string internal constant bash = "bash";
string internal constant jq = "jq";
string internal constant forge = "forge";
string internal constant echo = "echo";
string internal constant sed = "sed";
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment