Skip to content

Commit

Permalink
Fixes to balance calculations on Aave V3 and Beefy
Browse files Browse the repository at this point in the history
  • Loading branch information
pgbrandao committed Nov 14, 2023
1 parent ee0a6c3 commit b2bb07b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/src/asset-strategies/AaveV3DepositStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class AaveV3DepositStrategy extends InterfaceStrategy {
routerOperation.steps.push({
stepAddress: asset.address,
stepEncodedCall: IERC20.encodeFunctionData("balanceOf", [
asset.address,
walletAddress,
]),
storeOperations: [
{
Expand Down Expand Up @@ -156,14 +156,14 @@ export class AaveV3DepositStrategy extends InterfaceStrategy {
routerOperation.steps.push({
stepAddress: asset.address,
stepEncodedCall: IERC20.encodeFunctionData("balanceOf", [
asset.address,
walletAddress,
]),
storeOperations: [
{
storeOpType: StoreOpType.RetrieveResultAddStore,
storeNumber: storeNumberTo,
offset: balanceOfToOffsets[0],
fraction: newFraction * FRACTION_MULTIPLIER,
fraction: FRACTION_MULTIPLIER,
},
{
storeOpType: StoreOpType.SubtractStoreFromStore,
Expand Down
4 changes: 2 additions & 2 deletions core/src/asset-strategies/BeefyDepositStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class BeefyDepositStrategy extends InterfaceStrategy {
routerOperation.steps.push({
stepAddress: asset.address,
stepEncodedCall: IERC20.encodeFunctionData("balanceOf", [
asset.address,
walletAddress,
]),
storeOperations: [
{
Expand Down Expand Up @@ -170,7 +170,7 @@ export class BeefyDepositStrategy extends InterfaceStrategy {
routerOperation.steps.push({
stepAddress: asset.address,
stepEncodedCall: IERC20.encodeFunctionData("balanceOf", [
asset.address,
walletAddress,
]),
storeOperations: [
{
Expand Down
2 changes: 1 addition & 1 deletion core/tests/protocols/beefy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test("generateTransaction: USDC to QUICK (beefyDeposit)", async () => {
});
});

test.skip("generateTransaction: beefy.finance (beefyDeposit) to USDC", async () => {
test("generateTransaction: beefy.finance (beefyDeposit) to USDC", async () => {
await simulateSingleAssetToSingleAsset({
chainId: 137,
inputAssetId: "fecfd33d-e6a7-476b-89cb-910a0058fa48",
Expand Down

0 comments on commit b2bb07b

Please sign in to comment.