Skip to content

Commit

Permalink
New deployment (#262)
Browse files Browse the repository at this point in the history
* deployed new geysers

* ran linter

* deployed new geysers

* updated frontend with new geysers

* cache flush script

* geyser slug

* using global apy for geyser drip

* showing most recent 3 programs if all have expired

* disabling bootstrap

* enabling new geysers
  • Loading branch information
aalavandhan authored Jan 9, 2025
1 parent f26b522 commit 70e1d70
Show file tree
Hide file tree
Showing 24 changed files with 1,087 additions and 154 deletions.
226 changes: 226 additions & 0 deletions .openzeppelin/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,232 @@
}
}
}
},
"f5994764c094d27dccc784eac5674d3f8721c6d83bed328d38defdf246f3e7d1": {
"address": "0x49c3D3735084f5F69D4E214Fe2680A0c870Bbfe3",
"txHash": "0xb7296e77121ef7e86ec989139197e0509cf172b90c671a0c1544d9439e28b7b9",
"layout": {
"storage": [
{
"contract": "Powered",
"label": "_powerSwitch",
"type": "t_address",
"src": "contracts/PowerSwitch/Powered.sol:24"
},
{
"contract": "Initializable",
"label": "_initialized",
"type": "t_bool",
"src": "@openzeppelin/contracts/proxy/Initializable.sol:25"
},
{
"contract": "Initializable",
"label": "_initializing",
"type": "t_bool",
"src": "@openzeppelin/contracts/proxy/Initializable.sol:30"
},
{
"contract": "ContextUpgradeable",
"label": "__gap",
"type": "t_array(t_uint256)50_storage",
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:31"
},
{
"contract": "OwnableUpgradeable",
"label": "_owner",
"type": "t_address",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:20"
},
{
"contract": "OwnableUpgradeable",
"label": "__gap",
"type": "t_array(t_uint256)49_storage",
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:74"
},
{
"contract": "Geyser",
"label": "_geyser",
"type": "t_struct(GeyserData)5791_storage",
"src": "contracts/Geyser.sol:222"
},
{
"contract": "Geyser",
"label": "_vaults",
"type": "t_mapping(t_address,t_struct(VaultData)5804_storage)",
"src": "contracts/Geyser.sol:223"
},
{
"contract": "Geyser",
"label": "_bonusTokenSet",
"type": "t_struct(AddressSet)4188_storage",
"src": "contracts/Geyser.sol:224"
},
{
"contract": "Geyser",
"label": "_vaultFactorySet",
"type": "t_struct(AddressSet)4188_storage",
"src": "contracts/Geyser.sol:225"
}
],
"types": {
"t_struct(GeyserData)5791_storage": {
"label": "struct IGeyser.GeyserData",
"members": [
{
"label": "stakingToken",
"type": "t_address"
},
{
"label": "rewardToken",
"type": "t_address"
},
{
"label": "rewardPool",
"type": "t_address"
},
{
"label": "rewardScaling",
"type": "t_struct(RewardScaling)5816_storage"
},
{
"label": "rewardSharesOutstanding",
"type": "t_uint256"
},
{
"label": "totalStake",
"type": "t_uint256"
},
{
"label": "totalStakeUnits",
"type": "t_uint256"
},
{
"label": "lastUpdate",
"type": "t_uint256"
},
{
"label": "rewardSchedules",
"type": "t_array(t_struct(RewardSchedule)5798_storage)dyn_storage"
}
]
},
"t_address": {
"label": "address"
},
"t_struct(RewardScaling)5816_storage": {
"label": "struct IGeyser.RewardScaling",
"members": [
{
"label": "floor",
"type": "t_uint256"
},
{
"label": "ceiling",
"type": "t_uint256"
},
{
"label": "time",
"type": "t_uint256"
}
]
},
"t_uint256": {
"label": "uint256"
},
"t_array(t_struct(RewardSchedule)5798_storage)dyn_storage": {
"label": "struct IGeyser.RewardSchedule[]"
},
"t_struct(RewardSchedule)5798_storage": {
"label": "struct IGeyser.RewardSchedule",
"members": [
{
"label": "duration",
"type": "t_uint256"
},
{
"label": "start",
"type": "t_uint256"
},
{
"label": "shares",
"type": "t_uint256"
}
]
},
"t_mapping(t_address,t_struct(VaultData)5804_storage)": {
"label": "mapping(address => struct IGeyser.VaultData)"
},
"t_struct(VaultData)5804_storage": {
"label": "struct IGeyser.VaultData",
"members": [
{
"label": "totalStake",
"type": "t_uint256"
},
{
"label": "stakes",
"type": "t_array(t_struct(StakeData)5809_storage)dyn_storage"
}
]
},
"t_array(t_struct(StakeData)5809_storage)dyn_storage": {
"label": "struct IGeyser.StakeData[]"
},
"t_struct(StakeData)5809_storage": {
"label": "struct IGeyser.StakeData",
"members": [
{
"label": "amount",
"type": "t_uint256"
},
{
"label": "timestamp",
"type": "t_uint256"
}
]
},
"t_struct(AddressSet)4188_storage": {
"label": "struct EnumerableSet.AddressSet",
"members": [
{
"label": "_inner",
"type": "t_struct(Set)3923_storage"
}
]
},
"t_struct(Set)3923_storage": {
"label": "struct EnumerableSet.Set",
"members": [
{
"label": "_values",
"type": "t_array(t_bytes32)dyn_storage"
},
{
"label": "_indexes",
"type": "t_mapping(t_bytes32,t_uint256)"
}
]
},
"t_array(t_bytes32)dyn_storage": {
"label": "bytes32[]"
},
"t_bytes32": {
"label": "bytes32"
},
"t_mapping(t_bytes32,t_uint256)": {
"label": "mapping(bytes32 => uint256)"
},
"t_array(t_uint256)49_storage": {
"label": "uint256[49]"
},
"t_array(t_uint256)50_storage": {
"label": "uint256[50]"
},
"t_bool": {
"label": "bool"
}
}
}
}
},
"admin": {
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,23 @@ ethereum:
proxyAdmin: 0xc70F5bc82ccb3de00400814ff8bD406C271db3c4
geyserRegistry: 0xFc43803F203e3821213bE687120aD44C8a21A7e7
geysers:
- poolRef: "CHARM-WAMPL-WETH (Crystal V1)"
deployment: 0xEac308Fa45A9b64cfb6965e8d1237B39016862e3
- poolRef: "CHARM-SPOT-USDC (Bootstrap V1)"
deployment: 0x569f042C54B094A10E6fe1b52515eEC507D8da06

- poolRef: "BB-SPOT-USDC (Steamboat V1)"
deployment: 0xF0a45FA4fBec33A2A51E08058bEA92761c08D7D5
- poolRef: "CHARM-WAMPL-WETH (Crystal V2)"
deployment: 0x59d177f718e902e59CF3Cbd19519194bcC437FeF

- poolRef: "CHARM-SPOT-USDC (Great geyser V1)"
deployment: 0x7B2e9353D3Bf71d9f9246B1291eE29DFB11B32C7
- poolRef: "STAMPL (Riverside V1)"
deployment: 0xa19604b951592170DDa857CBE46609B85AB00Dee

# - poolRef: "CHARM-WAMPL-WETH (Crystal V1)"
# deployment: 0xEac308Fa45A9b64cfb6965e8d1237B39016862e3

# - poolRef: "BB-SPOT-USDC (Steamboat V1)"
# deployment: 0xF0a45FA4fBec33A2A51E08058bEA92761c08D7D5

# - poolRef: "CHARM-SPOT-USDC (Great geyser V1)"
# deployment: 0x7B2e9353D3Bf71d9f9246B1291eE29DFB11B32C7

# - poolRef: "UNI-ETH-AMPL-V2 (Beehive V7)"
# deployment: 0x5Ec6f02D0b657E4a56d6020Bc21F19f2Ca13EcA9
Expand Down
1 change: 1 addition & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,5 @@ To learn React, check out the [React documentation](https://reactjs.org/).

```
./scripts/deploy-s3.sh
./scripts/flush-cache-prod.sh DIST.cloudfront.net
```
83 changes: 83 additions & 0 deletions frontend/scripts/flush-cache-prod.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env bash
#
# Name: flush-cache-prod.sh
#
# Usage: ./flush-cache-prod.sh "<distribution-domain-name>"
#
# Description:
# 1. Looks up a CloudFront distribution by matching the input domain name
# (e.g., "d123abcxyz.cloudfront.net") to the distribution's DomainName field.
# 2. Issues a cache invalidation for all files ("/*").
# 3. Monitors the invalidation until it is completed.
#
# Requirements:
# - AWS CLI installed and configured
# - jq installed (for JSON parsing)
# - A CloudFront distribution whose DomainName matches the supplied input

set -euo pipefail

if [ "$#" -ne 1 ]; then
echo "Usage: $0 \"<distribution-domain-name>\""
echo "Example: $0 \"d123abcxyz.cloudfront.net\""
exit 1
fi

DISTRIBUTION_DOMAIN="$1"

echo "Looking up the distribution by domain name: \"$DISTRIBUTION_DOMAIN\" ..."

# Step 1: Query the distribution list, matching the DomainName to DISTRIBUTION_DOMAIN
DISTRIBUTION_ID=$(
aws cloudfront list-distributions --output json \
| jq -r --arg DOMAIN "$DISTRIBUTION_DOMAIN" '
.DistributionList.Items[]
| select(.DomainName == $DOMAIN)
| .Id
'
)

if [ -z "$DISTRIBUTION_ID" ]; then
echo "Error: No distribution found with domain name: \"$DISTRIBUTION_DOMAIN\""
exit 1
fi

echo "Found distribution ID: $DISTRIBUTION_ID"

# Step 2: Issue a cache invalidation for all files
echo "Creating invalidation for all paths (/*) ..."
INVALIDATION_JSON=$(
aws cloudfront create-invalidation \
--distribution-id "$DISTRIBUTION_ID" \
--paths "/*"
)

# Extract the invalidation ID from the result
INVALIDATION_ID=$(echo "$INVALIDATION_JSON" | jq -r '.Invalidation.Id')

echo "Invalidation created. ID: $INVALIDATION_ID"

# Step 3: Monitor the invalidation until it completes
echo "Monitoring invalidation status..."

while true; do
STATUS=$(
aws cloudfront get-invalidation \
--distribution-id "$DISTRIBUTION_ID" \
--id "$INVALIDATION_ID" \
--output json \
| jq -r '.Invalidation.Status'
)

echo "Current status: $STATUS"

if [ "$STATUS" == "Completed" ]; then
echo "Invalidation $INVALIDATION_ID has completed!"
break
fi

# Sleep for a few seconds before checking again (avoid spamming AWS)
sleep 5
done

echo "Cache flush complete."
2 changes: 1 addition & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function App() {
<Routes>
<Route path="/" element={<Home />} />
<Route
path="/geysers/:ref"
path="/geysers/:slug"
element={
<div>
<DropdownsContainer showVaults showGeysers />
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/GeyserFirst/GeyserFirstContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import { GeyserStakeView } from './GeyserStakeView'
import { GeyserStatsView } from './GeyserStatsView'

export const GeyserFirstContainer = () => {
const { ref } = useParams()
const { slug } = useParams()
const { ready, validNetwork } = useContext(Web3Context)
const {
geyserAction,
updateGeyserAction,
selectedGeyserInfo: { isWrapped },
selectGeyserByRef,
selectGeyserBySlug,
geysers,
loading,
} = useContext(GeyserContext)
Expand All @@ -29,13 +29,13 @@ export const GeyserFirstContainer = () => {
const [geyserNotFound, setGeyserNotFound] = useState(false)
useEffect(() => {
const fetchGeyser = async () => {
if (ref && geysers.length > 0) {
const found = await selectGeyserByRef(ref)
if (slug && geysers.length > 0) {
const found = await selectGeyserBySlug(slug)
setGeyserNotFound(!found)
}
}
fetchGeyser()
}, [ref, geysers, selectGeyserByRef])
}, [slug, geysers, selectGeyserBySlug])

if (loading) return <PageLoader />

Expand Down
Loading

0 comments on commit 70e1d70

Please sign in to comment.