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

feat: multi hop claiming #74

Merged
merged 3 commits into from
Jun 20, 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
2 changes: 1 addition & 1 deletion contracts/Distributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";

import "./utils/UUPSHelper.sol";

Check warning on line 42 in contracts/Distributor.sol

View workflow job for this annotation

GitHub Actions / lint

global import of path ./utils/UUPSHelper.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)

struct MerkleTree {
// Root of a Merkle tree which leaves are `(address user, address token, uint amount)`
Expand Down Expand Up @@ -184,7 +184,7 @@
uint256 amount = amounts[i];

// Only approved operator can claim for `user`
if (msg.sender != user && operators[user][msg.sender] == 0) revert NotWhitelisted();
if (msg.sender != user && tx.origin != user && operators[user][msg.sender] == 0) revert NotWhitelisted();

Check warning on line 187 in contracts/Distributor.sol

View workflow job for this annotation

GitHub Actions / lint

Avoid to use tx.origin

// Verifying proof
bytes32 leaf = keccak256(abi.encode(user, token, amount));
Expand Down
2 changes: 1 addition & 1 deletion contracts/tokenWrappers/RadiantTokenWrapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

interface IVesting {
function rdntToken() external view returns (address);
function vestTokens(address, uint256, bool) external;

Check failure on line 13 in contracts/tokenWrappers/RadiantTokenWrapper.sol

View workflow job for this annotation

GitHub Actions / lint

Insert ⏎
}

/// @title Radiant MTW
Expand All @@ -24,7 +24,7 @@

// ================================= CONSTANTS =================================

IVesting public constant VESTING = IVesting(0x76ba3eC5f5adBf1C58c91e86502232317EeA72dE);
IVesting public constant VESTING = IVesting(0x28E395a54a64284DBA39652921Cd99924f4e3797);
address internal immutable _UNDERLYING = VESTING.rdntToken();

// ================================= FUNCTIONS =================================
Expand Down
4 changes: 2 additions & 2 deletions deploy/0_distributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ const func: DeployFunction = async ({ deployments, ethers, network }) => {
console.log('Now deploying Distributor');
console.log('Starting with the implementation');

await deploy('Distributor_Implementation_V2_1', {
await deploy('Distributor_Implementation_V2_2', {
contract: 'Distributor',
from: deployer.address,
log: !argv.ci,
});

const implementationAddress = (await ethers.getContract('Distributor_Implementation_V2_1')).address;
const implementationAddress = (await ethers.getContract('Distributor_Implementation_V2_2')).address;

console.log(`Successfully deployed the implementation for Distributor at ${implementationAddress}`);
console.log('');
Expand Down
File renamed without changes.
Loading
Loading