add creator address to pledge
This commit is contained in:
parent
22b5179bc2
commit
fec97a5253
Binary file not shown.
|
@ -33,6 +33,7 @@ type Pledge @entity {
|
|||
pledgeState: Int!
|
||||
creationTime: BigInt!
|
||||
oldPledge: Pledge
|
||||
creatorAddr: Bytes!
|
||||
}
|
||||
|
||||
type ProjectInfo @entity {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
specVersion: 0.0.1
|
||||
specVersion: 0.0.2
|
||||
schema:
|
||||
file: schema.graphql
|
||||
dataSources:
|
||||
|
@ -8,6 +8,7 @@ dataSources:
|
|||
source:
|
||||
address: "0x2cEfae94eB05737827D245E9cb6c1ca3C2A0Fe52"
|
||||
abi: Contract
|
||||
startBlock: 6157524
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.3
|
||||
|
|
|
@ -11,7 +11,8 @@ import {
|
|||
EthereumTuple,
|
||||
Bytes,
|
||||
Address,
|
||||
BigInt
|
||||
BigInt,
|
||||
CallResult
|
||||
} from "@graphprotocol/graph-ts";
|
||||
|
||||
export class Transfer extends EthereumEvent {
|
||||
|
@ -309,31 +310,83 @@ export class Contract extends SmartContract {
|
|||
|
||||
APP_ADDR_NAMESPACE(): Bytes {
|
||||
let result = super.call("APP_ADDR_NAMESPACE", []);
|
||||
|
||||
return result[0].toBytes();
|
||||
}
|
||||
|
||||
try_APP_ADDR_NAMESPACE(): CallResult<Bytes> {
|
||||
let result = super.tryCall("APP_ADDR_NAMESPACE", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBytes());
|
||||
}
|
||||
|
||||
whitelistDisabled(): boolean {
|
||||
let result = super.call("whitelistDisabled", []);
|
||||
|
||||
return result[0].toBoolean();
|
||||
}
|
||||
|
||||
try_whitelistDisabled(): CallResult<boolean> {
|
||||
let result = super.tryCall("whitelistDisabled", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBoolean());
|
||||
}
|
||||
|
||||
isProjectCanceled(projectId: BigInt): boolean {
|
||||
let result = super.call("isProjectCanceled", [
|
||||
EthereumValue.fromUnsignedBigInt(projectId)
|
||||
]);
|
||||
|
||||
return result[0].toBoolean();
|
||||
}
|
||||
|
||||
try_isProjectCanceled(projectId: BigInt): CallResult<boolean> {
|
||||
let result = super.tryCall("isProjectCanceled", [
|
||||
EthereumValue.fromUnsignedBigInt(projectId)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBoolean());
|
||||
}
|
||||
|
||||
PLUGIN_MANAGER_ROLE(): Bytes {
|
||||
let result = super.call("PLUGIN_MANAGER_ROLE", []);
|
||||
|
||||
return result[0].toBytes();
|
||||
}
|
||||
|
||||
try_PLUGIN_MANAGER_ROLE(): CallResult<Bytes> {
|
||||
let result = super.tryCall("PLUGIN_MANAGER_ROLE", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBytes());
|
||||
}
|
||||
|
||||
numberOfPledges(): BigInt {
|
||||
let result = super.call("numberOfPledges", []);
|
||||
|
||||
return result[0].toBigInt();
|
||||
}
|
||||
|
||||
try_numberOfPledges(): CallResult<BigInt> {
|
||||
let result = super.tryCall("numberOfPledges", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBigInt());
|
||||
}
|
||||
|
||||
getPledgeDelegate(
|
||||
idPledge: BigInt,
|
||||
idxDelegate: BigInt
|
||||
|
@ -342,6 +395,7 @@ export class Contract extends SmartContract {
|
|||
EthereumValue.fromUnsignedBigInt(idPledge),
|
||||
EthereumValue.fromUnsignedBigInt(idxDelegate)
|
||||
]);
|
||||
|
||||
return new Contract__getPledgeDelegateResult(
|
||||
result[0].toBigInt(),
|
||||
result[1].toAddress(),
|
||||
|
@ -349,15 +403,47 @@ export class Contract extends SmartContract {
|
|||
);
|
||||
}
|
||||
|
||||
try_getPledgeDelegate(
|
||||
idPledge: BigInt,
|
||||
idxDelegate: BigInt
|
||||
): CallResult<Contract__getPledgeDelegateResult> {
|
||||
let result = super.tryCall("getPledgeDelegate", [
|
||||
EthereumValue.fromUnsignedBigInt(idPledge),
|
||||
EthereumValue.fromUnsignedBigInt(idxDelegate)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(
|
||||
new Contract__getPledgeDelegateResult(
|
||||
value[0].toBigInt(),
|
||||
value[1].toAddress(),
|
||||
value[2].toString()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
getRecoveryVault(): Address {
|
||||
let result = super.call("getRecoveryVault", []);
|
||||
|
||||
return result[0].toAddress();
|
||||
}
|
||||
|
||||
try_getRecoveryVault(): CallResult<Address> {
|
||||
let result = super.tryCall("getRecoveryVault", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toAddress());
|
||||
}
|
||||
|
||||
getPledge(idPledge: BigInt): Contract__getPledgeResult {
|
||||
let result = super.call("getPledge", [
|
||||
EthereumValue.fromUnsignedBigInt(idPledge)
|
||||
]);
|
||||
|
||||
return new Contract__getPledgeResult(
|
||||
result[0].toBigInt(),
|
||||
result[1].toBigInt(),
|
||||
|
@ -370,18 +456,64 @@ export class Contract extends SmartContract {
|
|||
);
|
||||
}
|
||||
|
||||
try_getPledge(idPledge: BigInt): CallResult<Contract__getPledgeResult> {
|
||||
let result = super.tryCall("getPledge", [
|
||||
EthereumValue.fromUnsignedBigInt(idPledge)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(
|
||||
new Contract__getPledgeResult(
|
||||
value[0].toBigInt(),
|
||||
value[1].toBigInt(),
|
||||
value[2].toBigInt(),
|
||||
value[3].toBigInt(),
|
||||
value[4].toBigInt(),
|
||||
value[5].toBigInt(),
|
||||
value[6].toAddress(),
|
||||
value[7].toI32()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
isValidPlugin(addr: Address): boolean {
|
||||
let result = super.call("isValidPlugin", [EthereumValue.fromAddress(addr)]);
|
||||
|
||||
return result[0].toBoolean();
|
||||
}
|
||||
|
||||
try_isValidPlugin(addr: Address): CallResult<boolean> {
|
||||
let result = super.tryCall("isValidPlugin", [
|
||||
EthereumValue.fromAddress(addr)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBoolean());
|
||||
}
|
||||
|
||||
normalizePledge(idPledge: BigInt): BigInt {
|
||||
let result = super.call("normalizePledge", [
|
||||
EthereumValue.fromUnsignedBigInt(idPledge)
|
||||
]);
|
||||
|
||||
return result[0].toBigInt();
|
||||
}
|
||||
|
||||
try_normalizePledge(idPledge: BigInt): CallResult<BigInt> {
|
||||
let result = super.tryCall("normalizePledge", [
|
||||
EthereumValue.fromUnsignedBigInt(idPledge)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBigInt());
|
||||
}
|
||||
|
||||
addDelegate(
|
||||
name: string,
|
||||
url: string,
|
||||
|
@ -394,19 +526,59 @@ export class Contract extends SmartContract {
|
|||
EthereumValue.fromUnsignedBigInt(commitTime),
|
||||
EthereumValue.fromAddress(plugin)
|
||||
]);
|
||||
|
||||
return result[0].toBigInt();
|
||||
}
|
||||
|
||||
try_addDelegate(
|
||||
name: string,
|
||||
url: string,
|
||||
commitTime: BigInt,
|
||||
plugin: Address
|
||||
): CallResult<BigInt> {
|
||||
let result = super.tryCall("addDelegate", [
|
||||
EthereumValue.fromString(name),
|
||||
EthereumValue.fromString(url),
|
||||
EthereumValue.fromUnsignedBigInt(commitTime),
|
||||
EthereumValue.fromAddress(plugin)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBigInt());
|
||||
}
|
||||
|
||||
numberOfPledgeAdmins(): BigInt {
|
||||
let result = super.call("numberOfPledgeAdmins", []);
|
||||
|
||||
return result[0].toBigInt();
|
||||
}
|
||||
|
||||
try_numberOfPledgeAdmins(): CallResult<BigInt> {
|
||||
let result = super.tryCall("numberOfPledgeAdmins", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBigInt());
|
||||
}
|
||||
|
||||
EVMSCRIPT_REGISTRY_APP_ID(): Bytes {
|
||||
let result = super.call("EVMSCRIPT_REGISTRY_APP_ID", []);
|
||||
|
||||
return result[0].toBytes();
|
||||
}
|
||||
|
||||
try_EVMSCRIPT_REGISTRY_APP_ID(): CallResult<Bytes> {
|
||||
let result = super.tryCall("EVMSCRIPT_REGISTRY_APP_ID", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBytes());
|
||||
}
|
||||
|
||||
addGiver(
|
||||
addr: Address,
|
||||
name: string,
|
||||
|
@ -421,9 +593,31 @@ export class Contract extends SmartContract {
|
|||
EthereumValue.fromUnsignedBigInt(commitTime),
|
||||
EthereumValue.fromAddress(plugin)
|
||||
]);
|
||||
|
||||
return result[0].toBigInt();
|
||||
}
|
||||
|
||||
try_addGiver(
|
||||
addr: Address,
|
||||
name: string,
|
||||
url: string,
|
||||
commitTime: BigInt,
|
||||
plugin: Address
|
||||
): CallResult<BigInt> {
|
||||
let result = super.tryCall("addGiver", [
|
||||
EthereumValue.fromAddress(addr),
|
||||
EthereumValue.fromString(name),
|
||||
EthereumValue.fromString(url),
|
||||
EthereumValue.fromUnsignedBigInt(commitTime),
|
||||
EthereumValue.fromAddress(plugin)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBigInt());
|
||||
}
|
||||
|
||||
addProject(
|
||||
name: string,
|
||||
url: string,
|
||||
|
@ -440,16 +634,52 @@ export class Contract extends SmartContract {
|
|||
EthereumValue.fromUnsignedBigInt(commitTime),
|
||||
EthereumValue.fromAddress(plugin)
|
||||
]);
|
||||
|
||||
return result[0].toBigInt();
|
||||
}
|
||||
|
||||
try_addProject(
|
||||
name: string,
|
||||
url: string,
|
||||
projectAdmin: Address,
|
||||
parentProject: BigInt,
|
||||
commitTime: BigInt,
|
||||
plugin: Address
|
||||
): CallResult<BigInt> {
|
||||
let result = super.tryCall("addProject", [
|
||||
EthereumValue.fromString(name),
|
||||
EthereumValue.fromString(url),
|
||||
EthereumValue.fromAddress(projectAdmin),
|
||||
EthereumValue.fromUnsignedBigInt(parentProject),
|
||||
EthereumValue.fromUnsignedBigInt(commitTime),
|
||||
EthereumValue.fromAddress(plugin)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBigInt());
|
||||
}
|
||||
|
||||
allowRecoverability(token: Address): boolean {
|
||||
let result = super.call("allowRecoverability", [
|
||||
EthereumValue.fromAddress(token)
|
||||
]);
|
||||
|
||||
return result[0].toBoolean();
|
||||
}
|
||||
|
||||
try_allowRecoverability(token: Address): CallResult<boolean> {
|
||||
let result = super.tryCall("allowRecoverability", [
|
||||
EthereumValue.fromAddress(token)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBoolean());
|
||||
}
|
||||
|
||||
addGiver1(
|
||||
name: string,
|
||||
url: string,
|
||||
|
@ -462,52 +692,153 @@ export class Contract extends SmartContract {
|
|||
EthereumValue.fromUnsignedBigInt(commitTime),
|
||||
EthereumValue.fromAddress(plugin)
|
||||
]);
|
||||
|
||||
return result[0].toBigInt();
|
||||
}
|
||||
|
||||
try_addGiver1(
|
||||
name: string,
|
||||
url: string,
|
||||
commitTime: BigInt,
|
||||
plugin: Address
|
||||
): CallResult<BigInt> {
|
||||
let result = super.tryCall("addGiver", [
|
||||
EthereumValue.fromString(name),
|
||||
EthereumValue.fromString(url),
|
||||
EthereumValue.fromUnsignedBigInt(commitTime),
|
||||
EthereumValue.fromAddress(plugin)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBigInt());
|
||||
}
|
||||
|
||||
appId(): Bytes {
|
||||
let result = super.call("appId", []);
|
||||
|
||||
return result[0].toBytes();
|
||||
}
|
||||
|
||||
try_appId(): CallResult<Bytes> {
|
||||
let result = super.tryCall("appId", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBytes());
|
||||
}
|
||||
|
||||
getCodeHash(addr: Address): Bytes {
|
||||
let result = super.call("getCodeHash", [EthereumValue.fromAddress(addr)]);
|
||||
|
||||
return result[0].toBytes();
|
||||
}
|
||||
|
||||
try_getCodeHash(addr: Address): CallResult<Bytes> {
|
||||
let result = super.tryCall("getCodeHash", [
|
||||
EthereumValue.fromAddress(addr)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBytes());
|
||||
}
|
||||
|
||||
ETH(): Address {
|
||||
let result = super.call("ETH", []);
|
||||
|
||||
return result[0].toAddress();
|
||||
}
|
||||
|
||||
try_ETH(): CallResult<Address> {
|
||||
let result = super.tryCall("ETH", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toAddress());
|
||||
}
|
||||
|
||||
getInitializationBlock(): BigInt {
|
||||
let result = super.call("getInitializationBlock", []);
|
||||
|
||||
return result[0].toBigInt();
|
||||
}
|
||||
|
||||
try_getInitializationBlock(): CallResult<BigInt> {
|
||||
let result = super.tryCall("getInitializationBlock", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBigInt());
|
||||
}
|
||||
|
||||
EVMSCRIPT_REGISTRY_APP(): Bytes {
|
||||
let result = super.call("EVMSCRIPT_REGISTRY_APP", []);
|
||||
|
||||
return result[0].toBytes();
|
||||
}
|
||||
|
||||
try_EVMSCRIPT_REGISTRY_APP(): CallResult<Bytes> {
|
||||
let result = super.tryCall("EVMSCRIPT_REGISTRY_APP", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBytes());
|
||||
}
|
||||
|
||||
canPerform(_sender: Address, _role: Bytes, params: Array<BigInt>): boolean {
|
||||
let result = super.call("canPerform", [
|
||||
EthereumValue.fromAddress(_sender),
|
||||
EthereumValue.fromFixedBytes(_role),
|
||||
EthereumValue.fromUnsignedBigIntArray(params)
|
||||
]);
|
||||
|
||||
return result[0].toBoolean();
|
||||
}
|
||||
|
||||
try_canPerform(
|
||||
_sender: Address,
|
||||
_role: Bytes,
|
||||
params: Array<BigInt>
|
||||
): CallResult<boolean> {
|
||||
let result = super.tryCall("canPerform", [
|
||||
EthereumValue.fromAddress(_sender),
|
||||
EthereumValue.fromFixedBytes(_role),
|
||||
EthereumValue.fromUnsignedBigIntArray(params)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toBoolean());
|
||||
}
|
||||
|
||||
kernel(): Address {
|
||||
let result = super.call("kernel", []);
|
||||
|
||||
return result[0].toAddress();
|
||||
}
|
||||
|
||||
try_kernel(): CallResult<Address> {
|
||||
let result = super.tryCall("kernel", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toAddress());
|
||||
}
|
||||
|
||||
getPledgeAdmin(idAdmin: BigInt): Contract__getPledgeAdminResult {
|
||||
let result = super.call("getPledgeAdmin", [
|
||||
EthereumValue.fromUnsignedBigInt(idAdmin)
|
||||
]);
|
||||
|
||||
return new Contract__getPledgeAdminResult(
|
||||
result[0].toI32(),
|
||||
result[1].toAddress(),
|
||||
|
@ -520,15 +851,61 @@ export class Contract extends SmartContract {
|
|||
);
|
||||
}
|
||||
|
||||
try_getPledgeAdmin(
|
||||
idAdmin: BigInt
|
||||
): CallResult<Contract__getPledgeAdminResult> {
|
||||
let result = super.tryCall("getPledgeAdmin", [
|
||||
EthereumValue.fromUnsignedBigInt(idAdmin)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(
|
||||
new Contract__getPledgeAdminResult(
|
||||
value[0].toI32(),
|
||||
value[1].toAddress(),
|
||||
value[2].toString(),
|
||||
value[3].toString(),
|
||||
value[4].toBigInt(),
|
||||
value[5].toBigInt(),
|
||||
value[6].toBoolean(),
|
||||
value[7].toAddress()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
getExecutor(_script: Bytes): Address {
|
||||
let result = super.call("getExecutor", [EthereumValue.fromBytes(_script)]);
|
||||
|
||||
return result[0].toAddress();
|
||||
}
|
||||
|
||||
try_getExecutor(_script: Bytes): CallResult<Address> {
|
||||
let result = super.tryCall("getExecutor", [
|
||||
EthereumValue.fromBytes(_script)
|
||||
]);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toAddress());
|
||||
}
|
||||
|
||||
vault(): Address {
|
||||
let result = super.call("vault", []);
|
||||
|
||||
return result[0].toAddress();
|
||||
}
|
||||
|
||||
try_vault(): CallResult<Address> {
|
||||
let result = super.tryCall("vault", []);
|
||||
if (result.reverted) {
|
||||
return new CallResult();
|
||||
}
|
||||
let value = result.value;
|
||||
return CallResult.fromValue(value[0].toAddress());
|
||||
}
|
||||
}
|
||||
|
||||
export class AddGiverAndDonateCall extends EthereumCall {
|
||||
|
|
|
@ -352,6 +352,15 @@ export class Pledge extends Entity {
|
|||
this.set("oldPledge", Value.fromString(value as string));
|
||||
}
|
||||
}
|
||||
|
||||
get creatorAddr(): Bytes {
|
||||
let value = this.get("creatorAddr");
|
||||
return value.toBytes();
|
||||
}
|
||||
|
||||
set creatorAddr(value: Bytes) {
|
||||
this.set("creatorAddr", Value.fromBytes(value));
|
||||
}
|
||||
}
|
||||
|
||||
export class ProjectInfo extends Entity {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 bgits/liquid-funding-rinkeby"
|
||||
},
|
||||
"dependencies": {
|
||||
"@graphprotocol/graph-cli": "0.14.0",
|
||||
"@graphprotocol/graph-ts": "0.13.0"
|
||||
"@graphprotocol/graph-cli": "0.16.0",
|
||||
"@graphprotocol/graph-ts": "0.16.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ type Pledge @entity {
|
|||
pledgeState: Int!
|
||||
creationTime: BigInt!
|
||||
oldPledge: Pledge
|
||||
creatorAddr: Bytes!
|
||||
}
|
||||
|
||||
type ProjectInfo @entity {
|
||||
|
|
|
@ -12,10 +12,10 @@ import {
|
|||
AddProjectCall,
|
||||
AddGiverCall,
|
||||
DonateCall,
|
||||
AddGiverAndDonateCall,
|
||||
} from "../generated/Contract/Contract"
|
||||
import { Profile, PledgesInfo, Pledge, ProjectInfo } from "../generated/schema"
|
||||
|
||||
|
||||
export function handleAddGiver(call: AddGiverCall): void {
|
||||
log.info(
|
||||
'handleAddGiver triggered. idGiver: {}',
|
||||
|
@ -125,31 +125,7 @@ export function handleDonate(call: DonateCall): void {
|
|||
)
|
||||
}
|
||||
|
||||
export function handleAddGiverAndDonate(call: AddGiverAndDonateCall): void {
|
||||
// let receiver = call.inputs.idReceiver
|
||||
// let token = call.inputs.token
|
||||
// let amount = call.inputs.amount
|
||||
// let receiverId = receiver.toString() + token.toString()
|
||||
|
||||
// let receiverPledges = PledgesInfo.load(receiverId)
|
||||
|
||||
// if (receiverPledges == null) {
|
||||
// receiverPledges = new PledgesInfo(receiverId)
|
||||
// receiverPledges.token = token.toString()
|
||||
// receiverPledges.profile = receiver.toHex()
|
||||
// }
|
||||
// receiverPledges.lifetimeReceived.plus(amount)
|
||||
// receiverPledges.balance.plus(amount)
|
||||
// receiverPledges.save()
|
||||
log.info(
|
||||
'id receiver: {}, amount: {}, token: {}',
|
||||
[
|
||||
call.inputs.idReceiver.toString(),
|
||||
call.inputs.amount.toString(),
|
||||
call.inputs.token.toString()
|
||||
]
|
||||
)
|
||||
}
|
||||
const getPledgeInfoId = (pledge: Pledge): string => pledge.owner + pledge.token
|
||||
function createOrUpdatePledgeInfo(event: Transfer): void {
|
||||
let pledgeTo = Pledge.load(event.params.to.toHex())
|
||||
|
@ -231,6 +207,7 @@ function createOrUpdatePledge(event: Transfer): void {
|
|||
toPledge.nDelegates = ndelegates
|
||||
toPledge.creationTime = timestamp
|
||||
toPledge.oldPledge = event.params.from.toHex()
|
||||
toPledge.creatorAddr = event.transaction.from
|
||||
toPledge.save()
|
||||
}
|
||||
|
||||
|
@ -282,7 +259,21 @@ export function handleTransfer(event: Transfer): void {
|
|||
// - contract.vault(...)
|
||||
}
|
||||
|
||||
export function handleGiverAdded(event: GiverAdded): void {}
|
||||
export function handleGiverAdded(event: GiverAdded): void {
|
||||
let id = event.params.idGiver
|
||||
let timestamp = event.block.timestamp
|
||||
let profile = new Profile(id.toHex())
|
||||
let content = event.params.url
|
||||
profile.url = content
|
||||
profile.addr = event.params.addr
|
||||
profile.name = ''
|
||||
profile.canceled = false
|
||||
profile.commitTime = new BigInt(259200) // this is standard when creating giver for donation
|
||||
profile.type = 'GIVER'
|
||||
profile.profileId = id
|
||||
profile.creationTime = timestamp
|
||||
profile.save()
|
||||
}
|
||||
|
||||
export function handleCancelProject(event: CancelProject): void {}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
specVersion: 0.0.1
|
||||
specVersion: 0.0.2
|
||||
schema:
|
||||
file: ./schema.graphql
|
||||
dataSources:
|
||||
|
@ -8,6 +8,7 @@ dataSources:
|
|||
source:
|
||||
address: "0x2cEfae94eB05737827D245E9cb6c1ca3C2A0Fe52"
|
||||
abi: Contract
|
||||
startBlock: 6157524
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.3
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
dependencies:
|
||||
regenerator-runtime "^0.13.2"
|
||||
|
||||
"@graphprotocol/graph-cli@0.14.0":
|
||||
version "0.14.0"
|
||||
resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.14.0.tgz#61ce53f3087975ec970f0ab28c72ef7a15945d51"
|
||||
integrity sha512-xW0A0ZVdF8r9IjpIgfg3sAgJ+neMRSRuKd9hmvFdgepuAYJTMNdFppJhHjuqe0y/krg0dw21jhC7/+mlC7X4lQ==
|
||||
"@graphprotocol/graph-cli@0.16.0":
|
||||
version "0.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.16.0.tgz#0829a42a2ec4c122fbdb8bfb482b74e0d27db935"
|
||||
integrity sha512-tTpJc9waeRPzhF/aeWxu4jGW7GonVTQBeubTGVC6B2oFHpADXrQdthPgpmtThexXGHk46q14bHLuiSEm6ZBpkw==
|
||||
dependencies:
|
||||
assemblyscript "https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3"
|
||||
chalk "^2.4.1"
|
||||
|
@ -23,7 +23,7 @@
|
|||
gluegun "^3.0.0"
|
||||
graphql "^14.0.2"
|
||||
immutable "^3.8.2"
|
||||
ipfs-http-client "^33.1.0"
|
||||
ipfs-http-client "^34.0.0"
|
||||
jayson "^3.0.2"
|
||||
js-yaml "^3.13.1"
|
||||
node-fetch "^2.3.0"
|
||||
|
@ -34,10 +34,10 @@
|
|||
optionalDependencies:
|
||||
keytar "^4.6.0"
|
||||
|
||||
"@graphprotocol/graph-ts@0.13.0":
|
||||
version "0.13.0"
|
||||
resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.13.0.tgz#5c1c440094270209eb68647ce59f8cad0987dda3"
|
||||
integrity sha512-ajrGdh+/wDgMg0+FYw+ZmbUAaveorD5IHaSWAtms0PFhoiebeBcYHCCFh0FYWNJtumG9Il3GNkD9zo48iEwWSA==
|
||||
"@graphprotocol/graph-ts@0.16.0":
|
||||
version "0.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.16.0.tgz#a6f5e8a39b7d651887c80bb2422cfb3a0fbf55d7"
|
||||
integrity sha512-zDhlIYlzE0xq5cJkF6fGwshfPR2z6rRZetNCgEclAtDv1uPSQaPQJuiIWL2hpTMjYHLX2OSNxy8F1G69jC708A==
|
||||
dependencies:
|
||||
assemblyscript "https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3"
|
||||
|
||||
|
@ -59,6 +59,13 @@ JSONStream@^1.3.1:
|
|||
jsonparse "^1.2.0"
|
||||
through ">=2.2.7 <3"
|
||||
|
||||
abort-controller@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
|
||||
integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==
|
||||
dependencies:
|
||||
event-target-shim "^5.0.0"
|
||||
|
||||
ajv@^6.5.5:
|
||||
version "6.10.2"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52"
|
||||
|
@ -375,6 +382,14 @@ buffer@^5.2.1:
|
|||
base64-js "^1.0.2"
|
||||
ieee754 "^1.1.4"
|
||||
|
||||
buffer@^5.4.2:
|
||||
version "5.4.3"
|
||||
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.4.3.tgz#3fbc9c69eb713d323e3fc1a895eee0710c072115"
|
||||
integrity sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==
|
||||
dependencies:
|
||||
base64-js "^1.0.2"
|
||||
ieee754 "^1.1.4"
|
||||
|
||||
builtin-status-codes@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
|
||||
|
@ -713,6 +728,11 @@ err-code@^1.1.2:
|
|||
resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960"
|
||||
integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=
|
||||
|
||||
err-code@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.0.tgz#452dadddde12356b1dd5a85f33b28ddda377ef2a"
|
||||
integrity sha512-MsMOijQ4v0xlmrz1fc7lyPEy7jFhoNF7EVaRSP7mPzs20LaFOwG6qNjGRy3Ie85n9DARlcUnB1zbsBv5sJrIvw==
|
||||
|
||||
error-ex@^1.3.1:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
|
||||
|
@ -742,6 +762,11 @@ esprima@^4.0.0:
|
|||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
|
||||
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
|
||||
|
||||
event-target-shim@^5.0.0:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
|
||||
integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
|
||||
|
||||
evp_bytestokey@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02"
|
||||
|
@ -768,6 +793,11 @@ expand-template@^2.0.3:
|
|||
resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
|
||||
integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==
|
||||
|
||||
explain-error@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/explain-error/-/explain-error-1.0.4.tgz#a793d3ac0cad4c6ab571e9968fbbab6cb2532929"
|
||||
integrity sha1-p5PTrAytTGq1cemWj7urbLJTKSk=
|
||||
|
||||
extend@~3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
|
||||
|
@ -1085,22 +1115,24 @@ ipfs-block@~0.8.1:
|
|||
cids "~0.7.0"
|
||||
class-is "^1.1.0"
|
||||
|
||||
ipfs-http-client@^33.1.0:
|
||||
version "33.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ipfs-http-client/-/ipfs-http-client-33.1.1.tgz#6ddc13e86f8db768093290b19537d2388c74dd45"
|
||||
integrity sha512-iwtLL3lOIzxXJFwLnOEtFUv1cYTuWJ0NauD7rpMEd/y4C7z6fuN6TSF4h547lxMh7sJWv+6Z0PmOA5N8FzUHJw==
|
||||
ipfs-http-client@^34.0.0:
|
||||
version "34.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ipfs-http-client/-/ipfs-http-client-34.0.0.tgz#8804d06a11c22306332a8ffa0949b6f672a0c9c8"
|
||||
integrity sha512-4RCkk8ix4Dqn6sxqFVwuXWCZ1eLFPsVaj6Ijvu1fs9VYgxgVudsW9PWwarlr4mw1xUCmPWYyXnEbGgzBrfMy0Q==
|
||||
dependencies:
|
||||
abort-controller "^3.0.0"
|
||||
async "^2.6.1"
|
||||
bignumber.js "^9.0.0"
|
||||
bl "^3.0.0"
|
||||
bs58 "^4.0.1"
|
||||
buffer "^5.2.1"
|
||||
buffer "^5.4.2"
|
||||
cids "~0.7.1"
|
||||
concat-stream "github:hugomrdias/concat-stream#feat/smaller"
|
||||
debug "^4.1.0"
|
||||
detect-node "^2.0.4"
|
||||
end-of-stream "^1.4.1"
|
||||
err-code "^1.1.2"
|
||||
err-code "^2.0.0"
|
||||
explain-error "^1.0.4"
|
||||
flatmap "0.0.3"
|
||||
glob "^7.1.3"
|
||||
ipfs-block "~0.8.1"
|
||||
|
@ -1113,9 +1145,12 @@ ipfs-http-client@^33.1.0:
|
|||
is-stream "^2.0.0"
|
||||
iso-stream-http "~0.1.2"
|
||||
iso-url "~0.4.6"
|
||||
iterable-ndjson "^1.1.0"
|
||||
just-kebab-case "^1.1.0"
|
||||
just-map-keys "^1.1.0"
|
||||
kind-of "^6.0.2"
|
||||
ky "^0.11.2"
|
||||
ky-universal "^0.2.2"
|
||||
lru-cache "^5.1.1"
|
||||
multiaddr "^6.0.6"
|
||||
multibase "~0.6.0"
|
||||
|
@ -1123,8 +1158,9 @@ ipfs-http-client@^33.1.0:
|
|||
multihashes "~0.4.14"
|
||||
ndjson "github:hugomrdias/ndjson#feat/readable-stream3"
|
||||
once "^1.4.0"
|
||||
peer-id "~0.12.2"
|
||||
peer-id "~0.12.3"
|
||||
peer-info "~0.15.1"
|
||||
promise-nodeify "^3.0.1"
|
||||
promisify-es6 "^1.0.3"
|
||||
pull-defer "~0.2.3"
|
||||
pull-stream "^3.6.9"
|
||||
|
@ -1320,6 +1356,13 @@ isstream@~0.1.2:
|
|||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
||||
|
||||
iterable-ndjson@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/iterable-ndjson/-/iterable-ndjson-1.1.0.tgz#36f7e8a5bb04fd087d384f29e44fc4280fc014fc"
|
||||
integrity sha512-OOp1Lb0o3k5MkXHx1YaIY5Z0ELosZfTnBaas9f8opJVcZGBIONA2zY/6CYE+LKkqrSDooIneZbrBGgOZnHPkrg==
|
||||
dependencies:
|
||||
string_decoder "^1.2.0"
|
||||
|
||||
iterall@^1.2.2:
|
||||
version "1.2.2"
|
||||
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7"
|
||||
|
@ -1434,6 +1477,19 @@ kind-of@^6.0.2:
|
|||
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"
|
||||
integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==
|
||||
|
||||
ky-universal@^0.2.2:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/ky-universal/-/ky-universal-0.2.2.tgz#7a36e1a75641a98f878157463513965f799f5bfe"
|
||||
integrity sha512-fb32o/fKy/ux2ALWa9HU2hvGtfOq7/vn2nH0FpVE+jwNzyTeORlAbj3Fiw+WLMbUlmVqZIWupnLZ2USHvqwZHw==
|
||||
dependencies:
|
||||
abort-controller "^3.0.0"
|
||||
node-fetch "^2.3.0"
|
||||
|
||||
ky@^0.11.2:
|
||||
version "0.11.2"
|
||||
resolved "https://registry.yarnpkg.com/ky/-/ky-0.11.2.tgz#4ffe6621d9d9ab61bf0f5500542e3a96d1ba0815"
|
||||
integrity sha512-5Aou5BWue5/mkPqIRqzSWW+0Hkl403pr/2AIrCKYw7cVl/Xoe8Xe4KLBO0PRjbz7GnRe1/8wW1KhqQNFFE7/GQ==
|
||||
|
||||
libp2p-crypto-secp256k1@~0.3.0:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/libp2p-crypto-secp256k1/-/libp2p-crypto-secp256k1-0.3.1.tgz#4cbeb857f5cfe5fefb1253e6b2994420c0ca166e"
|
||||
|
@ -1909,6 +1965,16 @@ peer-id@~0.12.2:
|
|||
libp2p-crypto "~0.16.1"
|
||||
multihashes "~0.4.15"
|
||||
|
||||
peer-id@~0.12.3:
|
||||
version "0.12.5"
|
||||
resolved "https://registry.yarnpkg.com/peer-id/-/peer-id-0.12.5.tgz#b22a1edc5b4aaaa2bb830b265ba69429823e5179"
|
||||
integrity sha512-3xVWrtIvNm9/OPzaQBgXDrfWNx63AftgFQkvqO6YSZy7sP3Fuadwwbn54F/VO9AnpyW/26i0WRQz9FScivXrmw==
|
||||
dependencies:
|
||||
async "^2.6.3"
|
||||
class-is "^1.1.0"
|
||||
libp2p-crypto "~0.16.1"
|
||||
multihashes "~0.4.15"
|
||||
|
||||
peer-info@~0.15.1:
|
||||
version "0.15.1"
|
||||
resolved "https://registry.yarnpkg.com/peer-info/-/peer-info-0.15.1.tgz#21254a7c516d0dd046b150120b9aaf1b9ad02146"
|
||||
|
@ -1978,6 +2044,11 @@ process-nextick-args@~2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
|
||||
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
|
||||
|
||||
promise-nodeify@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/promise-nodeify/-/promise-nodeify-3.0.1.tgz#f0f5d9720ee9ec71dd2bfa92667be504c10229c2"
|
||||
integrity sha512-ghsSuzZXJX8iO7WVec2z7GI+Xk/EyiD+JZK7AZKhUqYfpLa/Zs4ylUD+CwwnKlG6G3HnkUPMAi6PO7zeqGKssg==
|
||||
|
||||
promise@~1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/promise/-/promise-1.3.0.tgz#e5cc9a4c8278e4664ffedc01c7da84842b040175"
|
||||
|
@ -2361,7 +2432,7 @@ string-width@^1.0.1:
|
|||
is-fullwidth-code-point "^2.0.0"
|
||||
strip-ansi "^4.0.0"
|
||||
|
||||
string_decoder@^1.1.1:
|
||||
string_decoder@^1.1.1, string_decoder@^1.2.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
|
||||
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
|
||||
|
|
Loading…
Reference in New Issue