-
Notifications
You must be signed in to change notification settings - Fork 26
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
NuCypher tvl #86
base: main
Are you sure you want to change the base?
NuCypher tvl #86
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { useContract } from "./useContract" | ||
|
||
// TODO: Get contract abi from the package and figure out how to use these | ||
// contracts on ropsten and local network. This only works on mainnet. | ||
const ESCROW_ABI = [ | ||
{ | ||
inputs: [], | ||
name: "currentPeriodSupply", | ||
outputs: [{ internalType: "uint128", name: "", type: "uint128" }], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
] | ||
const ESCROW_ADDRESS = "0xbbD3C0C794F40c4f993B03F65343aCC6fcfCb2e2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about placing this in our There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's a nice idea 👍 , but hopefully, we can get artifacts for mainnet/ropsten/local network from the package like we do for other contracts. So let's hold for a while and we will see if we can get a separate package for ropsten network. |
||
|
||
export const useNuStakingEscrowContract = () => { | ||
return useContract(ESCROW_ADDRESS, ESCROW_ABI) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { useContract } from "./useContract" | ||
|
||
// TODO: Get contract abi from the package and figure out how to use these | ||
// contracts on ropsten and local network. This only works on mainnet. | ||
const WORK_LOCK_ADDRESS = "0xe9778E69a961e64d3cdBB34CF6778281d34667c2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
const ABI = [ | ||
{ | ||
inputs: [], | ||
name: "escrow", | ||
outputs: [ | ||
{ | ||
internalType: "contract StakingEscrow", | ||
name: "", | ||
type: "address", | ||
}, | ||
], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
] | ||
|
||
export const useNuWorkLockContract = () => { | ||
return useContract(WORK_LOCK_ADDRESS, ABI) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify why we're tracking here the NU balance of staking escrow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I implemented based on the https://github.com/nucypher/nucypher-monitor/blob/main/monitor/dashboard.py#L146-L163. Any tips on how to calculate NU TVL correctly would be appreciated 🙂