Déployer et exécuter des contrats proxy
Remix IDE has the functionality to assist in the handling of proxy contracts that use the UUPS pattern.
A UUPS contract is an implementation contract that contains both the business logic and the upgrade mechanism. It is deployed alongside an ERC1967Proxy, which delegates all calls to it.
Déploiement
To try this out, you will need a UUPS contract. Create a new Workspace in Remix and click the Contract Wizard. In the Wizard’s Upgradeability section check UUPS and in the Access Control section, choose Ownable. Then compile it, and open Deploy & Run.
Note
UUPS contracts use an initialize function instead of a constructor. Call initialize via the proxy after deployment to set up initial state. The constructor is intentionally disabled with _disableInitializers().
When a UUPS contract is selected in Deploy & Run’s Contract dropdown, you’ll see some switches below the Deploy button:

Turn on the Deploy with Proxy switch. This will create two transactions: one for the implementation (your contract) and the other for the ERC1967 proxy contract. You will get two modals to check through:

et ensuite

Si vous effectuez un déploiement sur la Remix VM, ces fenêtres apparaîtront l’une après l’autre. Si vous êtes connecté au réseau principal ou à un réseau de test public, la deuxième fenêtre s’affichera une fois que la première transaction aura été effectuée.
Une fois le contrat proxy ERC1967 déployé, dans la section Contrats déployés, vous verrez deux instances déployées.

Pour interagir avec votre contrat de mise en œuvre, N’UTILISEZ PAS l’instance de votre contrat. Au lieu de cela, vous devez utiliser le proxy ERC1967. Le proxy disposera de toutes les fonctions de votre implémentation.
Mise à niveau
To upgrade, turn on the Upgrade with Proxy switch to reveal the address input:

Vous devrez soit utiliser le dernier contrat ERC1967 déployé, soit saisir l’adresse du contrat ERC1967 que vous souhaitez utiliser.
Upgrading deploys your new implementation contract as a separate transaction, then calls upgradeToAndCall on the proxy to point it at the new address. Like deploying, this produces two modals: one to confirm the new implementation deployment and one to confirm the upgrade call on the proxy.
Note
Your implementation contract must include an _authorizeUpgrade function. Without it, the upgrade transaction will revert. OpenZeppelin’s UUPS base contract requires you to override this function with access control (typically onlyOwner) to prevent unauthorized upgrades.