0x2bfa3a690b88f51c03ddf63e16d9ce55818ca417e6f52adb4b0ab326572bb9e3
This file contains hidden or 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
type action is | |
| Increment of (int) | |
| Decrement of (int) | |
| Reset of (unit) | |
type store is unit | |
type return is list (operation) * store | |
const dest : address = ("KT1ExEhdgHTzotFdPsp4mhNC6rqK4h6EKUQu" : address) |
This file contains hidden or 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
type action is | |
| Increment of (int) | |
| Decrement of (int) | |
| Reset of (unit) | |
type store is int | |
type return is list (operation) * store | |
const emptyOps: list(operation) = list end |
This file contains hidden or 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
type action is | |
| GetFoo of (address) | |
| SetFoo of (int) | |
type store is record | |
foo: int; | |
end | |
type return is list (operation) * store |
This file contains hidden or 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
type request is record | |
callback : contract(int) | |
end | |
type action is | |
| GetBar of (request) | |
| SetBar of (int) | |
type store is record | |
bar: int; |
This file contains hidden or 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
export async function tryGetRevertReason(to: string, from: string, data: string): Promise<string | undefined> { | |
const provider = ethers.getDefaultProvider(); | |
const tx = { to, from, data }; | |
try { | |
await provider.estimateGas(tx); | |
} catch { | |
const value = await provider.call(tx); | |
return hexDataLength(value) % 32 === 4 && hexDataSlice(value, 0, 4) === '0x08c379a0' | |
? defaultAbiCoder.decode(['string'], hexDataSlice(value, 4)) | |
: undefined; |
OlderNewer