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

Dev #177

Merged
merged 117 commits into from
Nov 7, 2023
Merged

Dev #177

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
ed3fda8
Feature/add blacklist to tokens (#105)
RuslanProgrammer Jun 22, 2023
1b347d8
implement vote against (#106)
RuslanProgrammer Jul 3, 2023
cdcc383
Featue/reward system improvement (#108)
RuslanProgrammer Jul 5, 2023
b352c37
add isFor field to ProposalExecuted event (#111)
RuslanProgrammer Jul 5, 2023
10b102e
refactored shrinkable array
Arvolear Jul 7, 2023
2019f17
Merge branch 'master' into dev
dovgopoly Jul 10, 2023
43d195e
fixed crop
Arvolear Jul 10, 2023
3f37bb8
implement time lock for proposals (#113)
RuslanProgrammer Jul 10, 2023
ea7c576
expert nft (#112)
todesstille Jul 10, 2023
65af3d1
Expert nft (#117)
todesstille Jul 13, 2023
130aa50
TSP v2 (#110)
dovgopoly Jul 14, 2023
74e6739
Feat/request undelegate (#118)
RuslanProgrammer Jul 17, 2023
c4d8362
useless var
Arvolear Jul 18, 2023
78720ad
expert nft tags (#119)
todesstille Jul 19, 2023
4aaa599
added event for expert NFT
Arvolear Jul 21, 2023
c9b7daa
added expert tags event
Arvolear Jul 21, 2023
db2b734
Feature/new formula (#120)
todesstille Jul 31, 2023
7bc8545
Feature/validator treasury (#124)
todesstille Aug 8, 2023
b65d382
updated dlsl to 2.5.4
Arvolear Aug 8, 2023
0bb066f
fixed tests
Arvolear Aug 8, 2023
10b73c2
Feature/delegate by dao (#123)
RuslanProgrammer Aug 9, 2023
cd495b9
add restriction to vote (#125)
RuslanProgrammer Aug 10, 2023
c9e5304
removed unused var
Arvolear Aug 10, 2023
f7432d6
bumped up dlsl
Arvolear Aug 10, 2023
5d9012b
Feature/improve dao (#128)
RuslanProgrammer Aug 11, 2023
7e53b9c
Feature/deploy nft multiplier (#129)
RuslanProgrammer Aug 14, 2023
38a25de
moved to solarity
Arvolear Aug 14, 2023
2bc6656
Fix create proposal against data griefing (#130)
RuslanProgrammer Aug 15, 2023
2d41140
Feature/validator treasury (#126)
todesstille Aug 15, 2023
7b7e38a
Feature/move var to core (#131)
RuslanProgrammer Aug 15, 2023
50b2345
Feat/micropool (#127)
dovgopoly Aug 15, 2023
c27c689
remove useless file
Arvolear Aug 15, 2023
90a12af
Dev dao only (#132)
RuslanProgrammer Aug 16, 2023
8727c22
removed unused lib
Arvolear Aug 16, 2023
6332192
remove DP from govSettings (#134)
RuslanProgrammer Aug 17, 2023
e57d366
renamed to ERC20Gov (#135)
RuslanProgrammer Aug 17, 2023
6c7beff
fix bugs
Arvolear Aug 18, 2023
f8a6a4d
Feat/join votings (#138)
dovgopoly Aug 21, 2023
9c43f66
Fix/nft multiplier changes (#133)
RuslanProgrammer Aug 22, 2023
c20c9e7
Fix/fix tests (#139)
RuslanProgrammer Aug 22, 2023
1e299ea
Feat/tsp and vote (#140)
dovgopoly Aug 22, 2023
b2f7b4b
Feature/votes power (#137)
todesstille Aug 22, 2023
23f8704
add tests (#141)
RuslanProgrammer Aug 22, 2023
39db092
cleanup
Arvolear Aug 22, 2023
7746796
Fix/votes (#142)
dovgopoly Aug 22, 2023
b9b1df5
migrate bump up
Arvolear Aug 22, 2023
422b9ce
fix DP frontrunning
Arvolear Aug 23, 2023
9b92ad2
added tests (#143)
RuslanProgrammer Aug 23, 2023
ba2a623
Fixed GovPool tests (#144)
dovgopoly Aug 23, 2023
29453ae
fixed technological check
Arvolear Aug 23, 2023
bc37d8d
Feature/dexe nft multiplier (#136)
RuslanProgrammer Aug 24, 2023
06a42ef
Feature/cancel votes validators (#145)
RuslanProgrammer Aug 24, 2023
33be611
refactored validators
Arvolear Aug 24, 2023
916d51f
Fix/tsp transfer from (#146)
dovgopoly Aug 24, 2023
72d826e
tiny optimization
Arvolear Aug 28, 2023
19ad08f
Feature/polynomial power (#147)
todesstille Aug 28, 2023
15a9b72
Feat/rewards (#148)
dovgopoly Aug 30, 2023
799d26d
refactoring (#149)
dovgopoly Aug 31, 2023
5957717
refactored storage
Arvolear Aug 31, 2023
86682c2
Docs & minor fixes (#150)
dovgopoly Aug 31, 2023
1bc58b4
fixed migrations
Arvolear Sep 1, 2023
eb037ef
updated versions
Arvolear Sep 4, 2023
a009f10
asserts (#152)
todesstille Sep 6, 2023
91818a0
Feature/treasury coefficient (#153)
todesstille Sep 8, 2023
0da0075
Fix/tests (#151)
dovgopoly Sep 8, 2023
77567cc
fix args order
Arvolear Sep 12, 2023
53f565a
Fix/improvements tests (#154)
dovgopoly Sep 13, 2023
b0f3241
fix quorum event
Arvolear Sep 13, 2023
aa20564
Final feats & minor fixes (#155)
dovgopoly Sep 15, 2023
f357b94
Feat/claim (#158)
dovgopoly Sep 21, 2023
ef165b5
Refactor/get proposal state (#159)
Arvolear Sep 25, 2023
7edf45f
fixes & tests (#160)
dovgopoly Sep 25, 2023
c73923e
Fix/voting power (#161)
dovgopoly Sep 26, 2023
4a4c9d0
fix decimals & solidity 20
Arvolear Sep 26, 2023
11c46b0
remove swaps from pricefeed
Arvolear Sep 26, 2023
d7f40ae
Docs (#162)
dovgopoly Sep 27, 2023
ba79c98
added rate explanation
Arvolear Sep 27, 2023
d9b6130
fix commission mint
Arvolear Sep 28, 2023
872cd6e
Fixed meta governance (#163)
Arvolear Sep 28, 2023
cdf9369
Fix/audit fixes (#164)
dovgopoly Sep 28, 2023
dca45e5
validators token explicit reverts
Arvolear Oct 3, 2023
30b56c8
Fix/exec-delay (#166)
dovgopoly Oct 10, 2023
07bd141
fix TSP exchange rate
Arvolear Oct 12, 2023
01bc28e
Fix/quorum (#168)
dovgopoly Oct 13, 2023
73741ff
fix precision
Arvolear Oct 14, 2023
8401d19
simplified deploy on failure
Arvolear Oct 14, 2023
9a5808c
view -> pure
Arvolear Oct 15, 2023
02e0dde
fix micropool rewards
Arvolear Oct 16, 2023
3c9a08d
Feat/shperex (#169)
dovgopoly Oct 16, 2023
8c52fe4
fix NFT power
Arvolear Oct 17, 2023
3bb3cd1
Fix/tests (#171)
dovgopoly Oct 18, 2023
e55dd1d
microfix
Arvolear Oct 18, 2023
e686369
made NFTs unique token URI
Arvolear Oct 19, 2023
dc12191
removed useless functions
Arvolear Oct 19, 2023
a143871
fix DP recovery
Arvolear Oct 20, 2023
15edac2
Feat/logic fixes (#173)
Arvolear Oct 27, 2023
b37f3d4
2.0.0 migrate
Arvolear Oct 30, 2023
7b51d73
Integrated with SphereX engines (#175)
Arvolear Oct 30, 2023
0d5e3e5
fixed migrations
Arvolear Oct 30, 2023
693bc10
updated integration
Arvolear Oct 30, 2023
b2b30da
feat/nfts (#172)
dovgopoly Oct 30, 2023
0b2d1b0
fixed verification plugin
Arvolear Oct 31, 2023
51637ea
migration v10
Arvolear Oct 31, 2023
5710f31
Audit/ambisafe (#176)
Arvolear Nov 1, 2023
9078949
updated versions, fixed several bugs
Arvolear Nov 2, 2023
b417eaf
cosmetics
Arvolear Nov 2, 2023
7507cbb
fix migrations
Arvolear Nov 2, 2023
c700d9f
fixed decimals convertion
Arvolear Nov 3, 2023
64bbcf5
fixed token sale
Arvolear Nov 3, 2023
ec56aea
fix doc
Arvolear Nov 3, 2023
731efe9
fix doc
Arvolear Nov 3, 2023
71a941e
tiny optimization
Arvolear Nov 4, 2023
f30f1fb
removed only
Arvolear Nov 6, 2023
440b8b3
minor adjustments
Arvolear Nov 7, 2023
8a8b74b
removed multiplier from static rewards
Arvolear Nov 7, 2023
8797aee
polynomial power fix
Arvolear Nov 7, 2023
ca4725e
changed to multiownable
Arvolear Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .docs/gen-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

rm -rf generated-markups

npm run generate-markups

echo "Markups have been generated. Moving..."

mkdir -p docs
rsync -av --delete generated-markups/contracts/interfaces/ docs

rm -r generated-markups
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ coverage
# Typechain generated files
generated-types
generated-markups

# Hardhat migrate files
.storage.json
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint-fix && git add -u
npm run lint-fix && npm run generate-docs && git add -u
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# DEXE DAO
86 changes: 73 additions & 13 deletions contracts/core/ContractsRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";

import "@dlsl/dev-modules/contracts-registry/presets/OwnableContractsRegistry.sol";
import "@solarity/solidity-lib/contracts-registry/presets/MultiOwnableContractsRegistry.sol";

import "@spherex-xyz/engine-contracts/src/SphereXEngine.sol";

import "../interfaces/core/IContractsRegistry.sol";

contract ContractsRegistry is IContractsRegistry, OwnableContractsRegistry, UUPSUpgradeable {
import "../proxy/ProtectedTransparentProxy.sol";

contract ContractsRegistry is IContractsRegistry, MultiOwnableContractsRegistry, UUPSUpgradeable {
string public constant USER_REGISTRY_NAME = "USER_REGISTRY";

string public constant POOL_FACTORY_NAME = "POOL_FACTORY";
Expand All @@ -16,17 +20,44 @@ contract ContractsRegistry is IContractsRegistry, OwnableContractsRegistry, UUPS
string public constant DEXE_NAME = "DEXE";
string public constant USD_NAME = "USD";
string public constant BABT_NAME = "BABT";
string public constant DEXE_EXPERT_NFT_NAME = "DEXE_EXPERT_NFT";

string public constant PRICE_FEED_NAME = "PRICE_FEED";
string public constant UNISWAP_V2_ROUTER_NAME = "UNISWAP_V2_ROUTER";
string public constant UNISWAP_V2_FACTORY_NAME = "UNISWAP_V2_FACTORY";

string public constant INSURANCE_NAME = "INSURANCE";
string public constant TREASURY_NAME = "TREASURY";
string public constant DIVIDENDS_NAME = "DIVIDENDS";

string public constant CORE_PROPERTIES_NAME = "CORE_PROPERTIES";

string public constant SPHEREX_ENGINE_NAME = "SPHEREX_ENGINE";
string public constant POOL_SPHEREX_ENGINE_NAME = "POOL_SPHEREX_ENGINE";

function toggleSphereXEngine(bool on) external onlyOwner {
address sphereXEngine = on ? getSphereXEngineContract() : address(0);

_setSphereXEngine(USER_REGISTRY_NAME, sphereXEngine);
_setSphereXEngine(POOL_FACTORY_NAME, sphereXEngine);
_setSphereXEngine(POOL_REGISTRY_NAME, sphereXEngine);
_setSphereXEngine(DEXE_EXPERT_NFT_NAME, sphereXEngine);
_setSphereXEngine(PRICE_FEED_NAME, sphereXEngine);
_setSphereXEngine(CORE_PROPERTIES_NAME, sphereXEngine);
}

function protectContractFunctions(
string calldata contractName,
bytes4[] calldata selectors
) external onlyOwner {
SphereXProxyBase(getContract(contractName)).addProtectedFuncSigs(selectors);
}

function unprotectContractFunctions(
string calldata contractName,
bytes4[] calldata selectors
) external onlyOwner {
SphereXProxyBase(getContract(contractName)).removeProtectedFuncSigs(selectors);
}

function getUserRegistryContract() external view override returns (address) {
return getContract(USER_REGISTRY_NAME);
}
Expand Down Expand Up @@ -59,18 +90,10 @@ contract ContractsRegistry is IContractsRegistry, OwnableContractsRegistry, UUPS
return getContract(UNISWAP_V2_FACTORY_NAME);
}

function getInsuranceContract() external view override returns (address) {
return getContract(INSURANCE_NAME);
}

function getTreasuryContract() external view override returns (address) {
return getContract(TREASURY_NAME);
}

function getDividendsContract() external view override returns (address) {
return getContract(DIVIDENDS_NAME);
}

function getCorePropertiesContract() external view override returns (address) {
return getContract(CORE_PROPERTIES_NAME);
}
Expand All @@ -79,5 +102,42 @@ contract ContractsRegistry is IContractsRegistry, OwnableContractsRegistry, UUPS
return getContract(BABT_NAME);
}

function getDexeExpertNftContract() external view override returns (address) {
return getContract(DEXE_EXPERT_NFT_NAME);
}

function getPoolSphereXEngineContract() external view override returns (address) {
return getContract(POOL_SPHEREX_ENGINE_NAME);
}

function getSphereXEngineContract() public view override returns (address) {
return getContract(SPHEREX_ENGINE_NAME);
}

function _setSphereXEngine(string memory contractName, address sphereXEngine) internal {
ProtectedTransparentProxy(payable(getContract(contractName))).changeSphereXEngine(
sphereXEngine
);
}

function _deployProxy(
address contractAddress,
address admin,
bytes memory data
) internal override returns (address proxy) {
proxy = address(
new ProtectedTransparentProxy(
msg.sender,
address(this),
address(0),
contractAddress,
admin,
data
)
);

ISphereXEngine(getSphereXEngineContract()).addAllowedSenderOnChain(proxy);
}

function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
}
Loading