
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@bgd-labs/governance-v3-ethers-utils
Advanced tools
This repository contains helper functions for getting web3 proofs.
This repository contains helper functions for getting web3 proofs.
npm i @bgd-labs/governance-v3-ethers-utils
yarn add @bgd-labs/governance-v3-ethers-utils
import { baseSlots, AssetsBalanceSlots, Asset } from '@bgd-labs/governance-v3-ethers-utils/dist/helpers/types';
import { getVotingProofs } from '@bgd-labs/governance-v3-ethers-utils/dist/helpers/genericFunctions';
import { AaveV3Ethereum, AaveSafetyModule, GovernanceV3Ethereum } from '@bgd-labs/aave-address-book';
const assets = {
aaveAddress: AaveV3Ethereum.ASSETS.AAVE.UNDERLYING,
aAaveAddress: AaveV3Ethereum.ASSETS.AAVE.A_TOKEN,
stkAAVEAddress: AaveSafetyModule.STK_AAVE,
contractAddress: GovernanceV3Ethereum.GOVERNANCE,
}
const assetsBalanceSlots: AssetsBalanceSlots = {
[assets.stkAAVEAddress.toLowerCase()]: {
...baseSlots[Asset.STKAAVE],
},
[assets.aAaveAddress.toLowerCase()]: {
...baseSlots[Asset.AAAVE],
},
[assets.aaveAddress.toLowerCase()]: {
...baseSlots[Asset.AAVE],
},
[assets.contractAddress.toLowerCase()]: {
...baseSlots[Asset.GOVCORE],
},
};
const formattedBalances = [{
underlyingAsset: assets.aaveAddress, // address of voting asset
value: "100", // total balance (user balance + delegated voting power) on voting block
userBalance: "100", // should be real user balance on voting block (not current))
isWithDelegatedPower: false, // value !== userBalance (on voting block)
}]
// getting balance proofs for voting viem
const proofs = await getVotingProofs({
client: govCoreViemClient, // viem client
blockHash: proposal.snapshotBlockHash, // from proposal data
balances: formattedBalances,
address: voterAddress, // voter asset (signer or representation address)
aAaveAddress: assets.aAaveAddress,
slots: assetsBalanceSlots,
});
// getting balance proofs for voting ether js v5
const proofsEtherJs = await eGetVotingProofs({
provider: govCoreRPCProvider, // ether js v5 provider
blockHash: proposal.snapshotBlockHash, // from proposal data
balances: formattedBalances,
address: voterAddress, // voter asset (signer or representation address)
aAaveAddress: assets.aAaveAddress,
slots: assetsBalanceSlots,
});
Copyright © 2024, BGD Labs. Released under the MIT License.
FAQs
This repository contains helper functions for getting web3 proofs.
We found that @bgd-labs/governance-v3-ethers-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.