New answers tagged

0

There is a short answer and an obscure answer. Short answer You can't. Events are not accessible internally, so use state variables for logic and emit events to inform external clients about changes. Obscure answer Access may be possible with assembly. I came across this pattern some time ago, and since events are much cheaper than state storage, it ...


1

We solved this by having a one time init function. For full source, see ThingFactory.sol and Thing.sol. Basically, what you do is have this one time init function on your target contract (in the example, it would be Thing.) Then your factory contract calls the init function directly after creating the clone. The ...


1

You need to abi-encode the input arguments, and then append the result at the end of the bytecode before passing it to the create function. Suppose you have input arguments arg1, arg2 and arg3. I believe that you can more or less achieve that by changing this: bytes memory bytecode = _bytecode; To this: bytes memory bytecode = abi.encode(_bytecode, arg1,...


Top 50 recent answers are included