Skip to content

Commit

Permalink
refactor: remove the allowCrosschainSuckerExtension flag, modify th…
Browse files Browse the repository at this point in the history
…e `metadata.metadata` packing to use the least significant bits instead of the most significant bits
  • Loading branch information
xBA5ED committed Oct 16, 2024
1 parent 88c3060 commit c365bae
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 30 deletions.
2 changes: 1 addition & 1 deletion lib/sphinx
Submodule sphinx updated 90 files
+5 −4 .github/workflows/docker-image.yml
+11 −19 README.md
+57 −0 docs/breaking/registration.md
+38 −31 docs/cli-existing-project.md
+19 −15 docs/cli-quickstart.md
+1 −1 package.json
+19 −0 packages/contracts/CHANGELOG.md
+1 −0 packages/contracts/contract-artifacts/sphinx/PermissionlessRelay.sol/PermissionlessRelay.json
+764,220 −0 packages/contracts/contract-artifacts/sphinx/permissionless-relay-build-info.json
+61 −0 packages/contracts/contracts/core/PermissionlessRelay.sol
+10 −11 packages/contracts/contracts/foundry/Sphinx.sol
+58 −4 packages/contracts/contracts/foundry/SphinxConstants.sol
+34 −3 packages/contracts/contracts/foundry/SphinxPluginTypes.sol
+83 −89 packages/contracts/contracts/foundry/SphinxUtils.sol
+1 −6 packages/contracts/package.json
+3 −3 packages/contracts/scripts/write-constants.ts
+30 −0 packages/contracts/sphinx.lock
+151 −14 packages/contracts/src/addresses.ts
+7 −15 packages/contracts/src/contract-info.ts
+4 −3 packages/contracts/src/ifaces.ts
+196 −2 packages/contracts/src/networks.ts
+0 −22 packages/contracts/src/utils.ts
+1 −1 packages/contracts/src/version.ts
+1 −1 packages/contracts/test/ManagedService.t.sol
+9 −15 packages/contracts/test/ScriptConfiguration.t.sol
+7 −13 packages/contracts/test/Sphinx.t.sol
+3 −4 packages/contracts/test/SphinxInitCode.sol
+8 −7 packages/contracts/test/SphinxTestUtils.sol
+5 −4 packages/contracts/test/SphinxUtils.t.sol
+0 −21 packages/contracts/test/issues/CHU572.s.sol
+1 −4 packages/contracts/test/issues/CHU663.s.sol
+0 −23 packages/contracts/test/issues/CHU663/CHU663.s.sol
+38 −0 packages/contracts/test/mocha/address.spec.ts
+0 −35 packages/contracts/test/mocha/utils.spec.ts
+44 −0 packages/core/CHANGELOG.md
+0 −7 packages/core/config/local.ts
+0 −14 packages/core/config/standard.ts
+67 −44 packages/core/hardhat.config.ts
+2 −2 packages/core/package.json
+12 −16 packages/core/src/actions/execute.ts
+3 −8 packages/core/src/actions/types.ts
+2 −4 packages/core/src/artifacts.ts
+7 −4 packages/core/src/config/types.ts
+0 −4 packages/core/src/constants.ts
+11 −1 packages/core/src/etherscan.ts
+2 −174 packages/core/src/languages/solidity/predeploys.ts
+2 −1 packages/core/src/languages/solidity/types.ts
+18 −0 packages/core/src/types.ts
+54 −95 packages/core/src/utils.ts
+16 −6 packages/core/test/convert.spec.ts
+22 −0 packages/demo/CHANGELOG.md
+4 −4 packages/demo/package.json
+18 −0 packages/demo/sphinx.lock
+2 −2 packages/demo/test/Solc.spec.ts
+22 −16 packages/demo/test/init.spec.ts
+53 −0 packages/plugins/CHANGELOG.md
+1 −5 packages/plugins/contracts/test/script/Cases.s.sol
+0 −4 packages/plugins/contracts/test/script/Empty.s.sol
+1 −5 packages/plugins/contracts/test/script/Large.s.sol
+1 −5 packages/plugins/contracts/test/script/PartiallyEmpty.s.sol
+1 −5 packages/plugins/contracts/test/script/RevertDuringSimulation.s.sol
+3 −15 packages/plugins/contracts/test/script/Simple.s.sol
+1 −4 packages/plugins/contracts/test/script/issues/CHU676.s.sol
+4 −0 packages/plugins/foundry.toml
+6 −6 packages/plugins/package.json
+3 −7 packages/plugins/script/Sample.s.sol
+12 −0 packages/plugins/script/write-version.ts
+18 −0 packages/plugins/sphinx.lock
+0 −4 packages/plugins/src/cli/context.ts
+0 −3 packages/plugins/src/cli/deploy.ts
+11 −20 packages/plugins/src/cli/propose/index.ts
+30 −5 packages/plugins/src/cli/setup.ts
+0 −8 packages/plugins/src/cli/types.ts
+1 −0 packages/plugins/src/cli/version.ts
+1 −4 packages/plugins/src/foundry/decode.ts
+37 −145 packages/plugins/src/foundry/utils/index.ts
+0 −48 packages/plugins/src/hardhat.config.js
+0 −71 packages/plugins/src/hardhat/hardhatRunner.ts
+0 −618 packages/plugins/src/hardhat/simulate.ts
+0 −1 packages/plugins/src/index.ts
+6 −8 packages/plugins/src/sample-project/index.ts
+4 −11 packages/plugins/src/sample-project/sample-contracts.ts
+2 −1 packages/plugins/src/sample-project/sample-foundry-config.ts
+5 −2 packages/plugins/test/mocha/artifacts.spec.ts
+2 −52 packages/plugins/test/mocha/cli/deploy.spec.ts
+12 −335 packages/plugins/test/mocha/cli/propose.spec.ts
+4 −135 packages/plugins/test/mocha/common.ts
+41 −151 packages/plugins/test/mocha/foundry/utils.spec.ts
+0 −11 packages/plugins/test/mocha/mock.ts
+0 −437 packages/plugins/test/mocha/simulate.spec.ts
40 changes: 30 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bananapus/721-hook",
"version": "0.0.24",
"version": "0.0.25",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -18,12 +18,12 @@
},
"dependencies": {
"@bananapus/address-registry": "^0.0.7",
"@bananapus/core": "^0.0.32",
"@bananapus/core": "^0.0.35",
"@bananapus/ownable": "^0.0.7",
"@bananapus/permission-ids": "^0.0.12",
"@bananapus/permission-ids": "^0.0.15",
"@openzeppelin/contracts": "^5.0.2",
"@prb/math": "^4.0.3",
"solady": "^0.0.248"
"solady": "^0.0.256"
},
"devDependencies": {
"@sphinx-labs/plugins": "^0.33.0"
Expand Down
3 changes: 0 additions & 3 deletions src/JB721TiersHookProjectDeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ contract JB721TiersHookProjectDeployer is JBPermissioned, IJB721TiersHookProject
allowSetController: payDataRulesetConfig.metadata.allowSetController,
allowAddAccountingContext: payDataRulesetConfig.metadata.allowAddAccountingContext,
allowAddPriceFeed: payDataRulesetConfig.metadata.allowAddPriceFeed,
allowCrosschainSuckerExtension: payDataRulesetConfig.metadata.allowCrosschainSuckerExtension,
ownerMustSendPayouts: payDataRulesetConfig.metadata.ownerMustSendPayouts,
holdFees: payDataRulesetConfig.metadata.holdFees,
useTotalSurplusForRedemptions: payDataRulesetConfig.metadata.useTotalSurplusForRedemptions,
Expand Down Expand Up @@ -311,7 +310,6 @@ contract JB721TiersHookProjectDeployer is JBPermissioned, IJB721TiersHookProject
allowSetController: payDataRulesetConfig.metadata.allowSetController,
allowAddAccountingContext: payDataRulesetConfig.metadata.allowAddAccountingContext,
allowAddPriceFeed: payDataRulesetConfig.metadata.allowAddPriceFeed,
allowCrosschainSuckerExtension: payDataRulesetConfig.metadata.allowCrosschainSuckerExtension,
ownerMustSendPayouts: payDataRulesetConfig.metadata.ownerMustSendPayouts,
holdFees: payDataRulesetConfig.metadata.holdFees,
useTotalSurplusForRedemptions: payDataRulesetConfig.metadata.useTotalSurplusForRedemptions,
Expand Down Expand Up @@ -380,7 +378,6 @@ contract JB721TiersHookProjectDeployer is JBPermissioned, IJB721TiersHookProject
allowSetController: payDataRulesetConfig.metadata.allowSetController,
allowAddAccountingContext: payDataRulesetConfig.metadata.allowAddAccountingContext,
allowAddPriceFeed: payDataRulesetConfig.metadata.allowAddPriceFeed,
allowCrosschainSuckerExtension: payDataRulesetConfig.metadata.allowCrosschainSuckerExtension,
ownerMustSendPayouts: payDataRulesetConfig.metadata.ownerMustSendPayouts,
holdFees: payDataRulesetConfig.metadata.holdFees,
useTotalSurplusForRedemptions: payDataRulesetConfig.metadata.useTotalSurplusForRedemptions,
Expand Down
3 changes: 0 additions & 3 deletions src/structs/JBPayDataHookRulesetMetadata.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ pragma solidity ^0.8.0;
/// terminals to use.
/// @custom:member allowAddPriceFeed A flag indicating if a project can add new price feeds to calculate exchange rates
/// between its tokens.
/// @custom:member allowCrosschainSuckerExtension A flag indicating if the crosschain sucker extension should be
/// allowed during this ruleset.
/// @custom:member holdFees A flag indicating if fees should be held during this ruleset.
/// @custom:member useTotalSurplusForRedemptions A flag indicating if redemptions should use the project's balance held
/// in all terminals instead of the project's local terminal balance from which the redemption is being fulfilled.
Expand All @@ -39,7 +37,6 @@ struct JBPayDataHookRulesetMetadata {
bool allowSetController;
bool allowAddAccountingContext;
bool allowAddPriceFeed;
bool allowCrosschainSuckerExtension;
bool ownerMustSendPayouts;
bool holdFees;
bool useTotalSurplusForRedemptions;
Expand Down
2 changes: 0 additions & 2 deletions test/E2E/Pay_Mint_Redeem_E2E.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ contract Test_TiersHook_E2E is TestBaseWorkflow {
ownerMustSendPayouts: false,
allowAddAccountingContext: false,
allowAddPriceFeed: false,
allowCrosschainSuckerExtension: false,
holdFees: false,
useTotalSurplusForRedemptions: false,
useDataHookForRedeem: true,
Expand Down Expand Up @@ -872,7 +871,6 @@ contract Test_TiersHook_E2E is TestBaseWorkflow {
ownerMustSendPayouts: false,
allowAddAccountingContext: false,
allowAddPriceFeed: false,
allowCrosschainSuckerExtension: false,
holdFees: false,
useTotalSurplusForRedemptions: false,
useDataHookForRedeem: true,
Expand Down
3 changes: 1 addition & 2 deletions test/unit/mintFor_mintReservesFor_Unit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,13 @@ contract Test_mintFor_mintReservesFor_Unit is UnitTestSetup {
allowSetController: false,
allowAddAccountingContext: false,
allowAddPriceFeed: false,
allowCrosschainSuckerExtension: false,
ownerMustSendPayouts: false,
holdFees: false,
useTotalSurplusForRedemptions: false,
useDataHookForPay: true,
useDataHookForRedeem: true,
dataHook: address(0),
metadata: 16 // the first 3 bits are discarded, so this is 0100.
metadata: 2
})
)
})
Expand Down
3 changes: 1 addition & 2 deletions test/unit/pay_Unit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1299,14 +1299,13 @@ contract Test_afterPayRecorded_Unit is UnitTestSetup {
allowSetController: false,
allowAddAccountingContext: false,
allowAddPriceFeed: false,
allowCrosschainSuckerExtension: false,
ownerMustSendPayouts: false,
holdFees: false,
useTotalSurplusForRedemptions: false,
useDataHookForPay: true,
useDataHookForRedeem: true,
dataHook: address(hook),
metadata: 8 // the first 3 bits are discarded, so this is 0001.
metadata: 1
})
)
})
Expand Down
2 changes: 0 additions & 2 deletions test/utils/UnitTestSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ contract UnitTestSetup is Test {
allowSetController: false,
allowAddAccountingContext: false,
allowAddPriceFeed: false,
allowCrosschainSuckerExtension: false,
ownerMustSendPayouts: false,
holdFees: false,
useTotalSurplusForRedemptions: false,
Expand Down Expand Up @@ -723,7 +722,6 @@ contract UnitTestSetup is Test {
ownerMustSendPayouts: false,
allowAddAccountingContext: false,
allowAddPriceFeed: false,
allowCrosschainSuckerExtension: false,
holdFees: false,
useTotalSurplusForRedemptions: false,
useDataHookForRedeem: false,
Expand Down

0 comments on commit c365bae

Please sign in to comment.