What is the bare minimum implementation for UUPS Smart Contract using upgradable-plugin

I want to Create a Simple Counter Increment/decrement Smart Contract. Just to understand how we can implement UUPS in any project.


// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

abstract contract Counter is UUPSUpgradeable{
    uint public counter;
    address public implmentation;
    address public owner;
    function initialize(uint intialValue) public {
        counter = intialValue;
        owner = msg.sender;

    function incrementByOne() public {

    function upgradeTo(address newImplementation) external virtual override {

    function _authorizeUpgrade(address newImplementation) internal virtual override{
        require(msg.sender==owner,"Unauthorised Upgrade");


I have tried already to resolve errors but yet not find a proper doc/instructions to follow.

Error:  *** Deployment Failed ***

"Counter" is an abstract contract or an interface and cannot be deployed.
   * Import abstractions into the '.sol' file that uses them instead of deploying them separately.
   * Contracts that inherit an abstraction must implement all its method signatures exactly.
   * A contract that only implements part of an inherited abstraction is also considered abstract.

    at Deployer._preFlightCheck (/home/rishabh/.nvm/versions/node/v14.0.0/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:179:1)

If anyone has implemented this UUPS proxy pattern, Please share the code or help me anyway possible. Thanks in advance.

Remove the abstract keyword from the contract definition. This problem doesn’t seem related to UUPS.

This works. Once I refer the docs for this. It’s simple that abstract contracts don’t generate bytecode for EVM to run.