Skip to content

Commit

Permalink
fix: random source
Browse files Browse the repository at this point in the history
  • Loading branch information
geolffreym committed Oct 22, 2024
1 parent 64757e0 commit 89fe894
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions contracts/policies/access/SubscriptionPolicy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ contract SubscriptionPolicy is BasePolicy {
);
}

// En el setup del policy Que pueda definir distribución de fees? Supongamos en el caso de plataformas que estén interesadas
// en desarrollar sobre el protocolo y quieran ganas fees? Indagar si existe un método o mecanismo ya conocido

// Usar un approach basado en hooks donde el owner apruebe la distribución de fees a N accounts con eip 712? Dentro del mismo policy?

// O usar hooks que se puedan agregar en el agreement con su dirección, digamos una lista de hooks a ejecutar en N order.

// HookDeDiatrivucion de fees
// Hook de verificación x, etc etc

// Ampliando así las capacidades de los policies?

function setup(bytes calldata init) external initializer {
(uint256 subscriptionDuration, uint256 price, address currency) = abi.decode(init, (uint256, uint256, address));
// require(isValidCurrency(currency), "Subscription: Invalid currency.");
Expand Down
4 changes: 2 additions & 2 deletions contracts/rightsmanager/RightsContentCustodian.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ contract RightsContentCustodian is Initializable, UUPSUpgradeable, GovernableUpg
/// like how a load balancer directs more traffic to servers with greater capacity.
///
/// The randomness used here is not cryptographically secure, but sufficient for this non-critical operation.
/// The random number is generated using the block hash and the sender's address, and is used to determine
/// The random number is generated using the block hash and the holder's address, and is used to determine
/// which custodian is selected.
/// @param holder The address of the content rights holder whose custodian is to be selected.
function getBalancedCustodian(address holder) public view returns (address choosen) {
Expand All @@ -133,7 +133,7 @@ contract RightsContentCustodian is Initializable, UUPSUpgradeable, GovernableUpg
// |------------50------------|--------30--------|-----20------|
// | 0 - 50 | 51 - 80 | 81 - 100 | <- acc hit range
// The first node (50%) has the highest chance, followed by the second (30%) and the third (20%).

// += weight for node i
acc += ((n - i) * C.BPS_MAX) / s;
address candidate = custodiansByHolder[holder].at(i);
Expand Down

0 comments on commit 89fe894

Please sign in to comment.