Skip to content

Commit

Permalink
refactor: ProxyFactory and TestGovernanceERC20
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Oct 23, 2023
1 parent 3932311 commit d52643d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,17 @@ import {IDAO} from "@aragon/osx/packages/contracts/src/core/dao/IDAO.sol";

import {GovernanceERC20} from "../../token/erc20/GovernanceERC20.sol";

/// @title GovernanceERC20Mock
/// @title TestGovernanceERC20
/// @author Aragon Association - 2022-2023
/// @notice A test GovernanceERC20 that can be minted and burned by everyone.
/// @dev DO NOT USE IN PRODUCTION!
contract GovernanceERC20Mock is GovernanceERC20 {
contract TestGovernanceERC20 is GovernanceERC20 {
constructor(
IDAO _dao,
string memory _name,
string memory _symbol,
MintSettings memory _mintSettings
)
GovernanceERC20(
_dao,
_name,
_symbol,
_mintSettings //MintSettings({amounts: new uint256[](0), receivers: new address[](0)})
)
{}
) GovernanceERC20(_dao, _name, _symbol, _mintSettings) {}

// sets the balance of the address
// this mints/burns the amount depending on the current balance
Expand Down
8 changes: 4 additions & 4 deletions contracts/src/utils/proxy/ProxyFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {ProxyLib} from "./ProxyLib.sol";
contract ProxyFactory {
using ProxyLib for address;
/// @notice The immutable logic contract address.
address private immutable _LOGIC;
address public immutable LOGIC;

/// @notice Emitted when an proxy contract is created.
/// @param proxy The proxy address.
Expand All @@ -20,15 +20,15 @@ contract ProxyFactory {
/// @notice Initializes the contract with a logic contract address.
/// @param _logic The logic contract address.
constructor(address _logic) {
_LOGIC = _logic;
LOGIC = _logic;
}

/// @notice Creates an [ERC-1967](https://eips.ethereum.org/EIPS/eip-1967) proxy contract pointing to the pre-set logic contract.
/// @param _data The initialization data for this contract.
/// @return proxy The address of the proxy contract created.
/// @dev If `_data` is non-empty, it is used in a delegate call to the `_logic` contract. This will typically be an encoded function call initializing the proxy (see [OpenZeppelin ERC1967Proxy-constructor](https://docs.openzeppelin.com/contracts/4.x/api/proxy#ERC1967Proxy-constructor-address-bytes-)).
function deployUUPSProxy(bytes memory _data) external returns (address proxy) {
proxy = _LOGIC.deployUUPSProxy(_data);
proxy = LOGIC.deployUUPSProxy(_data);
emit ProxyCreated({proxy: proxy});
}

Expand All @@ -37,7 +37,7 @@ contract ProxyFactory {
/// @return proxy The address of the proxy contract created.
/// @dev If `_data` is non-empty, it is used in a call to the clone contract. This will typically be an encoded function call initializing the storage of the contract.
function deployMinimalProxy(bytes memory _data) external returns (address proxy) {
proxy = _LOGIC.deployMinimalProxy(_data);
proxy = LOGIC.deployMinimalProxy(_data);
emit ProxyCreated({proxy: proxy});
}
}

0 comments on commit d52643d

Please sign in to comment.