相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
学习solidity语言
pragma solidity ^0.4.10;
contract success{
address owner;
/* function Counter() view {
owner==msg.sender;
} */
struct target{
string name;
string age;
// int preindex;
}
/*struct tar{
address[] addr;
mapping(address=>target) preindex;
}*/
uint [] arr;
uint id;
mapping(uint => target) public map;
// mapping(uint=>uint) public indexMap;
target[] targets;
mapping(address=>target[]) public resMap;
// uint a=2;
uint index;
function tarInsert(uint a,string b,string c,address addr) public returns(uint) {
id=a;
map[id]=target({
name:b,
age:c
// preindex:(targets.length-2)
});
index = targets.push(map[id]);
resMap[addr]=targets;
return index;
}
function getTarget() public view returns(uint){
return id;
}
//销毁合约
function kill() public {
if (owner == msg.sender) {
selfdestruct(owner);
}
}
}