Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hazelnutcloud committed Feb 8, 2023
1 parent 74cbf30 commit bf0da3f
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 17 deletions.
1 change: 1 addition & 0 deletions examples/transfers/abis/qiToken.json

Large diffs are not rendered by default.

File renamed without changes.
Empty file.
28 changes: 28 additions & 0 deletions examples/transfers/handlers/mint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Point } from "https://esm.sh/@influxdata/[email protected]";
import { ethers } from "https://esm.sh/[email protected]";
import {
types,
utils,
} from "https://deno.land/x/[email protected]/lib/mod.ts";

const handler: types.EventHandler = async ({
contract,
event,
store,
}) => {
if (!event.args) {
return utils.error(`Event args are missing: ${event}`);
}

const [minter, mintAmount, mintTokens] = event.args;

const decimals = (await utils.getFromStore(
store,
`${contract.address}-decimals`,
contract.decimals,
)) as number;

return [];
};

export default handler;
Empty file.
Empty file.
Empty file.
47 changes: 36 additions & 11 deletions examples/transfers/manifest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,50 @@ export const manifest: IManifest = {
dataSources: [
{
chain: avalanche,
blockHandlers: [
{
blockInterval: 1,
handlerPath: "handlers/nativeTransfer.ts",
startBlockHeight: 0,
},
],
contracts: [
{
abiPath: "abis/erc20.json",
abiPath: "abis/qiToken.json",
sources: [
{
address: "",
startBlockHeight: -1,
address: "0x5C0401e81Bc07Ca70fAD469b451682c0d747Ef1c", // qiAVAX
startBlockHeight: 3046672,
},
{
address: "0xF362feA9659cf036792c9cb02f8ff8198E21B4cB", // qisAVAX
startBlockHeight: 13995148,
},
{
address: "0x89a415b3D20098E6A6C8f7a59001C67BD3129821", // qiBTC.b
startBlockHeight: 16578216,
},
{
address: "0xB715808a78F6041E46d61Cb123C9B4A27056AE9C", //qiUSDC
startBlockHeight: 13319519,
},
],
eventQueries: [
{
handler: "handlers/ERC20Transfer.ts",
handler: "handlers/mint.ts",
name: "Mint",
},
{
handler: "handlers/redeem.ts",
name: "Redeem",
},
{
handler: "handlers/borrow.ts",
name: "Borrow",
},
{
handler: "handlers/repay.ts",
name: "RepayBorrow",
},
{
handler: "handlers/liquidate.ts",
name: "LiquidateBorrow",
},
{
handler: "handlers/transfer.ts",
name: "Transfer",
},
],
Expand Down
6 changes: 0 additions & 6 deletions lib/arkiver/manifest-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ export class ManifestManager {
chain: dataSource.chain.name,
});

let startBlockHeight = source.startBlockHeight;
if (startBlockHeight === -1) {
startBlockHeight = contract.deploymentTransaction()!
.blockNumber!;
}

const instance = new ContractSource({
abiName: abi.name,
chainName: dataSource.chain.name,
Expand Down

0 comments on commit bf0da3f

Please sign in to comment.