Skip to content

Proxy contracts

dju requested to merge proxyContracts into master

Feature Merge Request

Related Issue

closes #141 (closed)

Description of Feature

proxyfactories for Assessment & concepts

assessment (and concept) have been split up into different subclasses from which the proxies are inheriting. this image sums it up quite nice:

Screenshot_from_2018-07-17_16-30-24

(imagine Kombucha being Concept/Assessment)

Assessment.sol has an extra factoring out into Header and Data, which is to avoid replicating the event-definitions in the proxy.

Also, the data-contracts exist in two versions ContractData.sol & ContractDataInternal.sol. The former are used by the masterCopies, the latter used by the ProxyContracts (to avoid creating superfluous getters on those).

Introducing the proxyfactories required some slight adjustments to the constructors so as to properly save the concepts/assessments in the creating contract: introducing an extra argument as msg.sender would point to the proxyfactory (which would fill that argument with msg.sender).

Motivation and Context

  • gas savings can be tested by running node scripts/create2concepts2assessments.js --gas

this is replicated 1 to 1 from this blogpost which is an absolute stellar tutorial!

Questions:

Do we want to create separate folders for all those new contracts? Right now, there are all at one level. Some files hold multiple contracts. Options woudl be to introduce folders or to move some contracts into the same file.

What's Next?

  • let's remove those compiler warnings
  • the tutorial will also help if we decide we want upgradebale contracts!

Edited by Jared Pereira

Merge request reports