mirror of https://github.com/crytic/slither
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
999 B
59 lines
999 B
4 years ago
|
// pragma solidity ^0.4.24;
|
||
6 years ago
|
|
||
6 years ago
|
contract Uninitialized{
|
||
6 years ago
|
|
||
|
address destination;
|
||
|
|
||
6 years ago
|
function transfer() payable public{
|
||
6 years ago
|
destination.transfer(msg.value);
|
||
|
}
|
||
|
|
||
|
}
|
||
6 years ago
|
|
||
|
|
||
|
contract Test {
|
||
|
mapping (address => uint) balances;
|
||
|
mapping (address => uint) balancesInitialized;
|
||
|
|
||
|
|
||
|
function init() {
|
||
|
balancesInitialized[msg.sender] = 0;
|
||
|
}
|
||
|
|
||
|
function use() {
|
||
|
// random operation to use the mapping
|
||
|
require(balances[msg.sender] == balancesInitialized[msg.sender]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
library Lib{
|
||
|
|
||
|
struct MyStruct{
|
||
|
uint val;
|
||
|
}
|
||
|
|
||
6 years ago
|
function set(MyStruct storage st, uint v){
|
||
6 years ago
|
st.val = 4;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
contract Test2 {
|
||
|
using Lib for Lib.MyStruct;
|
||
|
|
||
|
Lib.MyStruct st;
|
||
2 years ago
|
Lib.MyStruct stinitialized;
|
||
6 years ago
|
uint v; // v is used as parameter of the lib, but is never init
|
||
6 years ago
|
|
||
|
function init(){
|
||
2 years ago
|
stinitialized.set(v);
|
||
6 years ago
|
}
|
||
|
|
||
|
function use(){
|
||
|
// random operation to use the structure
|
||
2 years ago
|
require(st.val == stinitialized.val);
|
||
6 years ago
|
}
|
||
|
|
||
6 years ago
|
}
|