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

add sablier streams (#54) #56

Merged
merged 1 commit into from
May 18, 2024
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
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ NATION_ADDRESS=0x333A4823466879eeF910A04D473505da62142069
VENATION_ADDRESS=0xF7deF1D2FBDA6B74beE7452fdf7894Da9201065d
DAO_AGENT_ADDRESS=0x5afEb7F3259A25EB21287e3A917BeE3d4dE58dAf
DAO_CRITICAL_AGENT_ADDRESS=0xE3554d26A6BE2D2DF942975BDD06B8513b29efD6
SABLIER_V2_LOCKUP_LINEAR_ADDRESS=0xAFb979d9afAd1aD27C5eFf4E27226E3AB9e5dCC9
7 changes: 4 additions & 3 deletions api/circulating-supply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ export default async (request: VercelRequest, response: VercelResponse) => {
nationContract.totalSupply(),
nationContract.balanceOf(process.env.VENATION_ADDRESS),
nationContract.balanceOf(process.env.DAO_AGENT_ADDRESS),
nationContract.balanceOf(process.env.DAO_CRITICAL_AGENT_ADDRESS)
nationContract.balanceOf(process.env.DAO_CRITICAL_AGENT_ADDRESS),
nationContract.balanceOf(process.env.SABLIER_V2_LOCKUP_LINEAR_ADDRESS)
])

const [totalSupply, veNationSupply, daoAgentSupply, daoCriticalAgentSupply] = supplies
const [totalSupply, veNationSupply, daoAgentSupply, daoCriticalAgentSupply, sablierSupply] = supplies

const circulatingSupply = totalSupply.sub(veNationSupply).sub(daoAgentSupply).sub(daoCriticalAgentSupply)
const circulatingSupply = totalSupply.sub(veNationSupply).sub(daoAgentSupply).sub(daoCriticalAgentSupply).sub(sablierSupply)

response.status(200).send(ethers.utils.formatUnits(circulatingSupply, 18))
}
Loading