Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TokenDistro to the latest version #43

Merged
merged 3 commits into from
Mar 3, 2024
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
22 changes: 5 additions & 17 deletions .github/workflows/slither.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,26 @@ on:
branches:
- main
pull_request:

env:
FOUNDRY_PROFILE: ci

jobs:
analyze:
name: Slither check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install deps
run: |
forge --version
forge install

- name: Run Slither
uses: crytic/slither-action@main
uses: crytic/slither-action@v0.3.1
id: slither
continue-on-error: true
with:
sarif: results.sarif
target: 'contracts/'
target: "./"
fail-on: none

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.slither.outputs.sarif }}
10 changes: 10 additions & 0 deletions contracts/TokenDistro.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ contract TokenDistro is Initializable, IDistro, AccessControlEnumerableUpgradeab
*/
event GivBackPaid(address distributor);

/**
* @dev Emitted when the DISTRIBUTOR allocate an amount of praise rewards to a recipient
*/
event PraiseRewardPaid(address distributor);

/**
* @dev Emitted when the duration is changed
*/
Expand Down Expand Up @@ -207,6 +212,11 @@ contract TokenDistro is Initializable, IDistro, AccessControlEnumerableUpgradeab
emit GivBackPaid(msg.sender);
}

function sendPraiseRewards(address[] memory recipients, uint256[] memory amounts) external override {
_allocateMany(recipients, amounts);
emit PraiseRewardPaid(msg.sender);
}

/**
* Function that allows a recipient to change its address
* @dev The change can only be made to an address that has not previously received an allocation &
Expand Down
2 changes: 2 additions & 0 deletions contracts/interfaces/IDistro.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ interface IDistro {

function sendGIVbacks(address[] memory recipients, uint256[] memory amounts) external;

function sendPraiseRewards(address[] memory recipients, uint256[] memory amounts) external;

/**
* Function that allows a recipient to change its address
* @dev The change can only be made to an address that has not previously received an allocation &
Expand Down
2 changes: 1 addition & 1 deletion contracts/tokens/UniswapV3RewardToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.10;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '../Interfaces/IDistro.sol';
import '../interfaces/IDistro.sol';

contract UniswapV3RewardToken is IERC20, OwnableUpgradeable {
uint256 public initialBalance;
Expand Down
2 changes: 2 additions & 0 deletions test/interfaces/IDistro.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ interface IDistro {

function sendGIVbacks(address[] memory recipients, uint256[] memory amounts) external;

function sendPraiseRewards(address[] memory recipients, uint256[] memory amounts) external;

/**
* Function that allows a recipient to change its address
* @dev The change can only be made to an address that has not previously received an allocation &
Expand Down
Loading