Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

refactor: combine ERC-20 and ERC-721 voting token implementations and turn adapter into minimal proxy #65

Merged
merged 24 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ repository.

## Modules

- **Token Voting:** smart contract policies that allow `ERC20Votes` or `ERC721Votes` tokenholders to create actions enforced by delegated token thresholds or collectively approve or disapprove an action through token voting.
Llama modules are extensions to Llama instances that can be adopted by using a Llama action to configure and deploy.

- **Token Voting:** smart contract policies that allow voting token holders to create actions enforced by delegated token thresholds or collectively approve or disapprove an action through token voting.

## Prerequisites

Expand Down
43 changes: 14 additions & 29 deletions script/DeployLlamaTokenVotingFactory.s.sol
AustinGreen marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ pragma solidity 0.8.23;
import {Script} from "forge-std/Script.sol";

import {DeployUtils} from "script/DeployUtils.sol";
import {LlamaERC20TokenActionCreator} from "src/token-voting/LlamaERC20TokenActionCreator.sol";
import {LlamaERC20TokenCaster} from "src/token-voting/LlamaERC20TokenCaster.sol";
import {LlamaERC721TokenActionCreator} from "src/token-voting/LlamaERC721TokenActionCreator.sol";
import {LlamaERC721TokenCaster} from "src/token-voting/LlamaERC721TokenCaster.sol";
import {LlamaTokenActionCreator} from "src/token-voting/LlamaTokenActionCreator.sol";
import {LlamaTokenCaster} from "src/token-voting/LlamaTokenCaster.sol";
import {LlamaTokenVotingFactory} from "src/token-voting/LlamaTokenVotingFactory.sol";
import {LlamaTokenAdapterVotesTimestamp} from "src/token-voting/token-adapters/LlamaTokenAdapterVotesTimestamp.sol";

contract DeployLlamaTokenVotingFactory is Script {
// Logic contracts.
LlamaERC20TokenActionCreator llamaERC20TokenActionCreatorLogic;
LlamaERC20TokenCaster llamaERC20TokenCasterLogic;
LlamaERC721TokenActionCreator llamaERC721TokenActionCreatorLogic;
LlamaERC721TokenCaster llamaERC721TokenCasterLogic;
LlamaTokenActionCreator llamaTokenActionCreatorLogic;
LlamaTokenCaster llamaTokenCasterLogic;
LlamaTokenAdapterVotesTimestamp llamaTokenAdapterTimestampLogic;

// Factory contracts.
LlamaTokenVotingFactory tokenVotingFactory;
Expand All @@ -26,36 +24,23 @@ contract DeployLlamaTokenVotingFactory is Script {
);

vm.broadcast();
llamaERC20TokenActionCreatorLogic = new LlamaERC20TokenActionCreator();
llamaTokenActionCreatorLogic = new LlamaTokenActionCreator();
DeployUtils.print(
string.concat(" LlamaERC20TokenActionCreatorLogic: ", vm.toString(address(llamaERC20TokenActionCreatorLogic)))
string.concat(" LlamaTokenActionCreatorLogic: ", vm.toString(address(llamaTokenActionCreatorLogic)))
);

vm.broadcast();
llamaERC20TokenCasterLogic = new LlamaERC20TokenCaster();
DeployUtils.print(string.concat(" LlamaERC20TokenCasterLogic: ", vm.toString(address(llamaERC20TokenCasterLogic))));
llamaTokenCasterLogic = new LlamaTokenCaster();
DeployUtils.print(string.concat(" LlamaTokenCasterLogic: ", vm.toString(address(llamaTokenCasterLogic))));

vm.broadcast();
llamaERC721TokenActionCreatorLogic = new LlamaERC721TokenActionCreator();
DeployUtils.print(
string.concat(" LlamaERC721TokenActionCreatorLogic: ", vm.toString(address(llamaERC721TokenActionCreatorLogic)))
);
tokenVotingFactory = new LlamaTokenVotingFactory(llamaTokenActionCreatorLogic, llamaTokenCasterLogic);
DeployUtils.print(string.concat(" LlamaTokenVotingFactory: ", vm.toString(address(tokenVotingFactory))));

vm.broadcast();
llamaERC721TokenCasterLogic = new LlamaERC721TokenCaster();
llamaTokenAdapterTimestampLogic = new LlamaTokenAdapterVotesTimestamp();
DeployUtils.print(
string.concat(" LlamaERC721TokenCasterLogic: ", vm.toString(address(llamaERC721TokenCasterLogic)))
);

vm.broadcast();
tokenVotingFactory = new LlamaTokenVotingFactory(
llamaERC20TokenActionCreatorLogic,
llamaERC20TokenCasterLogic,
llamaERC721TokenActionCreatorLogic,
llamaERC721TokenCasterLogic
string.concat(" LlamaTokenAdapterVotesTimestamp: ", vm.toString(address(llamaTokenAdapterTimestampLogic)))
);
DeployUtils.print(string.concat(" LlamaTokenVotingFactory: ", vm.toString(address(tokenVotingFactory))));

// Deploy the timestamp managers here when we develop them.
}
}
24 changes: 0 additions & 24 deletions src/token-voting/ILlamaTokenClockAdapter.sol

This file was deleted.

61 changes: 0 additions & 61 deletions src/token-voting/LlamaERC20TokenActionCreator.sol

This file was deleted.

60 changes: 0 additions & 60 deletions src/token-voting/LlamaERC20TokenCaster.sol

This file was deleted.

63 changes: 0 additions & 63 deletions src/token-voting/LlamaERC721TokenActionCreator.sol

This file was deleted.

62 changes: 0 additions & 62 deletions src/token-voting/LlamaERC721TokenCaster.sol

This file was deleted.

Loading
Loading