Skip to main content
Bounty Awarded with 50 reputation awarded by Juan Ignacio Pérez Sacristán
Add an example how to split a contract
Source Link
Ismael
  • 29.8k
  • 23
  • 55
  • 97

Unless the miners increase the block gas limit your only option is to split the contract into several contracts.

So each contract has its own address, and you can make calls between them. For example an ICO Crowdsale can be split into:

  • Crowdsale: Manage the crowdsale, how tokens are allocated, rewards, opening, closing
  • Token: Implements ERC20, can create tokens, approve transfer
  • Wallet: Manage funds received during the crowdsale

Also splitting helps a security audit since each contract has a limited scope.

Each contract can be deployed indepedently, and through a configuration method you complete the setup.

Unless the miners increase the block gas limit your only option is to split the contract into several contracts.

Unless the miners increase the block gas limit your only option is to split the contract into several contracts.

So each contract has its own address, and you can make calls between them. For example an ICO Crowdsale can be split into:

  • Crowdsale: Manage the crowdsale, how tokens are allocated, rewards, opening, closing
  • Token: Implements ERC20, can create tokens, approve transfer
  • Wallet: Manage funds received during the crowdsale

Also splitting helps a security audit since each contract has a limited scope.

Each contract can be deployed indepedently, and through a configuration method you complete the setup.

Source Link
Ismael
  • 29.8k
  • 23
  • 55
  • 97

Unless the miners increase the block gas limit your only option is to split the contract into several contracts.