@rev-net/core-v6 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ADMINISTRATION.md +48 -212
- package/ARCHITECTURE.md +67 -41
- package/AUDIT_INSTRUCTIONS.md +54 -108
- package/CHANGELOG.md +4 -3
- package/README.md +37 -30
- package/RISKS.md +49 -207
- package/SKILLS.md +15 -13
- package/USER_JOURNEYS.md +148 -63
- package/foundry.toml +1 -0
- package/package.json +36 -36
- package/references/operations.md +7 -0
- package/references/runtime.md +9 -0
- package/src/REVDeployer.sol +3 -2
- package/src/REVHiddenTokens.sol +48 -26
- package/src/REVLoans.sol +2 -2
- package/src/REVOwner.sol +10 -2
- package/src/interfaces/IREVHiddenTokens.sol +21 -6
- package/src/structs/REV721TiersHookFlags.sol +0 -1
- package/src/structs/REVAutoIssuance.sol +0 -1
- package/src/structs/REVBaseline721HookConfig.sol +0 -1
- package/src/structs/REVConfig.sol +0 -1
- package/src/structs/REVCroptopAllowedPost.sol +0 -1
- package/src/structs/REVDeploy721TiersHookConfig.sol +0 -1
- package/src/structs/REVDescription.sol +0 -1
- package/src/structs/REVLoan.sol +0 -1
- package/src/structs/REVLoanSource.sol +0 -1
- package/src/structs/REVStageConfig.sol +0 -1
- package/src/structs/REVSuckerDeploymentConfig.sol +0 -1
- package/test/TestAuditFixVerification.t.sol +675 -0
- package/test/TestHiddenTokens.t.sol +51 -8
- package/test/audit/CodexCrossChainBuybackRouteMismatch.t.sol +184 -0
- package/test/audit/NemesisOperatorDelegation.t.sol +77 -10
|
@@ -5,6 +5,12 @@ import {IJBController} from "@bananapus/core-v6/src/interfaces/IJBController.sol
|
|
|
5
5
|
|
|
6
6
|
/// @notice Manages hiding (burning) and revealing (re-minting) revnet tokens to exclude them from totalSupply.
|
|
7
7
|
interface IREVHiddenTokens {
|
|
8
|
+
/// @notice Emitted when a holder is allowed or disallowed to hide their own tokens.
|
|
9
|
+
/// @param revnetId The ID of the revnet.
|
|
10
|
+
/// @param holder The holder whose tokens are being allowed or disallowed.
|
|
11
|
+
/// @param isAllowed Whether the holder is allowed.
|
|
12
|
+
event SetTokenHidingAllowed(uint256 indexed revnetId, address indexed holder, bool isAllowed);
|
|
13
|
+
|
|
8
14
|
/// @notice Emitted when tokens are hidden (burned and tracked for later reveal).
|
|
9
15
|
/// @param revnetId The ID of the revnet whose tokens are hidden.
|
|
10
16
|
/// @param tokenCount The number of tokens hidden.
|
|
@@ -15,12 +21,9 @@ interface IREVHiddenTokens {
|
|
|
15
21
|
/// @notice Emitted when previously hidden tokens are revealed (re-minted).
|
|
16
22
|
/// @param revnetId The ID of the revnet whose tokens are revealed.
|
|
17
23
|
/// @param tokenCount The number of tokens revealed.
|
|
18
|
-
/// @param beneficiary The address receiving the revealed tokens.
|
|
19
24
|
/// @param holder The address whose hidden balance is decremented.
|
|
20
25
|
/// @param caller The address that revealed the tokens.
|
|
21
|
-
event RevealTokens(
|
|
22
|
-
uint256 indexed revnetId, uint256 tokenCount, address beneficiary, address holder, address caller
|
|
23
|
-
);
|
|
26
|
+
event RevealTokens(uint256 indexed revnetId, uint256 tokenCount, address holder, address caller);
|
|
24
27
|
|
|
25
28
|
/// @notice The controller that manages revnets using this contract.
|
|
26
29
|
/// @return The controller contract.
|
|
@@ -37,6 +40,12 @@ interface IREVHiddenTokens {
|
|
|
37
40
|
/// @return The total hidden token count.
|
|
38
41
|
function totalHiddenOf(uint256 revnetId) external view returns (uint256);
|
|
39
42
|
|
|
43
|
+
/// @notice Whether a holder is allowed to hide their own tokens.
|
|
44
|
+
/// @param holder The holder whose tokens are being managed.
|
|
45
|
+
/// @param revnetId The ID of the revnet.
|
|
46
|
+
/// @return Whether the holder is allowed.
|
|
47
|
+
function tokenHidingIsAllowedFor(address holder, uint256 revnetId) external view returns (bool);
|
|
48
|
+
|
|
40
49
|
/// @notice Hide tokens by burning them and tracking them for later reveal.
|
|
41
50
|
/// @dev The holder must have granted BURN_TOKENS permission to this contract.
|
|
42
51
|
/// @param revnetId The ID of the revnet whose tokens to hide.
|
|
@@ -47,7 +56,13 @@ interface IREVHiddenTokens {
|
|
|
47
56
|
/// @notice Reveal previously hidden tokens by re-minting them.
|
|
48
57
|
/// @param revnetId The ID of the revnet whose tokens to reveal.
|
|
49
58
|
/// @param tokenCount The number of tokens to reveal.
|
|
50
|
-
/// @param beneficiary The address that will receive the revealed tokens.
|
|
51
59
|
/// @param holder The address whose hidden balance to decrement.
|
|
52
|
-
function revealTokensOf(uint256 revnetId, uint256 tokenCount, address
|
|
60
|
+
function revealTokensOf(uint256 revnetId, uint256 tokenCount, address holder) external;
|
|
61
|
+
|
|
62
|
+
/// @notice Allow or disallow a holder to hide their own tokens.
|
|
63
|
+
/// @dev The caller must have `HIDE_TOKENS` permission for the revnet.
|
|
64
|
+
/// @param revnetId The ID of the revnet.
|
|
65
|
+
/// @param holder The holder to update.
|
|
66
|
+
/// @param isAllowed Whether the holder should be allowed.
|
|
67
|
+
function setTokenHidingAllowedFor(uint256 revnetId, address holder, bool isAllowed) external;
|
|
53
68
|
}
|
|
@@ -6,7 +6,6 @@ pragma solidity ^0.8.0;
|
|
|
6
6
|
/// @custom:member noNewTiersWithOwnerMinting A flag indicating if new tiers with owner minting are forbidden.
|
|
7
7
|
/// @custom:member preventOverspending A flag indicating if payments exceeding the price of minted NFTs should be
|
|
8
8
|
/// prevented.
|
|
9
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
10
9
|
struct REV721TiersHookFlags {
|
|
11
10
|
bool noNewTiersWithReserves;
|
|
12
11
|
bool noNewTiersWithVotes;
|
|
@@ -4,7 +4,6 @@ pragma solidity ^0.8.0;
|
|
|
4
4
|
/// @custom:member chainId The ID of the chain on which the mint should be honored.
|
|
5
5
|
/// @custom:member count The number of tokens that should be minted.
|
|
6
6
|
/// @custom:member beneficiary The address that will receive the minted tokens.
|
|
7
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
8
7
|
struct REVAutoIssuance {
|
|
9
8
|
uint32 chainId;
|
|
10
9
|
uint104 count;
|
|
@@ -14,7 +14,6 @@ import {REV721TiersHookFlags} from "./REV721TiersHookFlags.sol";
|
|
|
14
14
|
/// @custom:member tiersConfig The tier configuration for the NFT collection.
|
|
15
15
|
/// @custom:member flags A set of flags that configure the 721 hook. Omits `issueTokensForSplits` since revnets
|
|
16
16
|
/// always force it to `false`.
|
|
17
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
18
17
|
struct REVBaseline721HookConfig {
|
|
19
18
|
string name;
|
|
20
19
|
string symbol;
|
|
@@ -9,7 +9,6 @@ import {REVStageConfig} from "./REVStageConfig.sol";
|
|
|
9
9
|
/// @custom:member splitOperator The address that will receive the token premint and initial production split,
|
|
10
10
|
/// and who is allowed to change who the operator is. Only the operator can replace itself after deployment.
|
|
11
11
|
/// @custom:member stageConfigurations The periods of changing constraints.
|
|
12
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
13
12
|
struct REVConfig {
|
|
14
13
|
REVDescription description;
|
|
15
14
|
uint32 baseCurrency;
|
|
@@ -10,7 +10,6 @@ pragma solidity ^0.8.0;
|
|
|
10
10
|
/// @custom:member maximumSplitPercent The maximum split percent (out of JBConstants.SPLITS_TOTAL_PERCENT) that a
|
|
11
11
|
/// poster can set. 0 means splits are not allowed.
|
|
12
12
|
/// @custom:member allowedAddresses A list of addresses that are allowed to post on the category through Croptop.
|
|
13
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
14
13
|
struct REVCroptopAllowedPost {
|
|
15
14
|
uint24 category;
|
|
16
15
|
uint104 minimumPrice;
|
|
@@ -13,7 +13,6 @@ import {REVBaseline721HookConfig} from "./REVBaseline721HookConfig.sol";
|
|
|
13
13
|
/// minting 721's from tiers that allow it.
|
|
14
14
|
/// @custom:member preventSplitOperatorIncreasingDiscountPercent A flag indicating if the revnet's split operator should
|
|
15
15
|
/// be prevented from increasing the discount of a tier.
|
|
16
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
17
16
|
struct REVDeploy721TiersHookConfig {
|
|
18
17
|
REVBaseline721HookConfig baseline721HookConfiguration;
|
|
19
18
|
bytes32 salt;
|
|
@@ -6,7 +6,6 @@ pragma solidity ^0.8.0;
|
|
|
6
6
|
/// @custom:member uri The metadata URI containing revnet's info.
|
|
7
7
|
/// @custom:member salt Revnets deployed across chains by the same address with the same salt will have the same
|
|
8
8
|
/// address.
|
|
9
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
10
9
|
struct REVDescription {
|
|
11
10
|
string name;
|
|
12
11
|
string ticker;
|
package/src/structs/REVLoan.sol
CHANGED
|
@@ -9,7 +9,6 @@ import {REVLoanSource} from "./REVLoanSource.sol";
|
|
|
9
9
|
/// @custom:member prepaidFeePercent The percentage of the loan's fees that were prepaid.
|
|
10
10
|
/// @custom:member prepaidDuration The duration that the loan was prepaid for.
|
|
11
11
|
/// @custom:member source The source of the loan.
|
|
12
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
13
12
|
struct REVLoan {
|
|
14
13
|
uint112 amount;
|
|
15
14
|
uint112 collateral;
|
|
@@ -5,7 +5,6 @@ import {IJBPayoutTerminal} from "@bananapus/core-v6/src/interfaces/IJBPayoutTerm
|
|
|
5
5
|
|
|
6
6
|
/// @custom:member token The token that is being loaned.
|
|
7
7
|
/// @custom:member terminal The terminal that the loan is being made from.
|
|
8
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
9
8
|
struct REVLoanSource {
|
|
10
9
|
address token;
|
|
11
10
|
IJBPayoutTerminal terminal;
|
|
@@ -21,7 +21,6 @@ import {REVAutoIssuance} from "./REVAutoIssuance.sol";
|
|
|
21
21
|
/// cashed out. This rate is out of 10_000 (JBConstants.MAX_CASH_OUT_TAX_RATE). 0% corresponds to no tax when cashing
|
|
22
22
|
/// out.
|
|
23
23
|
/// @custom:member extraMetadata Extra info to attach set into this stage that may affect hooks.
|
|
24
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
25
24
|
struct REVStageConfig {
|
|
26
25
|
uint48 startsAtOrAfter;
|
|
27
26
|
REVAutoIssuance[] autoIssuances;
|
|
@@ -5,7 +5,6 @@ import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSucker
|
|
|
5
5
|
|
|
6
6
|
/// @custom:member deployerConfigurations The information for how to suck tokens to other chains.
|
|
7
7
|
/// @custom:member salt The salt to use for creating suckers so that they use the same address across chains.
|
|
8
|
-
// forge-lint: disable-next-line(pascal-case-struct)
|
|
9
8
|
struct REVSuckerDeploymentConfig {
|
|
10
9
|
JBSuckerDeployerConfig[] deployerConfigurations;
|
|
11
10
|
bytes32 salt;
|