generated from PaulRBerg/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from Tenderize/nv/multi-testnet
feat: StakingXYZ rewrite and multi-token testnet preparation
- Loading branch information
Showing
16 changed files
with
365 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
|
||
# files | ||
*.env | ||
*.env.* | ||
*.html | ||
*.log | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// _____ _ _ | ||
// |_ _| | | (_) | ||
// | | ___ _ __ __| | ___ _ __ _ _______ | ||
// | |/ _ \ '_ \ / _` |/ _ \ '__| |_ / _ \ | ||
// | | __/ | | | (_| | __/ | | |/ / __/ | ||
// \_/\___|_| |_|\__,_|\___|_| |_/___\___| | ||
// | ||
// Copyright (c) Tenderize Labs Ltd | ||
|
||
pragma solidity >=0.8.19; | ||
|
||
import { Script, console2 } from "forge-std/Script.sol"; | ||
import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; | ||
import { StakingXYZ } from "../test/helpers/StakingXYZ.sol"; | ||
import { XYZAdapter } from "../test/helpers/XYZAdapter.sol"; | ||
import { Registry } from "core/registry/Registry.sol"; | ||
|
||
import { Factory } from "core/factory/Factory.sol"; | ||
import { TokenFaucet } from "../test/helpers/Faucet.sol"; | ||
import { ERC20 } from "solmate/tokens/ERC20.sol"; | ||
|
||
contract XYZ_Faucet is Script { | ||
bytes32 private constant salt = bytes32(uint256(1)); | ||
|
||
function run() public { | ||
uint256 privKey = vm.envUint("PRIVATE_KEY"); | ||
vm.startBroadcast(privKey); | ||
|
||
address tokenAddress = vm.envAddress("TOKEN"); | ||
ERC20 token = ERC20(tokenAddress); | ||
uint256 seedAmount = vm.envUint("SEED_AMOUNT"); | ||
uint256 cooldown = vm.envUint("COOLDOWN"); | ||
uint256 requestAmount = vm.envUint("REQUEST_AMOUNT"); | ||
|
||
address me = vm.addr(privKey); | ||
console2.log("privKey", privKey); | ||
console2.log("me", me); | ||
console2.log("balance", token.balanceOf(me)); | ||
|
||
cooldown = cooldown != 0 ? cooldown : 1 days; | ||
requestAmount = requestAmount != 0 ? requestAmount : 1000 ether; | ||
|
||
address faucet = address(new TokenFaucet{salt: salt}(token, requestAmount, cooldown)); | ||
token.transfer(faucet, seedAmount); | ||
|
||
console2.log("Faucet: ", faucet); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
forge build | ||
|
||
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","id":67,"method":"anvil_setCode","params": ["0x4e59b44847b379578588920ca78fbf26c0b4956c","0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3"]}' 127.0.0.1:8545 | ||
|
||
source .env | ||
|
||
# Deterministic | ||
export REGISTRY=0x6232894e592F104FB561c1Fb59a52ea01ee7D867 | ||
export FACTORY=0x62536191D4EB10D4CA5909D60232593A1b40BE10 | ||
|
||
# forge script script/Tenderize_Deploy.s.sol:Tenderize_Deploy --rpc-url ${ARBITRUM_GOERLI_RPC} --broadcast --private-key $PRIVATE_KEY -vvvv | ||
|
||
|
||
# Deploy Livepeer | ||
# Parameters | ||
export NAME="Livepeer" | ||
export SYMBOL="LPT" | ||
export BASE_APR="280000" | ||
export UNLOCK_TIME="604800" | ||
export TOTAL_SUPPLY="30000000000000000000000000" | ||
export ID=0 | ||
forge script script/XYZ_Deploy.s.sol:XYZ_Deploy --rpc-url ${ARBITRUM_GOERLI_RPC} --broadcast --private-key $PRIVATE_KEY -vvvv | ||
|
||
# Deploy Graph | ||
export NAME="The Graph" | ||
export SYMBOL="GRT" | ||
export BASE_APR="170000" | ||
export UNLOCK_TIME="2419200" | ||
export TOTAL_SUPPLY="10000000000000000000000000000" | ||
export ID=1 | ||
forge script script/XYZ_Deploy.s.sol:XYZ_Deploy --rpc-url ${ARBITRUM_GOERLI_RPC} --broadcast --private-key $PRIVATE_KEY -vvvv | ||
|
||
# Deploy Polygon | ||
export NAME="Polygon" | ||
export SYMBOL="POL" | ||
export BASE_APR="110000" | ||
export UNLOCK_TIME="201600" | ||
export TOTAL_SUPPLY="10000000000000000000000000000" | ||
export ID=2 | ||
forge script script/XYZ_Deploy.s.sol:XYZ_Deploy --rpc-url ${ARBITRUM_GOERLI_RPC} --broadcast --private-key $PRIVATE_KEY -vvvv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.