Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 12 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/murky"]
path = lib/murky
url = https://github.com/dmfxyz/murky
[submodule "lib/openzeppelin-foundry-upgrades"]
path = lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
[submodule "lib/contracts"]
path = lib/contracts
url = https://github.com/Universal-Page/contracts
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
13 changes: 0 additions & 13 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"solidity.formatter": "forge"
}
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Repository for the Stakingverse contracts. This repository includes the followin
- Stakingverse Vault (based on [Universal Page vault's implementation](https://github.com/Universal-Page/contracts/blob/main/src/pool/Vault.sol))
- Liquid Staking Token (sLYX) based on the LUKSO LSP7 standard (linked to the Vault contract below deployed on LUKSO Mainnet).

| Contract | Address on LUKSO Mainnet |
| :-------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------- |
| Staking Vault Proxy | [`0x9F49a95b0c3c9e2A6c77a16C177928294c0F6F04`](https://explorer.lukso.network/address/0x9F49a95b0c3c9e2A6c77a16C177928294c0F6F04?tab=contract) |
| Staking Vault `Vault.sol` Implementation (old) | [`0x2Cb02ef26aDDAB15686ed634d70699ab64F195f4`](https://explorer.lukso.network/address/0x2Cb02ef26aDDAB15686ed634d70699ab64F195f4?tab=contract) |
| Staking Vault `StakingverseVault.sol` Implementation (upgraded) | _To be deployed_ |
| SLYX Token Proxy | [`0x8a3982f0a7d154d11a5f43eec7f50e52ebbc8f7d`](https://explorer.lukso.network/address/0x8a3982f0a7d154d11a5f43eec7f50e52ebbc8f7d?tab=contract) |
| SLYX Token Implementation | _To be deployed_ |
| Contract | Address on LUKSO Mainnet |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------- |
| Staking Vault Proxy | [`0x9F49a95b0c3c9e2A6c77a16C177928294c0F6F04`](https://explorer.lukso.network/address/0x9F49a95b0c3c9e2A6c77a16C177928294c0F6F04?tab=contract) |
| Staking Vault `Vault.sol` Implementation <br/> (commit [`33d1619` on Universal.Page repository](https://github.com/Universal-Page/contracts/tree/33d1619a19162444c870b8a5a4bf42eb4532818c)) | [`0x2Cb02ef26aDDAB15686ed634d70699ab64F195f4`](https://explorer.lukso.network/address/0x2Cb02ef26aDDAB15686ed634d70699ab64F195f4?tab=contract) |
| Staking Vault `StakingverseVault.sol` Implementation (upgraded) | _To be deployed_ |
| SLYX Token Proxy | [`0x8a3982f0a7d154d11a5f43eec7f50e52ebbc8f7d`](https://explorer.lukso.network/address/0x8a3982f0a7d154d11a5f43eec7f50e52ebbc8f7d?tab=contract) |
| SLYX Token Implementation | _To be deployed_ |

- [Stakingverse Contracts](#stakingverse-contracts)
- [Installation](#installation)
Expand All @@ -34,11 +34,11 @@ Repository for the Stakingverse contracts. This repository includes the followin
## Installation

```bash
# Install LUKSO and OpenZeppelin contracts dependencies
# Install LUKSO LSP7 dependencies
npm install

# Install forge contracts testing library
forge install https://github.com/foundry-rs/forge-std --no-commit --no-git
# Install git submodule dependencies OZ contracts + forge library
git submodule update --init --recursive
```

## Build
Expand Down
9 changes: 9 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ gas_reports = ["SLYXToken", "StakingverseVault"]
extra_output_files = ["metadata"]
fs_permissions = [
{ access = "read", path = "./scripts/" },
{ access = "read", path = "./test/" },
{ access = "read", path = "./build/" },
{ access = "read-write", path = "./artifacts/" },
]


# For foundry upgrades
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]

# solidity compiler
solc_version = "0.8.22"

Expand Down
1 change: 1 addition & 0 deletions lib/contracts
Submodule contracts added at 91893d
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at dc44c9
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts-upgradeable
1 change: 1 addition & 0 deletions lib/openzeppelin-foundry-upgrades
33 changes: 0 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,24 @@
"build:sizes": "forge build --sizes",
"build:storage": "forge build --extra-output storageLayout",
"build:ir": "forge build --extra-output ir",
"test": "forge test --no-match-contract ForkTest",
"test:debug": "forge test -vvv --no-match-contract ForkTest",
"test:invariant": "forge test --match-test invariant",
"test:invariant:debug": "forge test --match-test invariant --no-match-contract ForkTest -vvv",
"test:coverage": "forge coverage --report summary --no-match-test ^invariant --no-match-contract ForkTest",
"test:gas": "forge test --no-match-contract ForkTest --gas-report",
"test:fork": "forge test --fork-url https://rpc.mainnet.lukso.network --match-contract ForkTest"
"test": "forge test --no-match-contract '^Fork|LocalUpgradeTest'",
"test:debug": "forge test -vvv --no-match-contract '^Fork|LocalUpgradeTest'",
"test:invariant": "forge test --match-test ^invariant",
"test:invariant:debug": "forge test --match-test ^invariant --no-match-contract ^Fork -vvv",
"test:coverage": "forge coverage --report summary --no-match-test ^invariant --no-match-contract '^Fork|LocalUpgradeTest'",
"test:gas": "forge test --no-match-contract '^Fork|LocalUpgradeTest' --gas-report",
"test:upgrade": "FOUNDRY_OUT=build forge clean && forge test --match-contract LocalUpgradeTest",
"test:fork": "forge test --fork-url https://rpc.mainnet.lukso.network --match-contract ForkTest",
"test:upgrade:fork": "FOUNDRY_OUT=build forge clean && forge test --fork-url https://rpc.mainnet.lukso.network --match-contract ForkMainnetUpgradeTest"
},
"dependencies": {
"@lukso/lsp7-contracts": "~0.16.3"
},
"devDependencies": {
"prettier-plugin-solidity": "^1.4.2",
"@lukso/lsp1delegate-contracts": "^0.15.0",
"@lukso/lsp6-contracts": "^0.15.0",
"@lukso/universalprofile-contracts": "^0.15.0",
"solhint": "^5.0.5",
"@openzeppelin/contracts-v4.9.0": "npm:@openzeppelin/contracts@4.9.0"
"@openzeppelin/contracts-v4.9.0": "npm:@openzeppelin/contracts@4.9.0",
"solhint": "^5.0.5"
}
}
}
7 changes: 6 additions & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
@erc725/smart-contracts/=node_modules/@erc725/smart-contracts/
@erc725/smart-contracts-v8/=node_modules/@erc725/smart-contracts-v8/
@lukso/=node_modules/@lukso/
@openzeppelin/=node_modules/@openzeppelin/
@openzeppelin/contracts-v4.9.0/=node_modules/@openzeppelin/contracts-v4.9.0/
solidity-bytes-utils/=node_modules/solidity-bytes-utils/

ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
murky/=lib/murky/src/

@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
UniversalPage/contracts=lib/contracts/
49 changes: 9 additions & 40 deletions script/SLYXTokenScriptMainnet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,23 @@ import {SLYXToken} from "../src/SLYXToken.sol";

import {IVault} from "../src/IVault.sol";

import {
PROXY_ADMIN_MAINNET,
SLYX_TOKEN_PROXY_MAINNET
} from "./MainnetConstants.sol";
import {PROXY_ADMIN_MAINNET, SLYX_TOKEN_PROXY_MAINNET} from "./MainnetConstants.sol";

contract DeploySLYXTokenImplementation is Script {
function run() external {
vm.startBroadcast();
SLYXToken slyxToken = new SLYXToken();
vm.stopBroadcast();

console.log(
string.concat(
"SLYXToken implementation deployed at ",
Strings.toHexString(address(slyxToken))
)
);
console.log(string.concat("SLYXToken implementation deployed at ", Strings.toHexString(address(slyxToken))));
}
}

contract DeploySLYXTokenProxy is Script {
function run() external {
// Proxy deployment parameters for the SLYXToken
address proxyAdmin = vm.envAddress("SLYX_PROXY_ADMIN_ADDRESS");
address sLyxTokenImplementation = vm.envAddress(
"SLYX_TOKEN_IMPLEMENTATION_ADDRESS"
);
address sLyxTokenImplementation = vm.envAddress("SLYX_TOKEN_IMPLEMENTATION_ADDRESS");

// Parameters to initialize the SLYX Token contract
address owner = vm.envAddress("SLYX_TOKEN_CONTRACT_OWNER_ADDRESS");
Expand All @@ -53,34 +43,19 @@ contract DeploySLYXTokenProxy is Script {
// proxy admin
proxyAdmin,
// `initialize(address,IVault)` calldata
abi.encodeCall(
SLYXToken.initialize,
(owner, IVault(linkedVault))
)
abi.encodeCall(SLYXToken.initialize, (owner, IVault(linkedVault)))
)
);
vm.stopBroadcast();

console.log(
string.concat(
"SLYXToken proxy deployed at ",
Strings.toHexString(proxy)
)
);
console.log(
string.concat(
"Linked to implementation at address ",
Strings.toHexString(sLyxTokenImplementation)
)
);
console.log(string.concat("SLYXToken proxy deployed at ", Strings.toHexString(proxy)));
console.log(string.concat("Linked to implementation at address ", Strings.toHexString(sLyxTokenImplementation)));
}
}

contract UpgradeSLYXToken is Script {
function run() external {
address newSLYXTokenImplementation = vm.envAddress(
"NEW_SLYX_TOKEN_IMPLEMENTATION_ADDRESS"
);
address newSLYXTokenImplementation = vm.envAddress("NEW_SLYX_TOKEN_IMPLEMENTATION_ADDRESS");

vm.startBroadcast();
IProxy(SLYX_TOKEN_PROXY_MAINNET).upgradeTo(
Expand All @@ -91,8 +66,7 @@ contract UpgradeSLYXToken is Script {

console.log(
string.concat(
"SLYXToken proxy upgraded to implementation at ",
Strings.toHexString(newSLYXTokenImplementation)
"SLYXToken proxy upgraded to implementation at ", Strings.toHexString(newSLYXTokenImplementation)
)
);
}
Expand All @@ -106,11 +80,6 @@ contract ChangeAdmin is Script {
IProxy(SLYX_TOKEN_PROXY_MAINNET).changeAdmin(newProxyAdmin);
vm.stopBroadcast();

console.log(
string.concat(
"SLYXToken proxy admin changed to ",
Strings.toHexString(newProxyAdmin)
)
);
console.log(string.concat("SLYXToken proxy admin changed to ", Strings.toHexString(newProxyAdmin)));
}
}
49 changes: 9 additions & 40 deletions script/SLYXTokenScriptTestnet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@ import {SLYXToken} from "../src/SLYXToken.sol";

import {IVault} from "../src/IVault.sol";

import {
PROXY_ADMIN_TESTNET,
SLYX_TOKEN_PROXY_TESTNET
} from "./TestnetConstants.sol";
import {PROXY_ADMIN_TESTNET, SLYX_TOKEN_PROXY_TESTNET} from "./TestnetConstants.sol";

contract DeploySLYXTokenImplementation is Script {
function run() external {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
vm.broadcast(deployerPrivateKey);
SLYXToken slyxToken = new SLYXToken();

console.log(
string.concat(
"SLYXToken implementation deployed at ",
Strings.toHexString(address(slyxToken))
)
);
console.log(string.concat("SLYXToken implementation deployed at ", Strings.toHexString(address(slyxToken))));
}
}

Expand All @@ -39,9 +31,7 @@ contract DeploySLYXTokenProxy is Script {

// Proxy deployment parameters for the SLYXToken
address proxyAdmin = vm.envAddress("SLYX_PROXY_ADMIN_ADDRESS");
address sLyxTokenImplementation = vm.envAddress(
"SLYX_TOKEN_IMPLEMENTATION_ADDRESS"
);
address sLyxTokenImplementation = vm.envAddress("SLYX_TOKEN_IMPLEMENTATION_ADDRESS");

// Parameters to initialize the SLYX Token contract
address owner = vm.envAddress("SLYX_TOKEN_CONTRACT_OWNER_ADDRESS");
Expand All @@ -55,35 +45,20 @@ contract DeploySLYXTokenProxy is Script {
// proxy admin
proxyAdmin,
// `initialize(address,IVault)` calldata
abi.encodeCall(
SLYXToken.initialize,
(owner, IVault(linkedVault))
)
abi.encodeCall(SLYXToken.initialize, (owner, IVault(linkedVault)))
)
);

console.log(
string.concat(
"SLYXToken proxy deployed at ",
Strings.toHexString(proxy)
)
);
console.log(
string.concat(
"Linked to implementation at address ",
Strings.toHexString(sLyxTokenImplementation)
)
);
console.log(string.concat("SLYXToken proxy deployed at ", Strings.toHexString(proxy)));
console.log(string.concat("Linked to implementation at address ", Strings.toHexString(sLyxTokenImplementation)));
}
}

contract UpgradeSLYXToken is Script {
function run() external {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");

address newSLYXTokenImplementation = vm.envAddress(
"NEW_SLYX_TOKEN_IMPLEMENTATION_ADDRESS"
);
address newSLYXTokenImplementation = vm.envAddress("NEW_SLYX_TOKEN_IMPLEMENTATION_ADDRESS");

vm.startBroadcast(deployerPrivateKey);
IProxy(SLYX_TOKEN_PROXY_TESTNET).upgradeTo(
Expand All @@ -94,8 +69,7 @@ contract UpgradeSLYXToken is Script {

console.log(
string.concat(
"SLYXToken proxy upgraded to implementation at ",
Strings.toHexString(newSLYXTokenImplementation)
"SLYXToken proxy upgraded to implementation at ", Strings.toHexString(newSLYXTokenImplementation)
)
);
}
Expand All @@ -119,11 +93,6 @@ contract ChangeAdmin is Script {
vm.broadcast(signerPrivateKey);
IProxy(SLYX_TOKEN_PROXY_TESTNET).changeAdmin(newProxyAdmin);

console.log(
string.concat(
"SLYXToken proxy admin changed to ",
Strings.toHexString(newProxyAdmin)
)
);
console.log(string.concat("SLYXToken proxy admin changed to ", Strings.toHexString(newProxyAdmin)));
}
}
Loading
Loading