Repository navigation
Expand file tree
/
Copy pathcodeSaftyUnsupport.sol
More file actions
56 lines (41 loc) · 1.55 KB
/
Copy pathcodeSaftyUnsupport.sol
File metadata and controls
56 lines (41 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//pragma solidity ^0.4.24;
contract SubC {
event log(string);
function () payable external{}
function receiveToken() payable public{}
function getBalance() view public returns (uint256 r) {
r = address(this).balance;
}
}
contract UseDot {
constructor() payable public{}
function() payable external{}
mapping(address => mapping(trcToken => uint256)) sender_tokens;
function trigger1(address payable addr, trcToken tokenInputId) payable public {
//address(SubC(addr)).call.value(1000).tokenId(tokenInputId)(abi.encodeWithSignature("receiveToken()")); // ERROR
}
function trigger2(address payable addr) payable public {
// addr.transferToken.value(10)(10, 0x6e6d62); // ERROR
}
function trigger3(address payable addr) payable public {
// address(SubC(addr)).receiveToken.tokenvalue(10)(); // ERROR
}
function trigger4(address payable addr) payable public {
//SubC(addr).receiveToken.tokenId(0x6e6d62)(); // ERROR
}
function trigger5(address payable addr) payable public {
SubC(addr).receiveToken.value(10)();
}
function trigger6(address payable addr, trcToken tokenId) payable public {
address(SubC(addr)).call.value(1000)(abi.encodeWithSignature("transferToken(uint256, trcToken)", 10, tokenId));
}
function trigger7(address addr) payable public {
//sender_tokens[msg.sender][msg.tokenid] += msg.tokenvalue; // compile success, no necessary to trigger
}
function trigger8(address addr) public payable returns(bytes memory r){
// r = msg.data; // compile success, no necessary to trigger
}
function getBalance() public returns (uint256 r){
r = address(this).balance;
}
}