-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
} from "../generated/schema" | ||
|
||
export function handleAllowanceRemoved(event: AllowanceRemovedEvent): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sure about this one tbh. It compiles and builds fine for me. Does yarn build
not work for you or is this a VS Code linter thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting 🤔 This may be something that VS Code finds an issue with, while your editor doesn't (you're using NeoVim I think). It seems that the visibility of these errors is environment-specific, see https://stackoverflow.com/a/60688789/21983222
Anyway, the reason for the errors seems to be described in this GH issue in the official TS repo microsoft/TypeScript#2361
Nevertheless, it seems that these errors should not affect our code, because BigInt
overloads the +
operator to allow for adding to BigInts (see source).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
yarn build
not work for you...?
The command fails because I'm missing some ABIs, one of which is abis/EndowmentMultiSigEmitter.json
. Would it be possible to either:
- add ABIs used to build the graph to the source code
or - remove dependence on ABI files and pull them from Etherscan (assuming the contracts are verified, which they should always be anyway)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mappings code is written in AssemblyScript, a more strict subset of TypeScript that compiles to WASM, so that might account for the errors?
You're right on the += & -= stuff. Will scan through the mappings and fix those to be more explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command fails because I'm missing some ABIs
Simply copy the relevant JSON files from the evm-smart-contracts
repo into the abi
folder in this repo. Examples (adjust to fit your dir/folder structure ofc):
cp ../evm-smart-contracts/artifacts/contracts/multisigs/APTeamMultiSig.sol/APTeamMultiSig.json ./abis/
cp ../evm-smart-contracts/artifacts/contracts/normalized_endowment/endowment-multisig/EndowmentMultiSig.sol/EndowmentMultiSig.json ./abis/
cp ../evm-smart-contracts/artifacts/contracts/normalized_endowment/endowment-multisig/EndowmentMultiSigEmitter.sol/EndowmentMultiSigEmitter.json ./abis/
cp ../evm-smart-contracts/artifacts/contracts/multisigs/CharityApplications.sol/CharityApplications.json ./abis/
cp ../evm-smart-contracts/artifacts/contracts/core/accounts/interfaces/IAccounts.sol/IAccounts.json ./abis/
UPDATE: You could try to symbolically link them as well, so as to not need to re-copy them with every contract code change / recompile cycle. 💡
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the +=
& -=
to use BigInt.plus()
[ie. x.plux(y)
] and BigInt.minus()
[ie. x.minus(y)
] respectively in d87f00b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right on the += & -= stuff
When I said "these errors should not affect our code", what I meant to say was "these errors should not affect the execution of our code", meaning we could technically leave things as-is 😅
Anyways, now that you've updated everything to use .plus() & .minus() & ...
operations, it could even be a good thing, if nothing else then just to be safe (and to avoid seeing error warnings)
This seems a bit fragile, as it would mean that we wouldn't be able to The contracts we deploy should always be verified, so it should be safe to depend on ABIs downloaded from Etherscan and not on actual ABI files. Nevertheless, merging this branch as the code within satisfies the requirements, we can address the ABI issue separately. |
First stab at refactoring the SubGraph schema and mappings to allow for processing and tracking more relevant info from the contracts.