Skip to content

Commit

Permalink
fix(RNSCommission): return if sent RON when zero instead of revert
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 committed Nov 5, 2024
1 parent c32e8f6 commit 9a06dcf
Show file tree
Hide file tree
Showing 7 changed files with 2,869 additions and 4,625 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
branches:
- mainnet
- testnet
- 'feature/*'
- 'features/*'
- "feature/*"
- "features/*"
pull_request:
branches:
- mainnet
- testnet
- 'feature/*'
- 'features/*'
- "feature/*"
- "features/*"

env:
FOUNDRY_PROFILE: ci
Expand All @@ -37,11 +37,6 @@ jobs:
- name: Update package with soldeer
run: forge soldeer update

- name: Recursively update dependencies
run: |
chmod +x ./update-deps.sh
./update-deps.sh
- name: Run Forge build
run: |
forge --version
Expand Down
28 changes: 24 additions & 4 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ffi = true

solc = '0.8.21'
extra_output = ["devdoc", "userdoc", "storagelayout"]
evm_version = 'istanbul'
evm_version = 'london'
use_literal_content = true
fs_permissions = [{ access = "read-write", path = "./" }]

Expand All @@ -30,6 +30,26 @@ runs = 256
runs = 256

[dependencies]
"@fdk" = { version = "0.3.0-beta", url = "https://github.com/axieinfinity/foundry-deployment-kit/archive/refs/tags/v0.3.0-beta.zip" }
"@pythnetwork-pyth-sdk-solidity" = { version = "2.2.0" }
"@openzeppelin-contracts" = { version = "4.9.3" }
"@fdk" = { version = "0.3.4-beta", url = "https://github.com/axieinfinity/foundry-deployment-kit/archive/refs/tags/v0.3.4-beta.zip" }
"@pythnetwork-pyth-sdk-solidity" = { version = "2.2.0", url = "https://github.com/pyth-network/pyth-sdk-solidity/archive/refs/tags/v2.2.0.zip" }
"@openzeppelin-contracts" = { version = "4.9.3", url = "https://github.com/OpenZeppelin/openzeppelin-contracts/archive/refs/tags/v4.9.3.zip" }

[soldeer]
# whether soldeer manages remappings
remappings_generate = false

# whether soldeer re-generates all remappings when installing, updating or uninstalling deps
remappings_regenerate = false

# whether to suffix the remapping with the version: `name-a.b.c`
remappings_version = true

# a prefix to add to the remappings ("@" would give `@name`)
remappings_prefix = "@"

# where to store the remappings ("txt" for `remappings.txt` or "config" for `foundry.toml`)
# ignored when `soldeer.toml` is used as config (uses `remappings.txt`)
remappings_location = "txt"

# whether to install sub-dependencies or not. If true this wil install the dependencies of dependencies 1 level down.
recursive_deps = true
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
],
"devDependencies": {
"dotenv": "^16.3.1",
"ethers": "6.13.3",
"hardhat": "^2.12.7",
"hardhat-deploy": "0.11.29",
"husky": "^8.0.3",
Expand All @@ -24,5 +25,6 @@
},
"scripts": {
"prepare": "husky install"
}
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
2 changes: 1 addition & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@rns-contracts/=src/
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=dependencies/@fdk-0.3.0-beta/dependencies/forge-std-1.8.2/src/
@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-4.9.3/
@openzeppelin/contracts/=dependencies/openzeppelin-4.9.3/contracts/
contract-template/=lib/contract-template/src/
@solady/=dependencies/@fdk-0.3.0-beta/dependencies/solady-0.0.206/src/
@ensdomains/ens-contracts/=lib/ens-contracts/contracts/
Expand Down
25 changes: 14 additions & 11 deletions soldeer.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
[[dependencies]]
name = "@fdk"
version = "0.3.0-beta"
source = "https://github.com/axieinfinity/foundry-deployment-kit/archive/refs/tags/v0.3.0-beta.zip"
checksum = "aabeda6cc1fe02227d26f3edd86d4af6c91e2167e8b9f1971cc1ea7ce33d34f9"

[[dependencies]]
name = "@pythnetwork-pyth-sdk-solidity"
version = "2.2.0"
source = "https://soldeer-revisions.s3.amazonaws.com/@pythnetwork-pyth-sdk-solidity/2_2_0_15-04-2024_18:50:54_pyth-sdk-solidity.zip"
checksum = "54e3bda3b27467f84c1605722f58e1d2b5a19d6ca3c24840550f1d6cf3bc2231"
version = "0.3.4-beta"
url = "https://github.com/axieinfinity/foundry-deployment-kit/archive/refs/tags/v0.3.4-beta.zip"
checksum = "d93cfa76dee3a227b2ee24d41c4afe2141fb25498eed9352d036ab13bbc16c13"
integrity = "4f0417853a563024747cba0dd88d501717c13d4387132e5b1b854da69b7486b2"

[[dependencies]]
name = "@openzeppelin-contracts"
version = "4.9.3"
source = "https://soldeer-revisions.s3.amazonaws.com/@openzeppelin-contracts/4_9_3_22-01-2024_13:13:53_contracts.zip"
checksum = "95886307069cf73310b41396c49df51801a73f31f18f62e7d05adfc2031e7725"
url = "https://github.com/OpenZeppelin/openzeppelin-contracts/archive/refs/tags/v4.9.3.zip"
checksum = "94270990c32ff2d00c06a9dabaf5b7a8e36773e017254acbb39d13733eb82960"
integrity = "5cca086987dbce97760f8a337c0d29e6383fcafaffa9662897695f17566756d0"

[[dependencies]]
name = "@pythnetwork-pyth-sdk-solidity"
version = "2.2.0"
url = "https://github.com/pyth-network/pyth-sdk-solidity/archive/refs/tags/v2.2.0.zip"
checksum = "71431ac3fe4e61ce2b8abd649d3e741277ca4dba287c2a4291d040190b8fb8da"
integrity = "845f9e662935eb347e9189da9b156f0062bcab1d372c7397777dbda609776a5c"
2 changes: 1 addition & 1 deletion src/RNSCommission.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ contract RNSCommission is Initializable, AccessControlEnumerable, INSCommission
* @dev Helper method to allocate commission and take fee into recipient address.
*/
function _allocateCommissionAndTransferToRecipient(uint256 ronAmount) internal {
if (ronAmount == 0) revert InvalidAmountOfRON();
if (ronAmount == 0) return;

uint256 length = _commissionInfos.length;
if (length == 0) revert InvalidArrayLength();
Expand Down
Loading

0 comments on commit 9a06dcf

Please sign in to comment.