Skip to content

Commit

Permalink
revision
Browse files Browse the repository at this point in the history
  • Loading branch information
themacexpert committed Dec 20, 2024
1 parent eaf01b3 commit 272e87a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions builders/get-started/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ function getBalanceSlot(accountAddress) {
// Convert address to bytes32 and normalize
const addr = ethers.zeroPadValue(accountAddress, 32);

// Pack with mapping position 5
// CAUTION! The storage slot used here is 5, which
// is specific to Wormhole contracts
// The storage slot index for other tokens may vary
const packedData = ethers.concat([
addr,
ethers.zeroPadValue(ethers.toBeHex(5), 32)
Expand Down Expand Up @@ -412,7 +414,8 @@ You can apply the same process for other ERC-20 token contracts. The following s
// Convert address to bytes32 and normalize
const addr = ethers.zeroPadValue(accountAddress, 32);
// Pack with mapping position 1
// Caution! The storage slot index used here is 1
// The storage slot index for other tokens may vary
const packedData = ethers.concat([
addr,
ethers.zeroPadValue(ethers.toBeHex(1), 32)
Expand Down

0 comments on commit 272e87a

Please sign in to comment.