/**
* MetaToken Example
*/
// TODO xxx
// Test DApp
dapp MetaToken {
chain {
chain_id = 337
// Endpoint of the civilian
endpoint = "https://civilian.cpchain.io"
}
contract MetaToken {
address = "0x111"
// Transfer event
event Transfer {
from address
to address
value u256
a varchar(255)
}
when Transfer {
// ...
execute {
self.block.number
self.tx.from
self.event.to
}
}
}
// Account model,真实存储中,表名和字段名在前面加统一的下划线已
model Account {
account address pk
value u256
name varchar(255)
}
model Transaction {
from address
to address
value u256
}
when block {
}
}