Skip to content

Commit

Permalink
unlock in multiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
todesstille committed Jun 25, 2024
1 parent e8a7ee6 commit 90c3b6d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions contracts/core/TokenAllocator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ contract TokenAllocator is ITokenAllocator, AbstractDependant, MultiOwnable, UUP
address token = allocation.token;
_allocations[allocator][token].remove(id);

uint256 balance = allocation.amountToAllocate;
uint256 balance = allocation.balance;
if (balance > 0) {
IERC20(token).safeTransfer(allocator, balance);
}
Expand All @@ -117,8 +117,8 @@ contract TokenAllocator is ITokenAllocator, AbstractDependant, MultiOwnable, UUP
address user = msg.sender;
require(allocationInfo.claimed.add(user), "TA: already claimed");

require(allocationInfo.amountToAllocate >= amount, "TA: insufficient funds");
allocationInfo.amountToAllocate -= amount;
require(allocationInfo.balance >= amount, "TA: insufficient funds");
allocationInfo.balance -= amount;

bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(user, amount))));
bytes32 merkleRoot = allocationInfo.merkleRoot;
Expand Down Expand Up @@ -176,7 +176,7 @@ contract TokenAllocator is ITokenAllocator, AbstractDependant, MultiOwnable, UUP
allocation.isClosed,
allocation.allocator,
allocation.token,
allocation.amountToAllocate,
allocation.balance,
allocation.merkleRoot,
allocation.descriptionURL
);
Expand Down Expand Up @@ -205,7 +205,7 @@ contract TokenAllocator is ITokenAllocator, AbstractDependant, MultiOwnable, UUP
AllocationData storage allocationInfo = _allocationInfos[id];

allocationInfo.token = token;
allocationInfo.amountToAllocate = amount;
allocationInfo.balance = amount;
allocationInfo.allocator = allocator;
allocationInfo.merkleRoot = merkleRoot;
allocationInfo.descriptionURL = descriptionURL;
Expand Down
2 changes: 2 additions & 0 deletions contracts/gov/ERC721/multipliers/AbstractERC721Multiplier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ abstract contract AbstractERC721Multiplier is

_onlyTokenOwner(tokenId);

IGovPool(owner()).unlock(msg.sender);

require(
IGovPool(owner()).getUserActiveProposalsCount(msg.sender) == 0,
"ERC721Multiplier: Cannot unlock with active proposals"
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/core/ITokenAllocator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface ITokenAllocator {
bool isClosed;
address allocator;
address token;
uint256 amountToAllocate;
uint256 balance;
bytes32 merkleRoot;
string descriptionURL;
EnumerableSet.AddressSet claimed;
Expand Down
2 changes: 2 additions & 0 deletions contracts/mock/gov/GovPoolMock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ contract GovPoolMock {
_votePowerContract = votePowerContract;
}

function unlock(address user) external {}

function getHelperContracts()
external
view
Expand Down

0 comments on commit 90c3b6d

Please sign in to comment.