Skip to content

Commit 9a06dcf

Browse files
committed
fix(RNSCommission): return if sent RON when zero instead of revert
1 parent c32e8f6 commit 9a06dcf

File tree

7 files changed

+2869
-4625
lines changed

7 files changed

+2869
-4625
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ on:
55
branches:
66
- mainnet
77
- testnet
8-
- 'feature/*'
9-
- 'features/*'
8+
- "feature/*"
9+
- "features/*"
1010
pull_request:
1111
branches:
1212
- mainnet
1313
- testnet
14-
- 'feature/*'
15-
- 'features/*'
14+
- "feature/*"
15+
- "features/*"
1616

1717
env:
1818
FOUNDRY_PROFILE: ci
@@ -37,11 +37,6 @@ jobs:
3737
- name: Update package with soldeer
3838
run: forge soldeer update
3939

40-
- name: Recursively update dependencies
41-
run: |
42-
chmod +x ./update-deps.sh
43-
./update-deps.sh
44-
4540
- name: Run Forge build
4641
run: |
4742
forge --version

foundry.toml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ffi = true
77

88
solc = '0.8.21'
99
extra_output = ["devdoc", "userdoc", "storagelayout"]
10-
evm_version = 'istanbul'
10+
evm_version = 'london'
1111
use_literal_content = true
1212
fs_permissions = [{ access = "read-write", path = "./" }]
1313

@@ -30,6 +30,26 @@ runs = 256
3030
runs = 256
3131

3232
[dependencies]
33-
"@fdk" = { version = "0.3.0-beta", url = "https://github.com/axieinfinity/foundry-deployment-kit/archive/refs/tags/v0.3.0-beta.zip" }
34-
"@pythnetwork-pyth-sdk-solidity" = { version = "2.2.0" }
35-
"@openzeppelin-contracts" = { version = "4.9.3" }
33+
"@fdk" = { version = "0.3.4-beta", url = "https://github.com/axieinfinity/foundry-deployment-kit/archive/refs/tags/v0.3.4-beta.zip" }
34+
"@pythnetwork-pyth-sdk-solidity" = { version = "2.2.0", url = "https://github.com/pyth-network/pyth-sdk-solidity/archive/refs/tags/v2.2.0.zip" }
35+
"@openzeppelin-contracts" = { version = "4.9.3", url = "https://github.com/OpenZeppelin/openzeppelin-contracts/archive/refs/tags/v4.9.3.zip" }
36+
37+
[soldeer]
38+
# whether soldeer manages remappings
39+
remappings_generate = false
40+
41+
# whether soldeer re-generates all remappings when installing, updating or uninstalling deps
42+
remappings_regenerate = false
43+
44+
# whether to suffix the remapping with the version: `name-a.b.c`
45+
remappings_version = true
46+
47+
# a prefix to add to the remappings ("@" would give `@name`)
48+
remappings_prefix = "@"
49+
50+
# where to store the remappings ("txt" for `remappings.txt` or "config" for `foundry.toml`)
51+
# ignored when `soldeer.toml` is used as config (uses `remappings.txt`)
52+
remappings_location = "txt"
53+
54+
# whether to install sub-dependencies or not. If true this wil install the dependencies of dependencies 1 level down.
55+
recursive_deps = true

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
],
1111
"devDependencies": {
1212
"dotenv": "^16.3.1",
13+
"ethers": "6.13.3",
1314
"hardhat": "^2.12.7",
1415
"hardhat-deploy": "0.11.29",
1516
"husky": "^8.0.3",
@@ -24,5 +25,6 @@
2425
},
2526
"scripts": {
2627
"prepare": "husky install"
27-
}
28-
}
28+
},
29+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
30+
}

remappings.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@rns-contracts/=src/
22
ds-test/=lib/forge-std/lib/ds-test/src/
33
forge-std/=dependencies/@fdk-0.3.0-beta/dependencies/forge-std-1.8.2/src/
4-
@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-4.9.3/
4+
@openzeppelin/contracts/=dependencies/openzeppelin-4.9.3/contracts/
55
contract-template/=lib/contract-template/src/
66
@solady/=dependencies/@fdk-0.3.0-beta/dependencies/solady-0.0.206/src/
77
@ensdomains/ens-contracts/=lib/ens-contracts/contracts/

soldeer.lock

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
[[dependencies]]
22
name = "@fdk"
3-
version = "0.3.0-beta"
4-
source = "https://github.com/axieinfinity/foundry-deployment-kit/archive/refs/tags/v0.3.0-beta.zip"
5-
checksum = "aabeda6cc1fe02227d26f3edd86d4af6c91e2167e8b9f1971cc1ea7ce33d34f9"
6-
7-
[[dependencies]]
8-
name = "@pythnetwork-pyth-sdk-solidity"
9-
version = "2.2.0"
10-
source = "https://soldeer-revisions.s3.amazonaws.com/@pythnetwork-pyth-sdk-solidity/2_2_0_15-04-2024_18:50:54_pyth-sdk-solidity.zip"
11-
checksum = "54e3bda3b27467f84c1605722f58e1d2b5a19d6ca3c24840550f1d6cf3bc2231"
3+
version = "0.3.4-beta"
4+
url = "https://github.com/axieinfinity/foundry-deployment-kit/archive/refs/tags/v0.3.4-beta.zip"
5+
checksum = "d93cfa76dee3a227b2ee24d41c4afe2141fb25498eed9352d036ab13bbc16c13"
6+
integrity = "4f0417853a563024747cba0dd88d501717c13d4387132e5b1b854da69b7486b2"
127

138
[[dependencies]]
149
name = "@openzeppelin-contracts"
1510
version = "4.9.3"
16-
source = "https://soldeer-revisions.s3.amazonaws.com/@openzeppelin-contracts/4_9_3_22-01-2024_13:13:53_contracts.zip"
17-
checksum = "95886307069cf73310b41396c49df51801a73f31f18f62e7d05adfc2031e7725"
11+
url = "https://github.com/OpenZeppelin/openzeppelin-contracts/archive/refs/tags/v4.9.3.zip"
12+
checksum = "94270990c32ff2d00c06a9dabaf5b7a8e36773e017254acbb39d13733eb82960"
13+
integrity = "5cca086987dbce97760f8a337c0d29e6383fcafaffa9662897695f17566756d0"
14+
15+
[[dependencies]]
16+
name = "@pythnetwork-pyth-sdk-solidity"
17+
version = "2.2.0"
18+
url = "https://github.com/pyth-network/pyth-sdk-solidity/archive/refs/tags/v2.2.0.zip"
19+
checksum = "71431ac3fe4e61ce2b8abd649d3e741277ca4dba287c2a4291d040190b8fb8da"
20+
integrity = "845f9e662935eb347e9189da9b156f0062bcab1d372c7397777dbda609776a5c"

src/RNSCommission.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ contract RNSCommission is Initializable, AccessControlEnumerable, INSCommission
6767
* @dev Helper method to allocate commission and take fee into recipient address.
6868
*/
6969
function _allocateCommissionAndTransferToRecipient(uint256 ronAmount) internal {
70-
if (ronAmount == 0) revert InvalidAmountOfRON();
70+
if (ronAmount == 0) return;
7171

7272
uint256 length = _commissionInfos.length;
7373
if (length == 0) revert InvalidArrayLength();

0 commit comments

Comments
 (0)