Skip to content

Commit

Permalink
Set Foundry origin for Defender (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericglau authored Jan 13, 2025
1 parent 3a4bd0d commit 453d9ff
Show file tree
Hide file tree
Showing 7 changed files with 982 additions and 40 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog

## Unreleased
## 0.3.7 (2025-01-13)

- Update documentation links. ([#88](https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades/pull/88))
- Set Foundry as client origin for Defender deployments. ([#90](https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades/pull/90))

## 0.3.6 (2024-09-24)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 zOS Global Limited
Copyright (c) 2023-2025 Zeppelin Group Ltd

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openzeppelin/foundry-upgrades",
"version": "0.3.6",
"version": "0.3.7",
"description": "Foundry library for deploying and managing upgradeable contracts",
"license": "MIT",
"files": [
Expand Down Expand Up @@ -33,7 +33,7 @@
"@openzeppelin/contracts-upgradeable": "^5.0.2",
"@openzeppelin/contracts-v4": "npm:@openzeppelin/contracts@^v4.9.6",
"@openzeppelin/contracts-upgradeable-v4": "npm:@openzeppelin/contracts-upgradeable@^v4.9.6",
"@openzeppelin/defender-deploy-client-cli": "0.0.1-alpha.9",
"@openzeppelin/defender-deploy-client-cli": "0.0.1-alpha.10",
"@openzeppelin/upgrades-core": "^1.37.0",
"hardhat": "^2.21.0",
"prettier": "^3.0.0",
Expand All @@ -43,7 +43,7 @@
"solidity-docgen": "^0.6.0-beta.36"
},
"peerDependencies": {
"@openzeppelin/defender-deploy-client-cli": "0.0.1-alpha.9",
"@openzeppelin/defender-deploy-client-cli": "0.0.1-alpha.10",
"@openzeppelin/upgrades-core": "^1.37.0"
}
}
2 changes: 2 additions & 0 deletions src/internal/DefenderDeploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ library DefenderDeploy {
inputBuilder[i++] = "--metadata";
inputBuilder[i++] = string(abi.encodePacked('"', vm.replace(defenderOpts.metadata, '"', '\\"'), '"'));
}
inputBuilder[i++] = "--origin";
inputBuilder[i++] = "Foundry";

// Create a copy of inputs but with the correct length
string[] memory inputs = new string[](i);
Expand Down
2 changes: 1 addition & 1 deletion src/internal/Versions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pragma solidity ^0.8.0;
library Versions {
// TODO add a workflow to update this automatically based on package.json
string constant UPGRADES_CORE = "^1.37.0";
string constant DEFENDER_DEPLOY_CLIENT_CLI = "0.0.1-alpha.9";
string constant DEFENDER_DEPLOY_CLIENT_CLI = "0.0.1-alpha.10";
}
16 changes: 9 additions & 7 deletions test/internal/DefenderDeploy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ contract DefenderDeployTest is Test {
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
" deploy --contractName MyContractName --contractPath test/contracts/MyContractFile.sol --chainId 31337 --buildInfoFile ",
buildInfoFile,
' --licenseType "MIT"'
' --licenseType "MIT" --origin Foundry'
)
);
}
Expand All @@ -67,7 +67,7 @@ contract DefenderDeployTest is Test {
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
" deploy --contractName WithConstructor --contractPath test/contracts/WithConstructor.sol --chainId 31337 --buildInfoFile ",
buildInfoFile,
' --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --licenseType "MIT"'
' --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --licenseType "MIT" --origin Foundry'
)
);
}
Expand Down Expand Up @@ -105,7 +105,8 @@ contract DefenderDeployTest is Test {
" deploy --contractName WithConstructor --contractPath test/contracts/WithConstructor.sol --chainId 31337 --buildInfoFile ",
buildInfoFile,
' --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --licenseType "My License Type" --relayerId my-relayer-id --salt 0xabc0000000000000000000000000000000000000000000000000000000000123 --gasLimit 100000 --gasPrice 1000000000 --maxFeePerGas 2000000000 --maxPriorityFeePerGas 500000000',
' --metadata "{ \\"commitHash\\": \\"4ae3e0d\\", \\"tag\\": \\"v1.0.0\\", \\"anyOtherField\\": \\"anyValue\\" }"'
' --metadata "{ \\"commitHash\\": \\"4ae3e0d\\", \\"tag\\": \\"v1.0.0\\", \\"anyOtherField\\": \\"anyValue\\" }"',
" --origin Foundry"
)
);
}
Expand Down Expand Up @@ -134,7 +135,7 @@ contract DefenderDeployTest is Test {
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
" deploy --contractName WithConstructor --contractPath test/contracts/WithConstructor.sol --chainId 31337 --buildInfoFile ",
buildInfoFile,
" --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --verifySourceCode false"
" --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --verifySourceCode false --origin Foundry"
)
);
}
Expand Down Expand Up @@ -163,7 +164,7 @@ contract DefenderDeployTest is Test {
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
" deploy --contractName WithConstructor --contractPath test/contracts/WithConstructor.sol --chainId 31337 --buildInfoFile ",
buildInfoFile,
" --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b"
" --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --origin Foundry"
)
);
}
Expand Down Expand Up @@ -255,7 +256,8 @@ contract DefenderDeployTest is Test {
"npx @openzeppelin/defender-deploy-client-cli@",
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
" deploy --contractName NoLicense --contractPath test/contracts/NoLicense.sol --chainId 31337 --buildInfoFile ",
buildInfoFile
buildInfoFile,
" --origin Foundry"
)
);
}
Expand All @@ -280,7 +282,7 @@ contract DefenderDeployTest is Test {
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
" deploy --contractName Unlicensed --contractPath test/contracts/Unlicensed.sol --chainId 31337 --buildInfoFile ",
buildInfoFile,
' --licenseType "None"'
' --licenseType "None" --origin Foundry'
)
);
}
Expand Down
Loading

0 comments on commit 453d9ff

Please sign in to comment.