Skip to content

Commit

Permalink
feat: update interface
Browse files Browse the repository at this point in the history
  • Loading branch information
iavl committed May 29, 2024
1 parent 3504247 commit a190b1c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts-upgradeable
Submodule openzeppelin-contracts-upgradeable added at 723f8c
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@openzeppelin/=lib/openzeppelin-contracts
@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std/=lib/forge-std/src/
20 changes: 18 additions & 2 deletions src/Follow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
pragma solidity 0.8.22;

import {IFollow} from "./interfaces/IFollow.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {
ERC20Upgradeable
} from "@openzeppelin-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol";

//contract Follow is IFollow, ERC20 {}
contract Follow is IFollow, ERC20Upgradeable {
/// @inheritdoc IFollow
function initialize(string calldata name_, string calldata symbol_) external initializer {
super.__ERC20_init(name_, symbol_);
}

/// @inheritdoc IFollow
function mint(address to) external override {}

/// @inheritdoc IFollow
function tip(address from, uint256 amount, bytes32 feedId) external override {}

/// @inheritdoc IFollow
function withdraw(address to, uint256 amount) external override {}
}
23 changes: 4 additions & 19 deletions src/interfaces/IFollow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,18 @@ pragma solidity 0.8.22;

interface IFollow {
/**
* @notice Register a new account.
* @dev Only ADMIN_ROLE is allowed to call this method.
* @param userId The new user ID to register.
* @notice Initializes the contract.
* @param name_ The token name.
* @param symbol_ The token symbol.
*/
function register(bytes32 userId, address account) external returns (address);
function initialize(string calldata name_, string calldata symbol_) external;

/**
* @notice Mints new tokens.
* @param to The account to receive the tokens.
*/
function mint(address to) external;

/**
* @notice Creates a feed.
* @dev Only ADMIN_ROLE is allowed to call this method.
* @param feedId The feed id.
* @param userId The user ID who owns the feed.
*/
function createFeed(bytes32 feedId, bytes32 userId) external;

/**
* @notice Returns the feed owner.
* @param feedId The feed id.
* @return userId The user ID who owns the feed.
*/
function getFeedOwner(bytes32 feedId) external view returns (bytes32 userId);

/**
* @notice Tips the recipient feed.
* @param from The address who sends the tip.
Expand Down

0 comments on commit a190b1c

Please sign in to comment.