3

The 'exploit' no longer applies to solc v0.6, since then the compiler generates an error when there's an ambiguous call. As the author says solc v0.5 uses C3 linearization to determine the order in which functions will be called. In the cited example the C3 linearization order is [Bank, MultiAdmin, TempAdmin, Admin]. When funct() is called the first ...


2

First thing is when you say a user can not have more than n tokens, that should essentially mean an address can not hold more than n tokens in smart contract world. So talking about the solutions. For simplicity let max no of tokens a user can hold is 10. Solution 1: This is very much dependent on taking steps after the requirement is violated. SO say a ...


1

Answer There are two new rules to be aware of: All interface functions are implicitly virtual. If you want to be explicit about it, the compiler throws a warning. All functions inheriting from the interface must set the override modifier on every function that overrides an interface function, lest the compiler throws an error. Example Try to see what ...


1

However is it okay to define a public function in its interface as external? No, you cannot do that in an interface. As per the Solidity documentation: Interfaces are similar to abstract contracts, but they cannot have any functions implemented. There are further restrictions: ... All declared functions must be external. ... But what you ...


1

It is possible for a contract to deploy a copy of itself using inline assembly: function _autoDeploy () internal returns (address copy) { bytes memory initCode = hex'58333b90818180333cf3'; assembly { let encoded_data := add(0x20, initCode) let encoded_size := mload(initCode) copy := create(0, encoded_data, encoded_size) }...


Only top voted, non community-wiki answers of a minimum length are eligible