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

Remove unused contracts #11

Merged
merged 5 commits into from
Jan 22, 2025
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
File renamed without changes.
27 changes: 19 additions & 8 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
pragma solidity ^0.8.13;

import "../lib/forge-std/src/Script.sol";
import {SpotlightTokenFaucet} from "../src/spotlight-token-faucet/SpotlightTokenFaucet.sol";
import {SpotlightTokenFactory} from "../src/spotlight-token-factory/SpotlightTokenFactory.sol";
import {SpotlightTokenIPCollection} from "../src/spotlight-token-collection/SpotlightTokenIPCollection.sol";
import {SpotlightUSDCBondingCurve} from "../src/spotlight-bonding-curve/SpotlightUSDCBondingCurve.sol";
import {SpotlightNativeBondingCurve} from "../src/spotlight-bonding-curve/SpotlightNativeBondingCurve.sol";
import {UpgradeableBeacon} from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
import {SpotlightToken} from "../src/spotlight-token/SpotlightToken.sol";
import {BeaconProxy} from "../src/beacon-proxy/BeaconProxy.sol";
Expand All @@ -26,6 +25,20 @@ contract Deploy is Script {
--verifier-url 'https://odyssey.storyscan.xyz/api/'
*/

/**
* @dev Odyssey chain id: 1516
* @dev Odyssey rpc: https://odyssey.storyrpc.io
*/

/* verify contract with the following command:
forge verify-contract \
--rpc-url https://odyssey.storyrpc.io \
--verifier blockscout \
--verifier-url 'https://odyssey.storyscan.xyz/api/' \
{REPLACE_CONTRACT_ADDRESS} \
src/{CONTRACT_PATH}.sol:{CONTRACT_NAME}
*/

//@notice The address of the SUSDCToken contract on Odyssey.(https://odyssey.storyscan.xyz/address/0x40fCa9cB1AB15eD9B5bDA19A52ac00A78AE08e1D?tab=contract)
address private _SUSDCTokenAddr = 0x40fCa9cB1AB15eD9B5bDA19A52ac00A78AE08e1D;
address private _STORY_DERIVATIVE_WORKFLOWS_ADDRESS = 0xa8815CEB96857FFb8f5F8ce920b1Ae6D70254C7B;
Expand All @@ -37,17 +50,15 @@ contract Deploy is Script {

function run() public {
vm.startBroadcast(vm.envUint("PRIVATE_KEY"));
// @dev deploy spotlight token faucet contract (SUSDC)
new SpotlightTokenFaucet(_SUSDCTokenAddr);

// @dev deploy spotlight token ip collection contract
SpotlightTokenIPCollection tokenIpCollection = new SpotlightTokenIPCollection(
address(0) // token factory address, will be set later
);

// @dev deploy spotlight bonding curve contract
SpotlightUSDCBondingCurve bondingCurve = new SpotlightUSDCBondingCurve(
6_900_000_000_000, // A=6.9*10^-6
SpotlightNativeBondingCurve bondingCurve = new SpotlightNativeBondingCurve(
690_000_000, // A=6.9*10^-6
2_878_200_000 // B=2.8782×10^−9
);

Expand All @@ -71,11 +82,11 @@ contract Deploy is Script {
BeaconProxy factoryProxy = new BeaconProxy(address(factoryBeacon));
SpotlightTokenFactory(address(factoryProxy)).initialize(
_SPOTLIGHT_TOKEN_FACTORY_OWNER, // owner_
5_000_000, // creationFee: 5 usdc
0.1 ether, // creationFee: 0.1 ether
address(tokenIpCollection), // tokenIpCollection_
address(spotlightTokenBeacon), // tokenBeacon_
address(bondingCurve), // bondingCurve_
_SUSDCTokenAddr, // baseToken_
WRAPPER_IP,
_STORY_DERIVATIVE_WORKFLOWS_ADDRESS, // storyDerivativeWorkflows_
PIPERX_V2_ROUTER, // piperxV2Router_
PIPERX_V2_FACTORY, // piperxV2Factory_
Expand Down
99 changes: 0 additions & 99 deletions script/OnDexDeploy.s.sol

This file was deleted.

1 change: 1 addition & 0 deletions src/interfaces/IUniswapV2Factory.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0;

interface IUniswapV2Factory {
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/IUniswapV2Router01.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/IUniswapV2Router02.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.2;

import "./IUniswapV2Router01.sol";
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/IWETH.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0;

interface IWETH {
Expand Down
77 changes: 0 additions & 77 deletions src/spotlight-bonding-curve/SpotlightUSDCBondingCurve.sol

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

interface ISpotlightProtocolRewards {
Expand Down
22 changes: 12 additions & 10 deletions src/spotlight-protocol-rewards/SpotlightProtocolRewards.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;

import {ISpotlightProtocolRewards} from "./ISpotlightProtocolRewards.sol";
Expand Down Expand Up @@ -31,7 +31,7 @@ contract SpotlightProtocolRewards is ISpotlightProtocolRewards, Ownable {

/*
* @dev The total amount of IP held in the contract
*
*
* @return uint256 Total IP balance
*/
function totalRewards() external view returns (uint256) {
Expand All @@ -40,7 +40,7 @@ contract SpotlightProtocolRewards is ISpotlightProtocolRewards, Ownable {

/*
* @dev Deposit protocol rewards
*
*
* @param ipaId The IpaId to deposit rewards for
*/
function deposit(address ipaId) external payable {
Expand All @@ -56,7 +56,7 @@ contract SpotlightProtocolRewards is ISpotlightProtocolRewards, Ownable {

/*
* @dev Withdraw protocol rewards
*
*
* @param ipaId The IpaId to withdraw rewards from
*/
function withdraw(address ipaId) external onlyWithdrawEnabled {
Expand Down Expand Up @@ -92,7 +92,9 @@ contract SpotlightProtocolRewards is ISpotlightProtocolRewards, Ownable {
if (ipaId == address(0)) revert AddressZero();

(, address tokenContract, uint256 tokenId) = _getToken(ipaId);
if (!_checkIsOwner(tokenContract, tokenId)) revert InvalidWithdraw();
if (!_checkIsOwner(tokenContract, tokenId)) {
revert InvalidWithdraw();
}

uint256 ownerRewards = this.rewardsOf(tokenContract, tokenId);
if (ownerRewards == 0) continue;
Expand All @@ -113,7 +115,7 @@ contract SpotlightProtocolRewards is ISpotlightProtocolRewards, Ownable {

/*
* @dev Is withdraw and withdrawAll functionality are enabled
*
*
* @return bool Is withdraw and withdrawAll functionality are enabled
*/
function isWithdrawEnabled() external view returns (bool) {
Expand All @@ -131,7 +133,7 @@ contract SpotlightProtocolRewards is ISpotlightProtocolRewards, Ownable {
* @dev Get the specific rewards for an IpaId
*
* @param ipaId The address to check the rewards for
*
*
* @return uint256 The specific rewards for the IpaId
*/
function rewardsOf(address ipaId) external view returns (uint256) {
Expand All @@ -143,10 +145,10 @@ contract SpotlightProtocolRewards is ISpotlightProtocolRewards, Ownable {

/*
* @dev Get the specific rewards for a token
*
*
* @param tokenContract The contract address of the token
* @param tokenId The ID of the token
*
*
* @return uint256 The specific rewards for the token
*/
function rewardsOf(address tokenContract, uint256 tokenId) external view returns (uint256) {
Expand All @@ -158,7 +160,7 @@ contract SpotlightProtocolRewards is ISpotlightProtocolRewards, Ownable {
/*
* @dev Internal function to get token info using low level call
* @param ipaId The address of the contract to call
*
*
* @return chainId The EIP-155 ID of the chain the token exists on
* @return tokenContract The contract address of the token
* @return tokenId The ID of the token
Expand Down
Loading
Loading