contract MinimalProxy is Initializable, Proxy, ERC1967Upgrade {
    bytes32 internal constant DAVA_CONTRACT_SLOT =
        bytes32(uint256(keccak256("dava.contract")) - 1);
    bytes32 internal constant PROPS_SLOT =
        bytes32(uint256(keccak256("dava.props.v1")) - 1);

    function initialize(uint256 davaId_) public virtual initializer {
        _upgradeBeaconToAndCall(msg.sender, "", false);
        StorageSlot.getAddressSlot(DAVA_CONTRACT_SLOT).value = msg.sender;
        _props().davaId = davaId_;
    }

    function _props() internal pure virtual returns (Props storage r) {
        bytes32 slot = PROPS_SLOT;
        assembly {
            r.slot := slot
        }
    }

    // See openzeppelin's BeaconProxy.sol

    function _beacon() internal view virtual returns (address) {
        return _getBeacon();
    }

    function _implementation()
        internal
        view
        virtual
        override
        returns (address)
    {
        return IBeacon(_getBeacon()).implementation();
    }

    function _setBeacon(address beacon, bytes memory data) internal virtual {
        _upgradeBeaconToAndCall(beacon, data, false);
    }
}
function _beacon() internal view virtual returns (address) {
    return _getBeacon();
}

// See openzeppelin's BeaconProxy.sol