Skip to content

Commit

Permalink
Merge branch 'dev' into small-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Corantin authored Dec 11, 2024
2 parents 57242e3 + effe34f commit 3239afe
Show file tree
Hide file tree
Showing 43 changed files with 7,130 additions and 993 deletions.
2 changes: 1 addition & 1 deletion apps/web/configs/subgraph.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"VERSION_TESTNET": "0.2.4",
"VERSION_TESTNET": "0.3.0",
"VERSION_PROD": "0.1.7"
}
1,740 changes: 1,740 additions & 0 deletions broadcast/DeployCVMultiChain.s.sol/421614/run-1733940928.json

Large diffs are not rendered by default.

2,141 changes: 2,141 additions & 0 deletions broadcast/DeployCVMultiChain.s.sol/421614/run-1733941626.json

Large diffs are not rendered by default.

2,141 changes: 2,141 additions & 0 deletions broadcast/DeployCVMultiChain.s.sol/421614/run-1733942022.json

Large diffs are not rendered by default.

1,711 changes: 854 additions & 857 deletions broadcast/DeployCVMultiChain.s.sol/421614/run-latest.json

Large diffs are not rendered by default.

130 changes: 130 additions & 0 deletions broadcast/DeployPassportScorer.s.sol/421614/run-1733941715.json

Large diffs are not rendered by default.

