Skip to content

Instantly share code, notes, and snippets.

@xunnun
Created November 28, 2018 08:05
Show Gist options
  • Save xunnun/ee8ce6b94fb18316dde868c11c313890 to your computer and use it in GitHub Desktop.
Save xunnun/ee8ce6b94fb18316dde868c11c313890 to your computer and use it in GitHub Desktop.
测试短地址攻击
pragma solidity ^0.4.10;
contract A {
address public owner;
event Log(bytes,address, uint256);
function A() payable { owner = msg.sender;}
function() public payable {}
function deposit() payable { }
function getData() public returns(address,uint256){
return (owner,this.balance);
}
function trans(address _to,uint256 _amount) public {
_to.transfer(_amount);
Log(msg.data,_to,_amount);
}
function delegatecallB(bytes _data) public {
this.delegatecall(_data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment