3

You can use ERC930 Eterenal Storage pattern in contract design, through which you can be use to write up-gradable contract by separating your contract's storage and business logic. I can came something what are you expecting to do (correct me if i'm wrong) in RocketPool's smart contract .


2

You could store them in variables. Doing so would provide no assurance of fidelity with the actual contract as would rely on the deployment ceremony doing it honestly. Another issue is you would have to convert the ABI to Hex or find another way to escape the quotes. pragma solidity 0.5.16; contract SimpleIntrospection { bytes public BYTECODE; ...


2

You can avoid the modifier and the hashing. It is simpler to do: function set(uint _index, string calldata _data_to_store) external { require(bytes(storedData[_index]).length == 0); storedData[_index] = _data_to_store; } Checking the length of the bytes was inspired by this answer.


1

At the moment the current version of remix is not suited for 0.6.x solc. It is reccomended to use alpha version in the meanwhile. Developers are fixing those problems, due to a different ABI format in 0.6.x A new version is due in a short time. It was scheduled for 15 Jan, but some other issues are emerged and they are fixing that as well. If you go on ...


1

I had same issue, if you try the remix alpha http://remix-alpha.ethereum.org/ you should see it generated correctly. I do not know when this fix will make it into live.


1

Yes. You can implement a simple logic in your contract for that: For example: mapping(address => bool) public hacker; function doSomething() public { require(!hacker[ADDRESS_TO_CHECK]); //continue }


1

Once your contract is deployed, you can use assembly code within solidity to access your byte code as seen in this example below. The benefit of this vs just saving a parameter is that you are confident this is actually the byte code of the contract. One downside is that trying to use this in the constructor I do not believe will work. assembly link ...


1

Unfortunately, you cannot store the deploying contract's bytecode as a variable in the contract directly, as that creates a circular reference. From the docs: This property can not be accessed in the contract itself or any derived contract. It causes the bytecode to be included in the bytecode of the call site and thus circular references like that are ...


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