Skip to content

Commit

Permalink
Add documentation proxy factory
Browse files Browse the repository at this point in the history
  • Loading branch information
rya-sge committed Jan 29, 2024
1 parent c932d12 commit 5741a09
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ Please see the OpenZeppelin [Upgrades plugins](https://docs.openzeppelin.com/upg
Note that deployment via a proxy is not mandatory, but is recommended by CMTA.



#### Factory

Factory contracts are available to deploy the CMTAT with a beacon proxy or a transparent proxy.

[CMTAT_BEACON_FACTORY.sol](./contracts/deployment/CMTAT_BEACON_FACTORY.sol)

[CMTAT_TRANSPARENT_FACTORY.sol](./contracts/deployment/CMTAT_TRANSPARENT_FACTORY.sol)

Beacon Proxy factory: the factory will use the same beacon for each beacon proxy. This beacon provides the address of the implementation contract, a CMTAT_PROXY contract. If you upgrade the beacon to point to a new implementation, it will change the implementation contract for all beacon proxy.

![factory-Beacon Factory.drawio](./doc/schema/drawio/factory-Beacon Factory.drawio.png)

Transparent Proxy factory: the factory will use the same implementation for each transparent proxy deployed. Each transparent proxy has its owned proxy admin, deployed inside the constructor of the transparent proxy. Each transparent proxy can upgrade their implementation to a new one independently and without impact on other proxies.

![factory-Transparent Factory.drawio](./doc/schema/drawio/factory-Transparent Factory.drawio.png)


### Gasless support

The CMTAT supports client-side gasless transactions using the [Gas Station Network](https://docs.opengsn.org/#the-problem) (GSN) pattern, the main open standard for transfering fee payment to another account than that of the transaction issuer. The contract uses the OpenZeppelin contract `ERC2771ContextUpgradeable`, which allows a contract to get the original client with `_msgSender()` instead of the fee payer given by `msg.sender` while allowing upgrades on the main contract (see *Deployment via a proxy* above).
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/schema/drawio/factory.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="Electron" modified="2024-01-29T11:55:27.700Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/20.6.2 Chrome/106.0.5249.199 Electron/21.3.3 Safari/537.36" version="20.6.2" etag="e540iUwCtu-bix8W_5Ph" type="device" pages="2"><diagram id="Ai9FFLWbK6-V3Bo36h2L" name="Beacon Factory">3Zldd5owGMc/DZft4b166Uvdes46Xdt17W56IkTgDAgLsWo//RIIb4nW6lTcriT/hJA8/1+eBFSMQbT8hEHi3yIXhoquukvFGCq6rhmWTn+YssqVrq3lgocDlzeqhPvgDXJR5eo8cGHaaEgQCkmQNEUHxTF0SEMDGKNFs9kMhc2nJsCDknDvgFBWfwQu8XNVNwy7qvgMA88vHm1bZl4TgaI1n0rqAxctapJxrRgDjBDJr6LlAIYsekVg8vtGG2rLkWEYk4/c8G1693bz8z4aXoTjkTty58B+vOC9vIJwzmc8Ag5BeKXodki77U8xGzpZ8YDYv+dsvP0ZislFmtnVow00M6GW96t6euWx38HtQ+/hpX/dG4y/vox6g4fx3TMPR9mnjtE8diEbpkZvWfgBgfcJcFjtgmJFNZ9EIa9mT+acaGb2pGwCEBO43BgZrYw3JRWiCBI2Q5XfYHCHOKOlY4ua4wWQfs1sm2uAQ+aVPVc20AvuxA6u6JIrfQgo4lSbYLRcnV8EO9tDqOmnDKHxr4fQsNoOobkxhGcWOstqhk7T2g6dJYXuJkpCGNEJARJkFD5qB02xk7vxk5xZt3gB0iTfNGfBkvl3DHOuhOyqddaYY6wxpxQP7o4tuTOESYjknABjt8cOEbTkhCBNA6cZvwp8lZbgMiBPvIZdPzP90uKl4bLWbLjihfUBh650KhHCTYeJ5tiB27d2ArAHybbNRravZo+1xp1CwzCkRL82h7vOMf6ECQroRKqspwkbR0cwPZ8mv6t+uhE7soWORHryOEgdZQCV096fqavTMaW9SxTlBK+e6oUah6xY3ZaVzohEo1USVWH/1fclUdi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f73P93JKlUVZrNlrJwnaDE0/LtIq5xTDpgrlkd7rimM0J37V26u6rucfa4p2NxkgoiP7dHO42j8kvjGmwXkk2oaumkq7i9GKa8q16xlY7UjCDKj2FHbSO1gCV0z6cKed4TIFniRKcsNWsXqhxmBer19alEyIRtUqi0QQIwUNJtBQSneOS2NNI/FcGT48ouCdRVptE2Y593m3mPutApmxTYap3XKaAfvbRNzQ6Zye4/TBR69sPYL56hB6w8zjBqEbvIaotdcdig3MDmWYXOlbXhoZzWIQ7qN2sAfQjy7dkzrBHnmMzprEQBx5O/fL8V6M018eYc8LitQINJNSUM/qzvCKC/zvN4IkF7Eg4O03uLJW7vVMUVDpS909vDbB+qpO3FUbfi4JYw7jtWwtTiXiwWVhau7UA+iHGZQTzZ5eAF20gq3gsDzKnvYEsqGrtTKJeEBoHBqfGmroRfevg7L634FSyPGr9ShHo57qPGpx7Z85um8FpKgnPPPRwZyop2FSj/ODgFMXqP7OiefXXI7r4Cw==</diagram></mxfile>

0 comments on commit 5741a09

Please sign in to comment.