Sample application demonstring how to split big contracts and deploy in more than one transaction.
This contracts are experimental and intended to study. Review e test carefully before using them.
Factory directly returns new Contract()
. Overwrites msg.sender
! Can be used when sender's msg
variable is not used. Smallest footprint.
src/normal/MyAppTokenFactoryN.sol
src/AppExampleN.sol
Not working. Uses manual delegation by factory.delegatecall()
: uses a storage pointer to read arguments and to return value;
src/AppExampleD.sol
- gives error out of gas on delegation.
src/normal/MyAppTokenFactoryD.sol
Use library for delegate call to MyAppTokenFactoryN
. Overwrites msg.sender
! Can be used when sender's msg
variable is not used.
src/AppExampleNL.sol
- works but contracts not splitted.
src/AppExampleNLF.sol
- requires MyAppTokenFactoryN
address in constructor;
src/library/MyAppTokenLibraryNF.sol
using MyAppTokenLibraryNF for MyAppTokenFactoryNI;
Deploy first MyAppTokenFactoryX.sol:MyAppTokenFactoryX
and use the resulting address in the constructor of AppExampleX.sol:AppExampleX
Log-in into your live.ether.camp ide
Open file ethereum.json
and set the contracts to be deployed, Delegated or Normal.
Press Run All Contracts.