100 changes: 50 additions & 50 deletions broadcast/DeployPassportScorer.s.sol/421614/run-latest.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/contracts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ deploy-arbsep:
--sig "run(string)" 'arbsepolia' \
--account pkGarden \
--etherscan-api-key $(ARBISCAN_API_KEY) \
--ffi \
--chain-id 421614 \
--ffi \
--broadcast \
--legacy \
--via-ir \
Expand All @@ -140,9 +140,9 @@ upgrade-arbsep:
--sig "run(string)" 'arbsepolia' \
--account pkGarden \
--etherscan-api-key $(ARBISCAN_API_KEY) \
--chain-id 421614 \
--ffi \
--broadcast \
--chain-id 421614 \
--legacy \
--via-ir \
--verify \
Expand Down
27 changes: 6 additions & 21 deletions pkg/contracts/config/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,12 @@
"ARBITRATOR": "0x05EC011e0d8B4d2add98e1cc4AC7DF38a95EF4Ed"
},
"PROXIES": {
"PASSPORT_SCORER": "0x2053E225672776deb23Af0A3EBa9CE2c87838a72",
"REGISTRY_FACTORY": "0x2689b1e4afcbfb393d9727fba2ab52930035ee85",
"REGISTRY_COMMUNITIES": [
"0x56eebe0562742156fce122221fa0eeda316e1be4",
"0x8ba06d3e65b57a1846fbf11dff9280eaec59812e"
],
"CV_STRATEGIES": [
"0x3b94eba8237b86679a89b2abc744e5012a500329",
"0x59bd760d23ebe8f40906952052de48569ad6faac",
"0x5dc78c00a5d39060a81ade81de5c3592899be1dd",
"0x6a7608ed70439c42e0802b4c81ef7eb5ba3b0d0b",
"0x7623b17736a231d1d05bcdecc8a992fd93355e6d",
"0x89c99895efb30a86c38b511d093f786a5a64d037",
"0x8b80c598b66ccfe94fbddcedac5c305ab00a242c",
"0xb1d70992f85449807e23573cc27ea8c240d8a688",
"0xc1af6e7a17f1114a4ba13ba86271492aab0291ed",
"0xe1fe0c77166350852cddbcf12ec4cb99e22694ed",
"0xe28de81057a4f5efae0a85eced25126de79990e0",
"0xf606cf11c1acd0685c4bef5dce92f4620ca49ef5"
]
}
"REGISTRY_FACTORY": "0x2d5b61124DFf3c3bEDe39620b591b10325f629a2",
"REGISTRY_COMMUNITIES": [],
"CV_STRATEGIES": [],
"PASSPORT_SCORER": "0xD5a38e558582D32FfdC3b3a1A9f4D0D56e8b3115"
},
"hash": "e596185446f651fa26c2f05b954d6c674e7888a0"
},
{
"name": "opsepolia",
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/CVStrategyV0_0.sol/CVStrategyV0_0.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/CVStrategyV0_0.sol/IPointStrategy.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/CollateralVault.sol/CollateralVault.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/contracts/out/ERC20.sol/ERC20.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/ERC20/IERC20.sol/IERC20.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/FAllo.sol/FAllo.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/GV2ERC20.sol/GV2ERC20.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/IAllo.sol/IAllo.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/IArbitrator.sol/IArbitrator.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/IERC20.sol/IERC20.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/IERC20Metadata.sol/IERC20Metadata.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/IERC20Permit.sol/IERC20Permit.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/IRegistry.sol/IRegistry.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/ISafe.sol/Enum.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/ISafe.sol/ISafe.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/ISafe.sol/SafeProxyFactory.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/PassportScorer.sol/PassportScorer.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/SafeArbitrator.sol/SafeArbitrator.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/SafeERC20.sol/SafeERC20.json

Large diffs are not rendered by default.

This file was deleted.

6 changes: 3 additions & 3 deletions pkg/contracts/script/DeployCVMultiChain.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ contract DeployCVMultiChain is Native, CVStrategyHelpers, Script, SafeSetup {

address BENEFICIARY = 0xb05A948B5c1b057B88D381bDe3A375EfEA87EbAD;

address public PROXY_OWNER = 0xD28473FbD87183864CAc0482DBEe1C54EE3d8Cd1;
address public PROXY_OWNER = 0x333837ec0D4F3D9b3dF0216996a148B46ce3541b;
RegistryFactoryV0_0 public REGISTRY_FACTORY; // = RegistryFactoryV0_0(0xd7b72Fcb6A4e2857685175F609D1498ff5392E46);
PassportScorer PASSPORT_SCORER = PassportScorer(0x32Fe66622a4D4607241AC723e23Fef487ACDABb5);
SafeArbitrator ARBITRATOR = SafeArbitrator(0x5534FECacD5f84e22C0aBA9ea9813ff594D37262);
PassportScorer PASSPORT_SCORER = PassportScorer(0xD5a38e558582D32FfdC3b3a1A9f4D0D56e8b3115);
SafeArbitrator ARBITRATOR = SafeArbitrator(0x05EC011e0d8B4d2add98e1cc4AC7DF38a95EF4Ed);

uint256 councilMemberPKEnv;
address allo_proxy;
Expand Down
14 changes: 9 additions & 5 deletions pkg/contracts/src/CVStrategy/CVStrategyV0_0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1061,14 +1061,18 @@ contract CVStrategyV0_0 is BaseStrategyUpgradeable, IArbitrable, IPointStrategy,
) >> 64;

if (totalEffectiveActivePoints() != 0) {
uint256 thresholdOverride = (
((cvParams.minThresholdPoints / totalEffectiveActivePoints()) * D)
* (getMaxConviction(totalEffectiveActivePoints()))
) / 10 ** 11;
uint256 thresholdOverride = calculateThresholdOverride();
_threshold = _threshold > thresholdOverride ? _threshold : thresholdOverride;
}
}

function calculateThresholdOverride() public view virtual returns (uint256) {
return (
(cvParams.minThresholdPoints * D * getMaxConviction(totalEffectiveActivePoints()))
/ (totalEffectiveActivePoints())
) / 10 ** 7;
}

