BalancerHelpers

Berachain Browse chains

0x5083737ec75a728c265be578c9d0d5333a2c5951

Solidity v0.7.1+commit.f4a555be

🤖
Query this contract from your AI
Reference: 0x5083737ec75a728c265be578c9d0d5333a2c5951
Sample prompt: "Tell me the current state of berachain/0x5083737ec75a728c265be578c9d0d5333a2c5951"
No AI wired up yet? → mcp.smarts.md · Browse chains
Berachain is a docs-only chain on Smarts: source code and ABI are indexed, but live on-chain data (state, recent events, admin profile) is not currently available. AI agents can still query get_contract_info and get_contract_source via MCP.

Overview

Read Functions
1
Write Functions
2
Events
0

Read Functions

vault() view

Return the Balancer Vault contract address.✨ AI

Returns

Name Type Description
address The address of the Balancer Vault contract.✨ AI

Write Functions

queryExit(poolId: bytes32, sender: address, recipient: address, request: tuple) nonpayable

Estimates the BPT to burn and the token amounts returned for a specified pool exit request.✨ AI

dev: Returns the amount of BPT that would be burned from `sender` if the `onExitPool` hook were called by the Vault with the same arguments, along with the number of tokens `recipient` would receive. This function is not meant to be called directly, but rather from a helper contract that fetches current Vault data, such as the protocol swap fee percentage and Pool balances. Like `IVault.queryBatchSwap`, this function is not view due to internal implementation details: the caller must explicitly use eth_call instead of eth_sendTransaction.

Parameters

Name Type Description
poolId bytes32 Identifier of the Balancer pool to exit.✨ AI
sender address Address initiating the exit (caller or owner of the BPT).✨ AI
recipient address Address that will receive the withdrawn tokens.✨ AI
request tuple Exit request struct containing exit kind, involved assets, minimums, and userData.✨ AI

Returns

Name Type Description
bptIn uint256 bptIn: the amount of pool tokens (BPT) that must be burned to perform the exit.✨ AI
amountsOut uint256[] amountsOut: array of token amounts that will be sent to the recipient for each pool asset.✨ AI
queryJoin(poolId: bytes32, sender: address, recipient: address, request: tuple) nonpayable

Estimate BPT to mint and required token amounts for joining a Balancer pool with the given request.✨ AI

dev: Returns the amount of BPT that would be granted to `recipient` if the `onJoinPool` hook were called by the Vault with the same arguments, along with the number of tokens `sender` would have to supply. This function is not meant to be called directly, but rather from a helper contract that fetches current Vault data, such as the protocol swap fee percentage and Pool balances. Like `IVault.queryBatchSwap`, this function is not view due to internal implementation details: the caller must explicitly use eth_call instead of eth_sendTransaction.

Parameters

Name Type Description
poolId bytes32 Identifier of the Balancer pool to join.✨ AI
sender address Address initiating the join and supplying tokens.✨ AI
recipient address Address that will receive the minted pool tokens (BPT).✨ AI
request tuple Join request struct: assets, maxAmountsIn, userData, and fromInternalBalance flag.✨ AI

Returns

Name Type Description
bptOut uint256 bptOut: Estimated amount of BPT that will be minted for the recipient.✨ AI
amountsIn uint256[] amountsIn: Array of token amounts the sender must provide for the join.✨ AI