-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #492 from balancer/examples-fix
fix: bump block number to pool helper contract deployment
- Loading branch information
Showing
40 changed files
with
460 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
node_modules | ||
dist | ||
examples | ||
**/generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
/** | ||
* Shows how to interact with the veBAL contract | ||
* | ||
* | ||
* How to run: | ||
* yarn run example examples/contracts/veBAL.ts | ||
*/ | ||
import { BalancerSDK, Network } from '@balancer-labs/sdk'; | ||
|
||
const sdk = new BalancerSDK({ | ||
network: Network.GOERLI, | ||
rpcUrl: 'https://rpc.ankr.com/eth_goerli' | ||
rpcUrl: 'https://rpc.ankr.com/eth_goerli', | ||
}); | ||
|
||
const { veBal } = sdk.contracts; | ||
|
||
async function main() { | ||
if (!veBal) throw new Error('veBal address must be defined'); | ||
|
||
const USER = "0x91F450602455564A64207414c7Fbd1F1F0EbB425"; | ||
const USER = '0x91F450602455564A64207414c7Fbd1F1F0EbB425'; | ||
|
||
const lockInfo = await veBal.getLockInfo(USER); | ||
console.log("veBAL lock info for user", lockInfo); | ||
console.log('veBAL lock info for user', lockInfo); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
import { JsonRpcProvider } from '@ethersproject/providers' | ||
import { JsonRpcProvider } from '@ethersproject/providers'; | ||
|
||
/** | ||
* Resets the fork to a given block number | ||
* | ||
* @param provider JsonRpcProvider | ||
* @param blockNumber Block number to reset fork to | ||
*/ | ||
export const reset = (provider: JsonRpcProvider, blockNumber: number, jsonRpcUrl = 'https://rpc.ankr.com/eth'): Promise<void> => | ||
export const reset = ( | ||
provider: JsonRpcProvider, | ||
blockNumber?: number, | ||
jsonRpcUrl = 'https://rpc.ankr.com/eth' | ||
): Promise<void> => | ||
provider.send('hardhat_reset', [ | ||
{ | ||
forking: { | ||
jsonRpcUrl, | ||
blockNumber | ||
} | ||
} | ||
blockNumber, | ||
}, | ||
}, | ||
]); |
Oops, something went wrong.