Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rc v0.3.6 #45

Merged
merged 21 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ee7254d
(hub): draft impl of loosened constraint on explicit groupMint
benjaminbollen Aug 22, 2024
7e212a2
(hub): improve readability of groupmint logic, explicit collateral or…
benjaminbollen Aug 22, 2024
7be51d3
(hub): revert patch2: ie put back disabling consented flow, but excee…
benjaminbollen Aug 26, 2024
f592ae4
(hub): remove public name and symbol (because not defined in ERC1155)…
benjaminbollen Aug 26, 2024
ab2fafa
(hub): change definition of consented flow to: Minter <-T- Receiver <…
benjaminbollen Aug 26, 2024
f0f946e
(hub): align register and invite human events; also emit for migratio…
benjaminbollen Aug 26, 2024
838b1cb
(hub): change default behaviour to NOT enabling consented flow
benjaminbollen Aug 26, 2024
d577520
(hub): remove attempt for name, symbol now for good; we wont have roo…
benjaminbollen Aug 26, 2024
e68f8fa
(hub): update comment on isPermittedFlow() for default behaviour of n…
benjaminbollen Aug 26, 2024
1303e44
(hub): remove commented out event definition InviteHuman
benjaminbollen Aug 26, 2024
c259cee
(hub): anotehr comment to update for default behaviour now NOT being …
benjaminbollen Aug 26, 2024
c18e09f
(hub): recursive consented flow MRS model
benjaminbollen Aug 27, 2024
a1876f5
(hub): change welcome bonus to 48 CRC (2 days)
benjaminbollen Aug 28, 2024
ef9c1f0
(NameRegistry): remove stale comment
benjaminbollen Aug 28, 2024
c4b04d0
(demurrage): make conversion helper functions two-way inflationary an…
benjaminbollen Aug 28, 2024
899e738
(hub): allow self-registration always IFF the v1 token was stopped be…
benjaminbollen Aug 28, 2024
d9214b6
(hub): change the invite flow for humans to use trust as extended inv…
benjaminbollen Aug 28, 2024
85e5a81
Merge pull request #44 from aboutcircles/20240828-invite-over-trust
benjaminbollen Aug 28, 2024
8d1a185
(hub): correct explicit groupMint: people who have opted in to consen…
benjaminbollen Aug 28, 2024
6641047
(InflationaryCircles): prefix s- to symbols of inflationary CRC ERC20
benjaminbollen Aug 29, 2024
62cd5fc
(deploy): deploy artefacts on Gnosis Chain and Chiado as rc-v0.3.6-alpha
benjaminbollen Aug 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{"contractName":"Hub","deployedAddress":"0xb80feeDfEce647dDc709777D5094fACD157BA001","sourcePath":"src/hub/Hub.sol:Hub","constructor-args":"0xdbF22D4e8962Db3b2F1d9Ff55be728A887e47710 0x24b3fDCdD9fef844fB3094ef43c0A6Ac23a6dF9E 0x12E815963A0b910288C7256CAD0d345c8F5db08E 0xBD2D6Fbb6A702B04B750Bc9942fBaAE81187355E 0xC06ADED7950429FdF2023e139B076f6BaFf9Fe1C 1675209600 31540000 https://gateway.aboutcircles.com/v1/circles/{id}.json","argumentsFile":"constructorArgs_Hub.txt"}
{"contractName":"Migration","deployedAddress":"0x12E815963A0b910288C7256CAD0d345c8F5db08E","sourcePath":"src/migration/Migration.sol:Migration","constructor-args":"0xdbF22D4e8962Db3b2F1d9Ff55be728A887e47710 0xb80feeDfEce647dDc709777D5094fACD157BA001 1675209600","argumentsFile":"constructorArgs_Migration.txt"}
{"contractName":"NameRegistry","deployedAddress":"0x24b3fDCdD9fef844fB3094ef43c0A6Ac23a6dF9E","sourcePath":"src/names/NameRegistry.sol:NameRegistry","constructor-args":"0xb80feeDfEce647dDc709777D5094fACD157BA001","argumentsFile":"constructorArgs_NameRegistry.txt"}
{"contractName":"ERC20Lift","deployedAddress":"0xBD2D6Fbb6A702B04B750Bc9942fBaAE81187355E","sourcePath":"src/lift/ERC20Lift.sol:ERC20Lift","constructor-args":"0xb80feeDfEce647dDc709777D5094fACD157BA001 0x24b3fDCdD9fef844fB3094ef43c0A6Ac23a6dF9E 0xe7ef9F22107C5A55033c4C73595e64c9b3155b46 0x4b5bF5436dA471BECF73a7832481431AE257c6bF","argumentsFile":"constructorArgs_ERC20Lift.txt"}
{"contractName":"StandardTreasury","deployedAddress":"0xC06ADED7950429FdF2023e139B076f6BaFf9Fe1C","sourcePath":"src/treasury/StandardTreasury.sol:StandardTreasury","constructor-args":"0xb80feeDfEce647dDc709777D5094fACD157BA001 0x1be5E03E44CeD1018977510d6Ad55f8D1259a039","argumentsFile":"constructorArgs_StandardTreasury.txt"}
{"contractName":"BaseGroupMintPolicy","deployedAddress":"0xE35c66531aF28660a1CdfA3dd0b1C1C0245D2F67","sourcePath":"src/groups/BaseMintPolicy.sol:MintPolicy","constructor-args":"","argumentsFile":"constructorArgs_BaseGroupMintPolicy.txt"}
{"contractName":"MastercopyDemurrageERC20","deployedAddress":"0xe7ef9F22107C5A55033c4C73595e64c9b3155b46","sourcePath":"src/lift/DemurrageCircles.sol:DemurrageCircles","constructor-args":"","argumentsFile":"constructorArgs_MastercopyDemurrageERC20.txt"}
{"contractName":"MastercopyInflationaryERC20","deployedAddress":"0x4b5bF5436dA471BECF73a7832481431AE257c6bF","sourcePath":"src/lift/InflationaryCircles.sol:InflationaryCircles","constructor-args":"","argumentsFile":"constructorArgs_MastercopyInflationaryERC20.txt"}
{"contractName":"MastercopyStandardVault","deployedAddress":"0x1be5E03E44CeD1018977510d6Ad55f8D1259a039","sourcePath":"src/treasury/StandardVault.sol:StandardVault","constructor-args":"","argumentsFile":"constructorArgs_MastercopyStandardVault.txt"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Chiado deployment
=================
Deployment Date: 2024-08-29 20:11:37
Version: rc-0.3.6-alpha
Git Commit: 6641047a5751e46cf2129b6fbabc625ddc1eba72
Deployer Address: 0x7619F26728Ced663E50E578EB6ff42430931564c, Intitial nonce: 176
Compiler Version: v0.8.23+commit.f704f362

Deployed Contracts:
Hub: 0xb80feeDfEce647dDc709777D5094fACD157BA001
Migration: 0x12E815963A0b910288C7256CAD0d345c8F5db08E
NameRegistry: 0x24b3fDCdD9fef844fB3094ef43c0A6Ac23a6dF9E
ERC20Lift: 0xBD2D6Fbb6A702B04B750Bc9942fBaAE81187355E
StandardTreasury: 0xC06ADED7950429FdF2023e139B076f6BaFf9Fe1C
BaseGroupMintPolicy: 0xE35c66531aF28660a1CdfA3dd0b1C1C0245D2F67
MastercopyDemurrageERC20: 0xe7ef9F22107C5A55033c4C73595e64c9b3155b46
MastercopyInflationaryERC20: 0x4b5bF5436dA471BECF73a7832481431AE257c6bF
MastercopyStandardVault: 0x1be5E03E44CeD1018977510d6Ad55f8D1259a039
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xb80feeDfEce647dDc709777D5094fACD157BA001 0x24b3fDCdD9fef844fB3094ef43c0A6Ac23a6dF9E 0xe7ef9F22107C5A55033c4C73595e64c9b3155b46 0x4b5bF5436dA471BECF73a7832481431AE257c6bF
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xdbF22D4e8962Db3b2F1d9Ff55be728A887e47710 0x24b3fDCdD9fef844fB3094ef43c0A6Ac23a6dF9E 0x12E815963A0b910288C7256CAD0d345c8F5db08E 0xBD2D6Fbb6A702B04B750Bc9942fBaAE81187355E 0xC06ADED7950429FdF2023e139B076f6BaFf9Fe1C 1675209600 31540000 https://gateway.aboutcircles.com/v1/circles/{id}.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xdbF22D4e8962Db3b2F1d9Ff55be728A887e47710 0xb80feeDfEce647dDc709777D5094fACD157BA001 1675209600
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xb80feeDfEce647dDc709777D5094fACD157BA001
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xb80feeDfEce647dDc709777D5094fACD157BA001 0x1be5E03E44CeD1018977510d6Ad55f8D1259a039
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da 0x738fFee24770d0DE1f912adf2B48b0194780E9AD 0x26fA0d8A877E6A6170E4613fA7Cb0359efdb985d 0x38A8d2A38A788A388D20210ff18847EF7e13eda5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x29b9a7fBb8995b2423a71cC17cf9810798F6C543 0x738fFee24770d0DE1f912adf2B48b0194780E9AD 0xe1dCE89512bE1AeDf94faAb7115A1Ba6AEff4201 0xB6B79BeEfd58cf33b298A456934554cf440354aD 0xbb76CF35ec106c5c7a447246257dcfCB7244cA04 1602720000 31540000 https://gateway.aboutcircles.com/v1/circles/{id}.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x29b9a7fBb8995b2423a71cC17cf9810798F6C543 0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da 1602720000
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da 0x570E9D5472994543C5032c83538B41983cF4F90E
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{"contractName":"Hub","deployedAddress":"0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da","sourcePath":"src/hub/Hub.sol:Hub","constructor-args":"0x29b9a7fBb8995b2423a71cC17cf9810798F6C543 0x738fFee24770d0DE1f912adf2B48b0194780E9AD 0xe1dCE89512bE1AeDf94faAb7115A1Ba6AEff4201 0xB6B79BeEfd58cf33b298A456934554cf440354aD 0xbb76CF35ec106c5c7a447246257dcfCB7244cA04 1602720000 31540000 https://gateway.aboutcircles.com/v1/circles/{id}.json","argumentsFile":"constructorArgs_Hub.txt"}
{"contractName":"Migration","deployedAddress":"0xe1dCE89512bE1AeDf94faAb7115A1Ba6AEff4201","sourcePath":"src/migration/Migration.sol:Migration","constructor-args":"0x29b9a7fBb8995b2423a71cC17cf9810798F6C543 0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da 1602720000","argumentsFile":"constructorArgs_Migration.txt"}
{"contractName":"NameRegistry","deployedAddress":"0x738fFee24770d0DE1f912adf2B48b0194780E9AD","sourcePath":"src/names/NameRegistry.sol:NameRegistry","constructor-args":"0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da","argumentsFile":"constructorArgs_NameRegistry.txt"}
{"contractName":"ERC20Lift","deployedAddress":"0xB6B79BeEfd58cf33b298A456934554cf440354aD","sourcePath":"src/lift/ERC20Lift.sol:ERC20Lift","constructor-args":"0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da 0x738fFee24770d0DE1f912adf2B48b0194780E9AD 0x26fA0d8A877E6A6170E4613fA7Cb0359efdb985d 0x38A8d2A38A788A388D20210ff18847EF7e13eda5","argumentsFile":"constructorArgs_ERC20Lift.txt"}
{"contractName":"StandardTreasury","deployedAddress":"0xbb76CF35ec106c5c7a447246257dcfCB7244cA04","sourcePath":"src/treasury/StandardTreasury.sol:StandardTreasury","constructor-args":"0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da 0x570E9D5472994543C5032c83538B41983cF4F90E","argumentsFile":"constructorArgs_StandardTreasury.txt"}
{"contractName":"BaseGroupMintPolicy","deployedAddress":"0x5Ea08c967C69255d82a4d26e36823a720E7D0317","sourcePath":"src/groups/BaseMintPolicy.sol:MintPolicy","constructor-args":"","argumentsFile":"constructorArgs_BaseGroupMintPolicy.txt"}
{"contractName":"MastercopyDemurrageERC20","deployedAddress":"0x26fA0d8A877E6A6170E4613fA7Cb0359efdb985d","sourcePath":"src/lift/DemurrageCircles.sol:DemurrageCircles","constructor-args":"","argumentsFile":"constructorArgs_MastercopyDemurrageERC20.txt"}
{"contractName":"MastercopyInflationaryERC20","deployedAddress":"0x38A8d2A38A788A388D20210ff18847EF7e13eda5","sourcePath":"src/lift/InflationaryCircles.sol:InflationaryCircles","constructor-args":"","argumentsFile":"constructorArgs_MastercopyInflationaryERC20.txt"}
{"contractName":"MastercopyStandardVault","deployedAddress":"0x570E9D5472994543C5032c83538B41983cF4F90E","sourcePath":"src/treasury/StandardVault.sol:StandardVault","constructor-args":"","argumentsFile":"constructorArgs_MastercopyStandardVault.txt"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Gnosis Chain deployment
=================
Deployment Date: 2024-08-29 20:22:21
Version: rc-0.3.6-alpha
Git Commit: 6641047a5751e46cf2129b6fbabc625ddc1eba72
Deployer Address: 0x7619F26728Ced663E50E578EB6ff42430931564c, Initial nonce: 74
Compiler Version: v0.8.23+commit.f704f362

Deployed Contracts:
Hub: 0xa5c7ADAE2fd3844f12D52266Cb7926f8649869Da
Migration: 0xe1dCE89512bE1AeDf94faAb7115A1Ba6AEff4201
NameRegistry: 0x738fFee24770d0DE1f912adf2B48b0194780E9AD
ERC20Lift: 0xB6B79BeEfd58cf33b298A456934554cf440354aD
StandardTreasury: 0xbb76CF35ec106c5c7a447246257dcfCB7244cA04
BaseGroupMintPolicy: 0x5Ea08c967C69255d82a4d26e36823a720E7D0317
MastercopyDemurrageERC20: 0x26fA0d8A877E6A6170E4613fA7Cb0359efdb985d
MastercopyInflationaryERC20: 0x38A8d2A38A788A388D20210ff18847EF7e13eda5
MastercopyStandardVault: 0x570E9D5472994543C5032c83538B41983cF4F90E
2 changes: 1 addition & 1 deletion script/deployments/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deploy-circles",
"version": "rc-0.3.5-alpha",
"version": "rc-0.3.6-alpha",
"type": "module",
"dependencies": {
"dotenv": "^16.4.5",
Expand Down
47 changes: 47 additions & 0 deletions src/circles/BatchedDemurrage.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.24;

import "./Demurrage.sol";

contract BatchedDemurrage is Demurrage {
/**
* @notice Converts a batch of inflationary values to demurrage values for a given day since inflation_day_zero.
* @param _inflationaryValues Batch of inflationary values to convert to demurrage values.
* @param _day Day since inflation_day_zero to convert the inflationary values to demurrage values.
*/
function convertBatchInflationaryToDemurrageValues(uint256[] memory _inflationaryValues, uint64 _day)
public
pure
returns (uint256[] memory)
{
// calculate the demurrage value by multiplying the value by GAMMA^days
// note: same remark on precision as in convertInflationaryToDemurrageValue
int128 r = Math64x64.pow(GAMMA_64x64, uint256(_day));
uint256[] memory demurrageValues = new uint256[](_inflationaryValues.length);
for (uint256 i = 0; i < _inflationaryValues.length; i++) {
demurrageValues[i] = Math64x64.mulu(r, _inflationaryValues[i]);
}
return demurrageValues;
}

/**
* @notice Converts a batch of demurrage values to inflationary values for a given day since inflation_day_zero.
* @param _demurrageValues Batch of demurrage values to convert to inflationary values.
* @param _dayUpdated Day since inflation_day_zero to convert the demurrage values to inflationary values.
*/
function convertBatchDemurrageToInflationaryValues(uint256[] memory _demurrageValues, uint64 _dayUpdated)
public
pure
returns (uint256[] memory)
{
// calculate the inflationary value by dividing the value by GAMMA^days
// note: GAMMA < 1, so dividing by a power of it, returns a bigger number,
// so the numerical imprecision is introduced the least significant bits.
int128 f = Math64x64.pow(BETA_64x64, uint256(_dayUpdated));
uint256[] memory inflationaryValues = new uint256[](_demurrageValues.length);
for (uint256 i = 0; i < _demurrageValues.length; i++) {
inflationaryValues[i] = Math64x64.mulu(f, _demurrageValues[i]);
}
return inflationaryValues;
}
}
23 changes: 10 additions & 13 deletions src/circles/Demurrage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -192,23 +192,20 @@ contract Demurrage is ICirclesDemurrageErrors {
}

/**
* @notice Converts a batch of inflationary values to demurrage values for a given day since inflation_day_zero.
* @param _inflationaryValues Batch of inflationary values to convert to demurrage values.
* @param _day Day since inflation_day_zero to convert the inflationary values to demurrage values.
* @notice Converts a demurrage value to an inflationary value for a given day since inflation_day_zero.
* @param _demurrageValue Demurrage value to convert to inflationary value
* @param _dayUpdated The day the demurrage value was last updated since inflation_day_zero
*/
function convertBatchInflationaryToDemurrageValues(uint256[] memory _inflationaryValues, uint64 _day)
function convertDemurrageToInflationaryValue(uint256 _demurrageValue, uint64 _dayUpdated)
public
pure
returns (uint256[] memory)
returns (uint256)
{
// calculate the demurrage value by multiplying the value by GAMMA^days
// note: same remark on precision as in convertInflationaryToDemurrageValue
int128 r = Math64x64.pow(GAMMA_64x64, uint256(_day));
uint256[] memory demurrageValues = new uint256[](_inflationaryValues.length);
for (uint256 i = 0; i < _inflationaryValues.length; i++) {
demurrageValues[i] = Math64x64.mulu(r, _inflationaryValues[i]);
}
return demurrageValues;
// calculate the inflationary value by dividing the value by GAMMA^days
// note: GAMMA < 1, so dividing by a power of it, returns a bigger number,
// so the numerical imprecision is introduced in the least significant bits.
int128 f = Math64x64.pow(BETA_64x64, uint256(_dayUpdated));
return Math64x64.mulu(f, _demurrageValue);
}

// Internal functions
Expand Down
4 changes: 2 additions & 2 deletions src/circles/InflationaryOperator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
pragma solidity >=0.8.24;

import "../hub/IHub.sol";
import "./Demurrage.sol";
import "./BatchedDemurrage.sol";

contract InflationaryCirclesOperator is Demurrage {
contract InflationaryCirclesOperator is BatchedDemurrage {
// Storage

IHubV2 public hub;
Expand Down
4 changes: 1 addition & 3 deletions src/errors/Errors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
pragma solidity >=0.8.24;

interface IHubErrors {
error CirclesHubOnlyDuringBootstrap(uint8 code);

error CirclesHubRegisterAvatarV1MustBeStopped(address avatar, uint8 code);
error CirclesHubRegisterAvatarV1MustBeStoppedBeforeEndOfInvitationPeriod(address avatar, uint8 code);

error CirclesHubAvatarAlreadyRegistered(address avatar, uint8 code);

Expand Down
Loading
Loading