Skip to content

Commit 453d9ff

Browse files
authored
Set Foundry origin for Defender (#90)
1 parent 3a4bd0d commit 453d9ff

File tree

7 files changed

+982
-40
lines changed

7 files changed

+982
-40
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Changelog
22

3-
## Unreleased
3+
## 0.3.7 (2025-01-13)
44

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

78
## 0.3.6 (2024-09-24)
89

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

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

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openzeppelin/foundry-upgrades",
3-
"version": "0.3.6",
3+
"version": "0.3.7",
44
"description": "Foundry library for deploying and managing upgradeable contracts",
55
"license": "MIT",
66
"files": [
@@ -33,7 +33,7 @@
3333
"@openzeppelin/contracts-upgradeable": "^5.0.2",
3434
"@openzeppelin/contracts-v4": "npm:@openzeppelin/contracts@^v4.9.6",
3535
"@openzeppelin/contracts-upgradeable-v4": "npm:@openzeppelin/contracts-upgradeable@^v4.9.6",
36-
"@openzeppelin/defender-deploy-client-cli": "0.0.1-alpha.9",
36+
"@openzeppelin/defender-deploy-client-cli": "0.0.1-alpha.10",
3737
"@openzeppelin/upgrades-core": "^1.37.0",
3838
"hardhat": "^2.21.0",
3939
"prettier": "^3.0.0",
@@ -43,7 +43,7 @@
4343
"solidity-docgen": "^0.6.0-beta.36"
4444
},
4545
"peerDependencies": {
46-
"@openzeppelin/defender-deploy-client-cli": "0.0.1-alpha.9",
46+
"@openzeppelin/defender-deploy-client-cli": "0.0.1-alpha.10",
4747
"@openzeppelin/upgrades-core": "^1.37.0"
4848
}
4949
}

src/internal/DefenderDeploy.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ library DefenderDeploy {
121121
inputBuilder[i++] = "--metadata";
122122
inputBuilder[i++] = string(abi.encodePacked('"', vm.replace(defenderOpts.metadata, '"', '\\"'), '"'));
123123
}
124+
inputBuilder[i++] = "--origin";
125+
inputBuilder[i++] = "Foundry";
124126

125127
// Create a copy of inputs but with the correct length
126128
string[] memory inputs = new string[](i);

src/internal/Versions.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ pragma solidity ^0.8.0;
44
library Versions {
55
// TODO add a workflow to update this automatically based on package.json
66
string constant UPGRADES_CORE = "^1.37.0";
7-
string constant DEFENDER_DEPLOY_CLIENT_CLI = "0.0.1-alpha.9";
7+
string constant DEFENDER_DEPLOY_CLIENT_CLI = "0.0.1-alpha.10";
88
}

test/internal/DefenderDeploy.t.sol

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ contract DefenderDeployTest is Test {
4040
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
4141
" deploy --contractName MyContractName --contractPath test/contracts/MyContractFile.sol --chainId 31337 --buildInfoFile ",
4242
buildInfoFile,
43-
' --licenseType "MIT"'
43+
' --licenseType "MIT" --origin Foundry'
4444
)
4545
);
4646
}
@@ -67,7 +67,7 @@ contract DefenderDeployTest is Test {
6767
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
6868
" deploy --contractName WithConstructor --contractPath test/contracts/WithConstructor.sol --chainId 31337 --buildInfoFile ",
6969
buildInfoFile,
70-
' --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --licenseType "MIT"'
70+
' --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --licenseType "MIT" --origin Foundry'
7171
)
7272
);
7373
}
@@ -105,7 +105,8 @@ contract DefenderDeployTest is Test {
105105
" deploy --contractName WithConstructor --contractPath test/contracts/WithConstructor.sol --chainId 31337 --buildInfoFile ",
106106
buildInfoFile,
107107
' --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --licenseType "My License Type" --relayerId my-relayer-id --salt 0xabc0000000000000000000000000000000000000000000000000000000000123 --gasLimit 100000 --gasPrice 1000000000 --maxFeePerGas 2000000000 --maxPriorityFeePerGas 500000000',
108-
' --metadata "{ \\"commitHash\\": \\"4ae3e0d\\", \\"tag\\": \\"v1.0.0\\", \\"anyOtherField\\": \\"anyValue\\" }"'
108+
' --metadata "{ \\"commitHash\\": \\"4ae3e0d\\", \\"tag\\": \\"v1.0.0\\", \\"anyOtherField\\": \\"anyValue\\" }"',
109+
" --origin Foundry"
109110
)
110111
);
111112
}
@@ -134,7 +135,7 @@ contract DefenderDeployTest is Test {
134135
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
135136
" deploy --contractName WithConstructor --contractPath test/contracts/WithConstructor.sol --chainId 31337 --buildInfoFile ",
136137
buildInfoFile,
137-
" --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --verifySourceCode false"
138+
" --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --verifySourceCode false --origin Foundry"
138139
)
139140
);
140141
}
@@ -163,7 +164,7 @@ contract DefenderDeployTest is Test {
163164
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
164165
" deploy --contractName WithConstructor --contractPath test/contracts/WithConstructor.sol --chainId 31337 --buildInfoFile ",
165166
buildInfoFile,
166-
" --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b"
167+
" --constructorBytecode 0x000000000000000000000000000000000000000000000000000000000000007b --origin Foundry"
167168
)
168169
);
169170
}
@@ -255,7 +256,8 @@ contract DefenderDeployTest is Test {
255256
"npx @openzeppelin/defender-deploy-client-cli@",
256257
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
257258
" deploy --contractName NoLicense --contractPath test/contracts/NoLicense.sol --chainId 31337 --buildInfoFile ",
258-
buildInfoFile
259+
buildInfoFile,
260+
" --origin Foundry"
259261
)
260262
);
261263
}
@@ -280,7 +282,7 @@ contract DefenderDeployTest is Test {
280282
Versions.DEFENDER_DEPLOY_CLIENT_CLI,
281283
" deploy --contractName Unlicensed --contractPath test/contracts/Unlicensed.sol --chainId 31337 --buildInfoFile ",
282284
buildInfoFile,
283-
' --licenseType "None"'
285+
' --licenseType "None" --origin Foundry'
284286
)
285287
);
286288
}

0 commit comments

Comments
 (0)