Skip to content
This repository was archived by the owner on Feb 11, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/hypercert-minter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ export function handleTransferSingle(event: TransferSingleEvent): void {
export function handleURI(event: URIEvent): void {}

export function handleValueTransfer(event: ValueTransferEvent): void {
log.debug("Received ValueTransferEvent claimID: {}", [
event.params.claimID.toString(),
]);
log.debug("Received ValueTransferEvent fromTokenID: {}", [
event.params.fromTokenID.toString(),
]);
log.debug("Received ValueTransferEvent toTokenID: {}", [
event.params.toTokenID.toString(),
]);

log.debug("Received ValueTransferEvent value: {}", [
event.params.value.toString(),
]);

let from = getOrCreateClaimToken(
event.params.claimID,
event.params.fromTokenID,
Expand All @@ -91,6 +105,10 @@ export function handleValueTransfer(event: ValueTransferEvent): void {

let value = event.params.value;

log.debug("Got from: {}", [from.id]);
log.debug("Got to: {}", [to.id]);
log.debug("Transfering value: {}", [value.toString()]);

// New mint
if (from.tokenID.isZero() && !to.tokenID.isZero()) {
to.units = value;
Expand Down Expand Up @@ -129,6 +147,9 @@ export function handleBatchValueTransfer(event: BatchValueTransfer): void {

let value = values[i];

log.debug("Got from: {}", [from.id]);
log.debug("Got to: {}", [to.id]);

// New mint
if (from.tokenID.isZero() && !to.tokenID.isZero()) {
to.units = value;
Expand Down
4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function getOrCreateAllowlist(
let id = getID(claimID, contract);
let list = Allowlist.load(id);

log.debug("Created claimID: {}", [id]);
log.debug("Created allowlistID: {}", [id]);

if (list == null) {
list = new Allowlist(id);
Expand Down Expand Up @@ -60,6 +60,8 @@ export function getOrCreateClaimToken(
let fraction = ClaimToken.load(id);

if (fraction == null) {
log.debug("Creating claimToken: {}", [id]);

let owner = minterContract.ownerOf(tokenID);

fraction = new ClaimToken(id);
Expand Down
4 changes: 2 additions & 2 deletions subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dataSources:
source:
address: "0x94a04Ce2e537eaf2Bdabd629dE503797e7021E87"
abi: HypercertMinter
startBlock: 8100246
startBlock: 8385407
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down Expand Up @@ -42,5 +42,5 @@ dataSources:
- event: ValueTransfer(uint256,uint256,uint256,uint256)
handler: handleValueTransfer
- event: BatchValueTransfer(uint256[],uint256[],uint256[],uint256[])
handler: handleValueTransfer
handler: handleBatchValueTransfer
file: ./src/hypercert-minter.ts
Binary file modified tests/.bin/hypercert-minter-allowlist.wasm
Binary file not shown.
Binary file modified tests/.bin/hypercert-minter-fraction.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/.latest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.5.4",
"timestamp": 1674820266495
"timestamp": 1675088377873
}