# InverterBeaconProxy\_v1.sol

[Git Source](https://github.com/InverterNetwork/inverter-contracts/blob/2a8a4c80ff4f24a59546d4e6126b81bc51228c94/src/proxies/InverterBeaconProxy_v1.sol)

**Inherits:** [Proxy](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/19a657bef8354f2a655900654955739b70dfbde9/contracts/proxy/Proxy.sol)

**Author:** Inverter Network

Acts as a proxy for Inverter Network's smart contracts, allowing for upgrades to contract implementations without affecting the existing state or contract addresses, thereby achieving upgradeable contracts.

*Implements the Proxy pattern by referencing the* [*{InverterBeacon\_v1}*](https://docs.inverter.network/contracts/technical-reference/proxies/inverterbeacon_v1.sol)*, which holds the address of the current implementation to which calls are delegated.*

### State Variables

#### \_beacon

[{InverterBeacon\_v1}](https://docs.inverter.network/contracts/technical-reference/proxies/inverterbeacon_v1.sol) instance that points to the implementation.

```solidity
IInverterBeacon_v1 private immutable _beacon;
```

### Functions

#### constructor

Constructs the InverterBeaconProxy\_v1.

*Sets the* [*{InverterBeacon\_v1}*](https://docs.inverter.network/contracts/technical-reference/proxies/inverterbeacon_v1.sol) *instance that contains the implementation address.*

```solidity
constructor(IInverterBeacon_v1 beacon);
```

**Parameters**

| Name     | Type                 | Description                                                                                                                     |
| -------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `beacon` | `IInverterBeacon_v1` | The [{InverterBeacon\_v1}](https://docs.inverter.network/contracts/technical-reference/proxies/inverterbeacon_v1.sol) instance. |

#### version

Returns the version of the linked implementation.

*This overrides the possible use of a "version" function in the modules that are called via the Proxy Beacon structure.*

```solidity
function version() external view returns (uint, uint, uint);
```

**Returns**

| Name     | Type      | Description    |
| -------- | --------- | -------------- |
| `<none>` | `uint256` | Major version. |
| `<none>` | `uint256` | Minor version. |
| `<none>` | `uint256` | Patch version. |

#### receive

*Fallback function to delegate calls to the implementation contract even if the call data is empty but msg.value > 0.*

```solidity
receive() external payable virtual;
```

#### \_implementation

*This is a virtual function that should be overridden so it returns the address to which the fallback function and {\_fallback} should delegate.*

```solidity
function _implementation() internal view override returns (address);
```

### Events

#### BeaconUpgraded

Proxy upgraded to new [{InverterBeacon\_v1}](https://docs.inverter.network/contracts/technical-reference/proxies/inverterbeacon_v1.sol) instance.

```solidity
event BeaconUpgraded(IInverterBeacon_v1 indexed beacon);
```

**Parameters**

| Name     | Type                 | Description                                                                                                                         |
| -------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `beacon` | `IInverterBeacon_v1` | The new [{InverterBeacon\_v1}](https://docs.inverter.network/contracts/technical-reference/proxies/inverterbeacon_v1.sol) instance. |
