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
ff57ecf6
Commit
ff57ecf6
authored
Jul 18, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: attempt fix
parent
f7a8e8ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
Deployer.sol
packages/contracts-bedrock/scripts/Deployer.sol
+20
-6
No files found.
packages/contracts-bedrock/scripts/Deployer.sol
View file @
ff57ecf6
...
@@ -106,10 +106,9 @@ abstract contract Deployer is Script {
...
@@ -106,10 +106,9 @@ abstract contract Deployer is Script {
string memory contractName = _getContractNameFromDeployTransaction(deployTx);
string memory contractName = _getContractNameFromDeployTransaction(deployTx);
console.log("Syncing deployment %s: contract %s", deploymentName, contractName);
console.log("Syncing deployment %s: contract %s", deploymentName, contractName);
string memory fqn = getFullyQualifiedName(contractName);
string[] memory args = getDeployTransactionConstructorArguments(deployTx);
string[] memory args = getDeployTransactionConstructorArguments(deployTx);
bytes memory code =
vm.getCode(fqn
);
bytes memory code =
_getCode(contractName
);
bytes memory deployedCode =
vm.getDeployedCode(fqn
);
bytes memory deployedCode =
_getDeployedCode(contractName
);
string memory receipt = _getDeployReceiptByContractAddress(addr);
string memory receipt = _getDeployReceiptByContractAddress(addr);
string memory artifactPath = string.concat(deploymentsDir, "/", deploymentName, ".json");
string memory artifactPath = string.concat(deploymentsDir, "/", deploymentName, ".json");
...
@@ -267,6 +266,20 @@ abstract contract Deployer is Script {
...
@@ -267,6 +266,20 @@ abstract contract Deployer is Script {
return stdJson.readString(_deployTx, ".contractName");
return stdJson.readString(_deployTx, ".contractName");
}
}
/// @notice
function _getCode(string memory _name) returns (bytes memory) {
string memory fqn = _getFullyQualifiedName(_name);
bytes memory code = vm.getCode(fqn);
return code;
}
/// @notice
function _getDeployedCode(string memorh _name) returns (bytes memory) {
string memory fqn = _getFullyQualifiedName(_name);
bytes memory code = vm.getDeployedCode(fqn);
return code;
}
/// @notice Removes the semantic versioning from a contract name. The semver will exist if the contract is compiled more than
/// @notice Removes the semantic versioning from a contract name. The semver will exist if the contract is compiled more than
/// once with different versions of the compiler.
/// once with different versions of the compiler.
function _stripSemver(string memory _name) internal returns (string memory) {
function _stripSemver(string memory _name) internal returns (string memory) {
...
@@ -294,9 +307,10 @@ abstract contract Deployer is Script {
...
@@ -294,9 +307,10 @@ abstract contract Deployer is Script {
}
}
/// @notice Builds the fully qualified name of a contract. Assumes that the
/// @notice Builds the fully qualified name of a contract. Assumes that the
/// file name is the same as the contract name.
/// file name is the same as the contract name but strips semver for the file name.
function getFullyQualifiedName(string memory _name) internal pure returns (string memory) {
function _getFullyQualifiedName(string memory _name) internal pure returns (string memory) {
return string.concat(_name, ".sol:", _name);
string memory sanitized = _stripSemver(_name);
return string.concat(sanitized, ".sol:", _name);
}
}
/// @notice Returns the filesystem path to the artifact path. Assumes that the name of the
/// @notice Returns the filesystem path to the artifact path. Assumes that the name of the
...
...
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