Static Analysis: Warn on selfdestruct, suggestions by axic

pull/3094/head
soad003 7 years ago
parent e4aaf0bd3f
commit f3a4cd6736
  1. 5
      src/app/staticanalysis/modules/selfdestruct.js
  2. 3
      test/staticanalysis/test-contracts/selfdestruct.sol

@ -17,10 +17,9 @@ selfdestruct.prototype.visit = function (node) {
selfdestruct.prototype.report = function () {
return this.relevantNodes.map(function (item, i) {
return {
warning: yo`<span>Use of selfdestruct: can block calling contracts unexpectedly<br />
Please, be especially carefull if this contract is referenced by other contracts (i.e. library contracts, interactions). Selfdestruction of called contracts can render callers inoperable.</span>`,
warning: yo`<span>Use of selfdestruct: can block calling contracts unexpectedly. Be especially careful if this contract is planed to be used by other contracts (i.e. library contracts, interactions). Selfdestruction of the callee contract can leave callers in an inoperable state.</span>`,
location: item.src,
more: 'https://www.coindesk.com/ethereum-client-bug-freezes-user-funds-fallout-remains-uncertain/'
more: 'https://paritytech.io/blog/security-alert.html'
}
})
}

@ -1,9 +1,8 @@
contract sd {
uint120 x;
function() public payable { }
function c () public constant {
//x++;
selfdestruct(address(0xdeadbeef));
}

Loading…
Cancel
Save