Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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: 2 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Full reference
# https://book.getfoundry.sh/reference/config.html
[default]
[profile.default]
solc_version = "0.8.13"
optimizer = true
optimizer_runs = 20000
gas_reports = ["*"]

[ci]
[profile.ci]
verbosity = 4
fuzz_runs = 65536
18 changes: 8 additions & 10 deletions src/shrines/SnapshotShrine.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.8.11;

import {MerkleProof} from "openzeppelin-contracts/utils/cryptography/MerkleProof.sol";

import {ERC20, SafeTransferLib} from "@omniprotocol/libraries/SafeTransferLib.sol";
import {ReentrancyGuard} from "@omniprotocol/mixins/ReentrancyGuard.sol";
import {Stewarded} from "@omniprotocol/mixins/Stewarded.sol";
Expand Down Expand Up @@ -46,23 +44,20 @@ contract SnapshotShrine is Stewarded, ReentrancyGuard {
/// Structs
/// -----------------------------------------------------------------------

/// @param snapshotId The Merkle treesnapshotId
/// @param snapshotId The snapshotId
/// @param token The ERC-20 token to be claimed
/// @param champion The Champion address. If the Champion rights
/// have been transferred, the tokens will be sent to its owner.
/// @param shares The share amount of the Champion
/// @param merkleProof The Merkle proof showing the Champion is part of this Shrine's Merkle tree

struct ClaimInfo {
uint256 snapshotId;
ERC20 token;
address champion;
}

/// @param metaShrine The shrine to claim from
/// @param snapshotId The Merkle treesnapshotId
/// @param snapshotId The snapshotId
/// @param token The ERC-20 token to be claimed
/// @param shares The share amount of the Champion
/// @param merkleProof The Merkle proof showing the Champion is part of this Shrine's Merkle tree
struct MetaShrineClaimInfo {
SnapshotShrine metaShrine;
uint256 snapshotId;
Expand Down Expand Up @@ -106,6 +101,7 @@ contract SnapshotShrine is Stewarded, ReentrancyGuard {
/// User actions
/// -----------------------------------------------------------------------

// TODO: Update below notice to reflect structure
/// @notice Offer ERC-20 tokens to the MerkleShrine and distribute them to Champions proportional
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC we the structure is similar except we won't be calling it MerkleShrine - should we just change to SnapshotShrine or do we want a diff name

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaoDeCyrus

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, Merkle => Snapshot @ParthSareen

/// to their shares in the Shrine. Callable by anyone.
/// @param token The ERC-20 token being offered to the Shrine
Expand All @@ -119,9 +115,11 @@ contract SnapshotShrine is Stewarded, ReentrancyGuard {
emit Offer(msg.sender, token, amount);
}

// TODO: Update below notice to reflect structure
/// @notice A Champion or the owner of a Champion may call this to
/// claim their share of the tokens offered to this Shrine.
/// Requires a Merkle proof to prove that the Champion is part of this Shrine's Merkle tree.
// TODO: what kind of proof does it need now?
/// Only callable by the champion (if the right was never transferred) or the owner
/// (that the original champion transferred their rights to)
/// @param claimInfo The info of the claim
Expand Down Expand Up @@ -208,6 +206,7 @@ contract SnapshotShrine is Stewarded, ReentrancyGuard {
}
}

// TODO: Update below notice to reflect structure
/// @notice If this MerkleShrine is a Champion of another MerkleShrine (MetaShrine),
/// calling this can claim the tokens
/// from the MetaShrine and distribute them to this Shrine's Champions. Callable by anyone.
Expand Down Expand Up @@ -254,8 +253,7 @@ contract SnapshotShrine is Stewarded, ReentrancyGuard {
/// -----------------------------------------------------------------------

/// @notice Computes the amount of a particular ERC-20 token claimable by a Champion from
/// a particular snapshotId of the Merkle tree.
/// @param snapshot The Merkle treesnapshotId
/// @param snapshot The snapshotId
/// @param token The ERC-20 token to be claimed
/// @param champion The Champion address
/// @param shares The share amount of the Champion
Expand Down