-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Process ERC-721 information (#19)
- Loading branch information
1 parent
abc0736
commit 80002e1
Showing
7 changed files
with
555 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,256 @@ | ||
[ | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "owner", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "approved", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "uint256", | ||
"name": "tokenId", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "Approval", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "owner", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "operator", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": false, | ||
"internalType": "bool", | ||
"name": "approved", | ||
"type": "bool" | ||
} | ||
], | ||
"name": "ApprovalForAll", | ||
"type": "event" | ||
}, | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "from", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ | ||
"indexed": true, | ||
"internalType": "uint256", | ||
"name": "tokenId", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "Transfer", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "to", "type": "address" }, | ||
{ | ||
"internalType": "uint256", | ||
"name": "tokenId", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "approve", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "totalSupply", | ||
"outputs": [ | ||
{ | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "owner", "type": "address" } | ||
], | ||
"name": "balanceOf", | ||
"outputs": [ | ||
{ "internalType": "uint256", "name": "balance", "type": "uint256" } | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" } | ||
], | ||
"name": "getApproved", | ||
"outputs": [ | ||
{ "internalType": "address", "name": "operator", "type": "address" } | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "owner", "type": "address" }, | ||
{ | ||
"internalType": "address", | ||
"name": "operator", | ||
"type": "address" | ||
} | ||
], | ||
"name": "isApprovedForAll", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "name", | ||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" } | ||
], | ||
"name": "ownerOf", | ||
"outputs": [ | ||
{ "internalType": "address", "name": "owner", "type": "address" } | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "from", "type": "address" }, | ||
{ | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" } | ||
], | ||
"name": "safeTransferFrom", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "from", "type": "address" }, | ||
{ | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }, | ||
{ | ||
"internalType": "bytes", | ||
"name": "data", | ||
"type": "bytes" | ||
} | ||
], | ||
"name": "safeTransferFrom", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "address", | ||
"name": "operator", | ||
"type": "address" | ||
}, | ||
{ | ||
"internalType": "bool", | ||
"name": "_approved", | ||
"type": "bool" | ||
} | ||
], | ||
"name": "setApprovalForAll", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "bytes4", | ||
"name": "interfaceId", | ||
"type": "bytes4" | ||
} | ||
], | ||
"name": "supportsInterface", | ||
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "symbol", | ||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" } | ||
], | ||
"name": "tokenURI", | ||
"outputs": [{ "internalType": "string", "name": "", "type": "string" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "from", "type": "address" }, | ||
{ | ||
"internalType": "address", | ||
"name": "to", | ||
"type": "address" | ||
}, | ||
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" } | ||
], | ||
"name": "transferFrom", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = class Data1702358613609 { | ||
name = 'Data1702358613609' | ||
|
||
async up(db) { | ||
await db.query(`CREATE TABLE "nft" ("id" character varying NOT NULL, "name" text, "symbol" text, CONSTRAINT "PK_8f46897c58e23b0e7bf6c8e56b0" PRIMARY KEY ("id"))`) | ||
await db.query(`CREATE TABLE "erc721_deposit" ("id" character varying NOT NULL, "from" text NOT NULL, "token_index" numeric NOT NULL, "token_id" character varying, CONSTRAINT "PK_d23b7232706bd451820114b153e" PRIMARY KEY ("id"))`) | ||
await db.query(`CREATE INDEX "IDX_b79ae2a55e51afa505e904a123" ON "erc721_deposit" ("token_id") `) | ||
await db.query(`ALTER TABLE "input" ADD "erc721_deposit_id" character varying`) | ||
await db.query(`CREATE INDEX "IDX_0f62b1d844bf93606f92d72e73" ON "input" ("erc721_deposit_id") `) | ||
await db.query(`ALTER TABLE "erc721_deposit" ADD CONSTRAINT "FK_b79ae2a55e51afa505e904a1234" FOREIGN KEY ("token_id") REFERENCES "nft"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
await db.query(`ALTER TABLE "input" ADD CONSTRAINT "FK_0f62b1d844bf93606f92d72e73f" FOREIGN KEY ("erc721_deposit_id") REFERENCES "erc721_deposit"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
} | ||
|
||
async down(db) { | ||
await db.query(`DROP TABLE "nft"`) | ||
await db.query(`DROP TABLE "erc721_deposit"`) | ||
await db.query(`DROP INDEX "public"."IDX_b79ae2a55e51afa505e904a123"`) | ||
await db.query(`ALTER TABLE "input" DROP COLUMN "erc721_deposit_id"`) | ||
await db.query(`DROP INDEX "public"."IDX_0f62b1d844bf93606f92d72e73"`) | ||
await db.query(`ALTER TABLE "erc721_deposit" DROP CONSTRAINT "FK_b79ae2a55e51afa505e904a1234"`) | ||
await db.query(`ALTER TABLE "input" DROP CONSTRAINT "FK_0f62b1d844bf93606f92d72e73f"`) | ||
} | ||
} |
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
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
Oops, something went wrong.