Skip to content

Commit

Permalink
Merge pull request #57 from Instadapp/flashloan-encoding
Browse files Browse the repository at this point in the history
Updated flashloan encoding for DSAv2
  • Loading branch information
thrilok209 authored May 1, 2021
2 parents aa01a8d + 7873e5f commit ddbfc0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/resolvers/instapool_v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export class Instapool_v2 {
* @param spells The spells instance
*/
encodeFlashCastData(spells: Spells) {
let encodeSpellsData = this.dsa.internal.encodeSpells(spells);
let argTypes = ["address[]", "bytes[]"];
const encodeSpellsData = this.dsa.internal.encodeSpells(spells);
const targetType = Number(this.dsa.instance.version) === 1 ? "address[]" : "string[]"
let argTypes = [targetType, "bytes[]"];
return this.dsa.web3.eth.abi.encodeParameters(argTypes, [encodeSpellsData.targets, encodeSpellsData.spells]);
}
}

0 comments on commit ddbfc0f

Please sign in to comment.