/**
* Multiply _a by _b / 2^128. Parameter _a should be less than or equal to
* 2^128 and parameter _b should be less than 2^128.
Expand Down Expand Up @@ -1227,7 +1231,7 @@ contract CVStrategyV0_0 is BaseStrategyUpgradeable, IArbitrable, IPointStrategy,

function setSybilScorer(address _sybilScorer, uint256 threshold) external virtual {
if (msg.sender != address(registryCommunity.councilSafe()) && msg.sender != owner()) {
revert OnlyCouncilSafe();
revert OnlyCouncilSafe();
}
_revertZeroAddress(_sybilScorer);
sybilScorer = ISybilScorer(_sybilScorer);
Expand Down
8 changes: 4 additions & 4 deletions pkg/subgraph/config/arbsepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"dataSources": [
{
"name": "RegistryFactoryV0_0",
"startBlock": 95965509,
"address": "0x2689b1e4afcbfb393d9727fba2ab52930035ee85",
"startBlock": 105896653,
"address": "0x2d5b61124DFf3c3bEDe39620b591b10325f629a2",
"customTemplate": "registryFactory"
},
{
"name": "PassportScorer",
"startBlock": 95965509,
"address": "0x2053E225672776deb23Af0A3EBa9CE2c87838a72",
"startBlock": 105896653,
"address": "0xD5a38e558582D32FfdC3b3a1A9f4D0D56e8b3115",
"customTemplate": "passportScorer"
}
]
Expand Down
42 changes: 21 additions & 21 deletions pkg/subgraph/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ schema:
dataSources:
- kind: ethereum/contract
name: RegistryFactoryV0_0
network: localhost
network: arbitrum-sepolia
context:
chainId:
chainId:
type: Int
data: 1337
data: 421614
source:
address: "0xb7f8bc63bbcad18155201308c8f3540b07f84f5e"
address: "0x2d5b61124DFf3c3bEDe39620b591b10325f629a2"
abi: RegistryFactoryV0_0
startBlock: 0
startBlock: 105896653
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand All @@ -33,22 +33,22 @@ dataSources:
- event: CommunityValiditySet(address,bool)
handler: handleCommunityValiditySet
- event: ProtocolFeeSet(address,uint256)
handler: handleProtocolFeeSet
handler: handleProtocolFeeSet
- event: Initialized(uint8)
handler: handleRegistryInitialized
handler: handleRegistryInitialized
file: ./src/mappings/registry-factory.ts

- kind: ethereum/contract
name: PassportScorer
network: localhost
network: arbitrum-sepolia
context:
chainId:
chainId:
type: Int
data: 1337
data: 421614
source:
address: "0x0165878a594ca255338adfa4d48449f69242eb8f"
address: "0xD5a38e558582D32FfdC3b3a1A9f4D0D56e8b3115"
abi: PassportScorer
startBlock: 0
startBlock: 105896653
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down Expand Up @@ -78,7 +78,7 @@ dataSources:
templates:
- kind: ethereum/contract
name: RegistryCommunityV0_0
network: localhost
network: arbitrum-sepolia
source:
abi: RegistryCommunityV0_0
mapping:
Expand All @@ -100,7 +100,7 @@ templates:
file: ../contracts/out/CVStrategyV0_0.sol/CVStrategyV0_0.json
- name: RegistryFactoryV0_0
file: ../contracts/out/RegistryFactoryV0_0.sol/RegistryFactoryV0_0.json

eventHandlers:
- event: RegistryInitialized(bytes32,string,(uint256,string))
handler: handleInitialized
Expand Down Expand Up @@ -150,7 +150,7 @@ templates:

- kind: ethereum/contract
name: CVStrategyV0_0
network: localhost
network: arbitrum-sepolia
source:
abi: CVStrategyV0_0
mapping:
Expand Down Expand Up @@ -204,12 +204,12 @@ templates:
handler: handleAllowlistMembersRemoved
- event: SybilScorerUpdated(address)
handler: handleSybilScorerUpdated

file: ./src/mappings/cv-strategy.ts

- kind: ethereum/contract
name: CollateralVault
network: localhost
network: arbitrum-sepolia
source:
abi: CollateralVault
mapping:
Expand All @@ -229,8 +229,8 @@ templates:
handler: handleCollateralWithdrawnFor
- event: CollateralWithdrawn(uint256,indexed address,uint256,bool)
handler: handleCollateralWithdrawn
file: ./src/mappings/cv-strategy.ts

file: ./src/mappings/cv-strategy.ts
- name: ProposalDisputeMetadata
kind: file/ipfs
mapping:
Expand All @@ -243,7 +243,7 @@ templates:
abis:
- name: CVStrategyV0_0
file: ../contracts/out/CVStrategyV0_0.sol/CVStrategyV0_0.json

- name: ProposalMetadata
kind: file/ipfs
mapping:
Expand All @@ -255,4 +255,4 @@ templates:
- ProposalMetadata
abis:
- name: CVStrategyV0_0
file: ../contracts/out/CVStrategyV0_0.sol/CVStrategyV0_0.json
file: ../contracts/out/CVStrategyV0_0.sol/CVStrategyV0_0.json

0 comments on commit 3239afe

Please sign in to comment.