Last active
April 21, 2022 15:24
-
-
Save adamgobes/6ef7ae141797dc3b789eafab728291c7 to your computer and use it in GitHub Desktop.
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
contract WyvernExchange is Exchange { | |
function calculateMatchPrice_( | |
address[14] addrs, | |
uint[18] uints, | |
uint8[8] feeMethodsSidesKindsHowToCalls, | |
bytes calldataBuy, | |
bytes calldataSell, | |
bytes replacementPatternBuy, | |
bytes replacementPatternSell, | |
bytes staticExtradataBuy, | |
bytes staticExtradataSell) | |
public | |
view | |
returns (uint) | |
{ | |
// implementation here | |
} | |
} | |
// graph-ts codegen | |
calculateMatchPrice_( | |
addrs: Array<Address>, | |
uints: Array<BigInt>, | |
feeMethodsSidesKindsHowToCalls: Array<i32>, | |
calldataBuy: Bytes, | |
calldataSell: Bytes, | |
replacementPatternBuy: Bytes, | |
replacementPatternSell: Bytes, | |
staticExtradataBuy: Bytes, | |
staticExtradataSell: Bytes | |
): BigInt { | |
let result = super.call( | |
"calculateMatchPrice_", | |
"calculateMatchPrice_(address[14],uint256[18],uint8[8],bytes,bytes,bytes,bytes,bytes,bytes):(uint256)", | |
[ | |
ethereum.Value.fromAddressArray(addrs), // should use fromFixedSizedArray | |
ethereum.Value.fromUnsignedBigIntArray(uints), // should use fromFixedSizedArray | |
ethereum.Value.fromI32Array(feeMethodsSidesKindsHowToCalls), // should use fromFixedSizedArray AND also be UnsignedBigInt | |
ethereum.Value.fromBytes(calldataBuy), | |
ethereum.Value.fromBytes(calldataSell), | |
ethereum.Value.fromBytes(replacementPatternBuy), | |
ethereum.Value.fromBytes(replacementPatternSell), | |
ethereum.Value.fromBytes(staticExtradataBuy), | |
ethereum.Value.fromBytes(staticExtradataSell) | |
] | |
); | |
return result[0].toBigInt(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment