Smart contract

Each company has its own proxy contract. The Loop factory is the one responsible for deploying these proxies.

The implementation of this makes use of the Beacon Proxy. For every contract, a new beacon is deployed in the factory with the implementation contract (template) address as a parameter. Then when a new proxy for a type is needed, the factory deploys the proxy and tells it to look at the configured beacon for its implementation contract. The factory keeps track of all proxies it has deployed and will be the “source of truth” when searching for Loop contracts.

The implementation address that is stored in the beacon can be “upgraded” to point to another address in the case of an upgrade to fix a bug or add functionality. All deployed proxies will automatically use this new address, so there is no need to upgrade individual contracts.

It is important that the address of the proxy that gets deployed is never changed. The allowances on the token are given to a specific contract, and if the contract changes its address, the allowance will need to be redone. Using the beacon proxy pattern allows us to upgrade the implementation contracts without changing the original proxy's address and therefore preserving the allowance that has already been set against that proxy.

Last updated