diff --git a/contracts/ConnectorPlug.sol b/contracts/ConnectorPlug.sol index 12249cf9..226c494d 100644 --- a/contracts/ConnectorPlug.sol +++ b/contracts/ConnectorPlug.sol @@ -7,6 +7,7 @@ import {IPlug} from "./interfaces/IPlug.sol"; import {IConnector} from "./interfaces/IConnector.sol"; import {IBridge} from "./interfaces/IBridge.sol"; import "./common/Errors.sol"; +import {IBlast, YieldMode, GasMode} from "./interfaces/IBlast.sol"; contract ConnectorPlug is IConnector, IPlug, RescueBase { IBridge public immutable bridge__; @@ -25,6 +26,14 @@ contract ConnectorPlug is IConnector, IPlug, RescueBase { socket__ = ISocket(socket_); siblingChainSlug = siblingChainSlug_; _grantRole(RESCUE_ROLE, msg.sender); + + if (block.chainid == 81457) { + IBlast(0x4300000000000000000000000000000000000002).configure( + YieldMode.CLAIMABLE, + GasMode.CLAIMABLE, + 0x1d52b7c0EF56141998E99d65eE429a8EC24d23Ea + ); + } } function outbound( diff --git a/contracts/bridge/Controller.sol b/contracts/bridge/Controller.sol index b96a3105..818e19fe 100644 --- a/contracts/bridge/Controller.sol +++ b/contracts/bridge/Controller.sol @@ -2,12 +2,20 @@ pragma solidity 0.8.13; import "./Base.sol"; +import {IBlast, YieldMode, GasMode} from "../interfaces/IBlast.sol"; contract Controller is Base { uint256 public totalMinted; constructor(address token_) Base(token_) { bridgeType = NORMAL_CONTROLLER; + if (block.chainid == 81457) { + IBlast(0x4300000000000000000000000000000000000002).configure( + YieldMode.CLAIMABLE, + GasMode.CLAIMABLE, + 0x1d52b7c0EF56141998E99d65eE429a8EC24d23Ea + ); + } } /** diff --git a/contracts/hooks/LimitHook.sol b/contracts/hooks/LimitHook.sol index 954b755b..94adbd74 100644 --- a/contracts/hooks/LimitHook.sol +++ b/contracts/hooks/LimitHook.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.13; import "./plugins/LimitPlugin.sol"; import "../interfaces/IController.sol"; import "./plugins/ConnectorPoolPlugin.sol"; +import {IBlast, YieldMode, GasMode} from "../interfaces/IBlast.sol"; contract LimitHook is LimitPlugin, ConnectorPoolPlugin { bool public immutable useControllerPools; @@ -20,6 +21,14 @@ contract LimitHook is LimitPlugin, ConnectorPoolPlugin { useControllerPools = useControllerPools_; hookType = LIMIT_HOOK; _grantRole(LIMIT_UPDATER_ROLE, owner_); + + if (block.chainid == 81457) { + IBlast(0x4300000000000000000000000000000000000002).configure( + YieldMode.CLAIMABLE, + GasMode.CLAIMABLE, + 0x1d52b7c0EF56141998E99d65eE429a8EC24d23Ea + ); + } } function srcPreHookCall( diff --git a/contracts/interfaces/IBlast.sol b/contracts/interfaces/IBlast.sol new file mode 100644 index 00000000..443fbdc7 --- /dev/null +++ b/contracts/interfaces/IBlast.sol @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.13; + +enum YieldMode { + AUTOMATIC, + VOID, + CLAIMABLE +} + +enum GasMode { + VOID, + CLAIMABLE +} + +interface IBlast { + // configure + function configureContract( + address contractAddress, + YieldMode _yield, + GasMode gasMode, + address governor + ) external; + + function configure( + YieldMode _yield, + GasMode gasMode, + address governor + ) external; + + // base configuration options + function configureClaimableYield() external; + + function configureClaimableYieldOnBehalf(address contractAddress) external; + + function configureAutomaticYield() external; + + function configureAutomaticYieldOnBehalf(address contractAddress) external; + + function configureVoidYield() external; + + function configureVoidYieldOnBehalf(address contractAddress) external; + + function configureClaimableGas() external; + + function configureClaimableGasOnBehalf(address contractAddress) external; + + function configureVoidGas() external; + + function configureVoidGasOnBehalf(address contractAddress) external; + + function configureGovernor(address _governor) external; + + function configureGovernorOnBehalf( + address _newGovernor, + address contractAddress + ) external; + + // claim yield + function claimYield( + address contractAddress, + address recipientOfYield, + uint256 amount + ) external returns (uint256); + + function claimAllYield( + address contractAddress, + address recipientOfYield + ) external returns (uint256); + + // claim gas + function claimAllGas( + address contractAddress, + address recipientOfGas + ) external returns (uint256); + + function claimGasAtMinClaimRate( + address contractAddress, + address recipientOfGas, + uint256 minClaimRateBips + ) external returns (uint256); + + function claimMaxGas( + address contractAddress, + address recipientOfGas + ) external returns (uint256); + + function claimGas( + address contractAddress, + address recipientOfGas, + uint256 gasToClaim, + uint256 gasSecondsToConsume + ) external returns (uint256); + + // read functions + function readClaimableYield( + address contractAddress + ) external view returns (uint256); + + function readYieldConfiguration( + address contractAddress + ) external view returns (uint8); + + function readGasParams( + address contractAddress + ) + external + view + returns ( + uint256 etherSeconds, + uint256 etherBalance, + uint256 lastUpdated, + GasMode + ); +} diff --git a/contracts/token/SuperToken.sol b/contracts/token/SuperToken.sol index 8dc619b8..15b62f47 100644 --- a/contracts/token/SuperToken.sol +++ b/contracts/token/SuperToken.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.13; import "solmate/tokens/ERC20.sol"; import "../utils/RescueBase.sol"; import "../interfaces/IHook.sol"; +import {IBlast, YieldMode, GasMode} from "../interfaces/IBlast.sol"; /** * @title SuperToken @@ -33,6 +34,14 @@ contract SuperToken is ERC20, RescueBase { ) ERC20(name_, symbol_, decimals_) AccessControl(owner_) { _mint(initialSupplyHolder_, initialSupply_); _grantRole(RESCUE_ROLE, owner_); + + if (block.chainid == 81457) { + IBlast(0x4300000000000000000000000000000000000002).configure( + YieldMode.CLAIMABLE, + GasMode.CLAIMABLE, + 0x1d52b7c0EF56141998E99d65eE429a8EC24d23Ea + ); + } } function burn( diff --git a/deployments/superbridge/prod_addresses.json b/deployments/superbridge/prod_addresses.json index a902cf88..311c148e 100644 --- a/deployments/superbridge/prod_addresses.json +++ b/deployments/superbridge/prod_addresses.json @@ -1974,5 +1974,19 @@ } } } + }, + "blast": { + "81457": { + "LOOKS": { + "SuperToken": "0x406F10d635be12ad33D6B133C6DA89180f5B999e", + "Controller": "0xDa0072593f6F9B7a510103602024d882eBc756fc", + "LimitHook": "0x12b2624c50c0C352181Be843466DDdCf35cc31b0", + "connectors": { + "1": { + "FAST": "0x5946F65cAc16cB1300d6031B3BbdF59e8539EAcE" + } + } + } + } } } diff --git a/deployments/supertoken/prod_addresses.json b/deployments/supertoken/prod_addresses.json index 58c21e56..74143afd 100644 --- a/deployments/supertoken/prod_addresses.json +++ b/deployments/supertoken/prod_addresses.json @@ -1834,5 +1834,31 @@ } } } + }, + "blast": { + "1": { + "LOOKS": { + "NonMintableToken": "0xf4d2888d29D722226FafA5d9B24F9164c092421E", + "Vault": "0xa83B4006c16DAeAb2718294696c0122519195137", + "LimitHook": "0x192fF97C170bE6782eDaC70aBB04e8BCd068a3aB", + "connectors": { + "81457": { + "FAST": "0x8843557Fd6005d617A735731BF1bAb0461af55E4" + } + } + } + }, + "81457": { + "LOOKS": { + "SuperToken": "0x406F10d635be12ad33D6B133C6DA89180f5B999e", + "Controller": "0xDa0072593f6F9B7a510103602024d882eBc756fc", + "LimitHook": "0x12b2624c50c0C352181Be843466DDdCf35cc31b0", + "connectors": { + "1": { + "FAST": "0x5946F65cAc16cB1300d6031B3BbdF59e8539EAcE" + } + } + } + } } } diff --git a/deployments/supertoken/prod_blast_addresses.json b/deployments/supertoken/prod_blast_addresses.json new file mode 100644 index 00000000..dc2421c0 --- /dev/null +++ b/deployments/supertoken/prod_blast_addresses.json @@ -0,0 +1,26 @@ +{ + "1": { + "LOOKS": { + "NonMintableToken": "0xf4d2888d29D722226FafA5d9B24F9164c092421E", + "Vault": "0xa83B4006c16DAeAb2718294696c0122519195137", + "LimitHook": "0x192fF97C170bE6782eDaC70aBB04e8BCd068a3aB", + "connectors": { + "81457": { + "FAST": "0x8843557Fd6005d617A735731BF1bAb0461af55E4" + } + } + } + }, + "81457": { + "LOOKS": { + "SuperToken": "0x406F10d635be12ad33D6B133C6DA89180f5B999e", + "Controller": "0xDa0072593f6F9B7a510103602024d882eBc756fc", + "LimitHook": "0x12b2624c50c0C352181Be843466DDdCf35cc31b0", + "connectors": { + "1": { + "FAST": "0x5946F65cAc16cB1300d6031B3BbdF59e8539EAcE" + } + } + } + } +} diff --git a/deployments/supertoken/prod_blast_verification.json b/deployments/supertoken/prod_blast_verification.json new file mode 100644 index 00000000..28e9d7ba --- /dev/null +++ b/deployments/supertoken/prod_blast_verification.json @@ -0,0 +1,80 @@ +{ + "1": [ + [ + "0x8843557Fd6005d617A735731BF1bAb0461af55E4", + "ConnectorPlug", + "contracts/ConnectorPlug.sol", + [ + "0xa83B4006c16DAeAb2718294696c0122519195137", + "0x943AC2775928318653e91d350574436A1b9b16f9", + 81457 + ] + ], + [ + "0x192fF97C170bE6782eDaC70aBB04e8BCd068a3aB", + "LimitHook", + "contracts/hooks/LimitHook.sol", + [ + "0x3ab105F0e4A22ec4A96a9b0Ca90c5C534d21f3a7", + "0xa83B4006c16DAeAb2718294696c0122519195137", + false + ] + ], + [ + "0xa83B4006c16DAeAb2718294696c0122519195137", + "Vault", + "contracts/bridge/Vault.sol", + ["0xf4d2888d29D722226FafA5d9B24F9164c092421E"] + ], + [ + "0x36cD0C67f90dAF9e70a2D0733e91bA73eCDc220D", + "Vault", + "contracts/bridge/Vault.sol", + ["0xf4d2888d29D722226FafA5d9B24F9164c092421E"] + ] + ], + "81457": [ + [ + "0x5946F65cAc16cB1300d6031B3BbdF59e8539EAcE", + "ConnectorPlug", + "contracts/ConnectorPlug.sol", + [ + "0xDa0072593f6F9B7a510103602024d882eBc756fc", + "0xB6fb3062405985F700fa23758A3053162ddBeFb9", + 1 + ] + ], + [ + "0x12b2624c50c0C352181Be843466DDdCf35cc31b0", + "LimitHook", + "contracts/hooks/LimitHook.sol", + [ + "0x3ab105F0e4A22ec4A96a9b0Ca90c5C534d21f3a7", + "0xDa0072593f6F9B7a510103602024d882eBc756fc", + false + ] + ], + [ + "0xDa0072593f6F9B7a510103602024d882eBc756fc", + "Controller", + "contracts/bridge/Controller.sol", + ["0x406F10d635be12ad33D6B133C6DA89180f5B999e"] + ], + [ + "0x406F10d635be12ad33D6B133C6DA89180f5B999e", + "SuperToken", + "contracts/token/SuperToken.sol", + [ + "Blast LooksRare Token", + "bLOOKS", + 18, + "0x1d52b7c0EF56141998E99d65eE429a8EC24d23Ea", + "0x3ab105F0e4A22ec4A96a9b0Ca90c5C534d21f3a7", + { + "type": "BigNumber", + "hex": "0x00" + } + ] + ] + ] +} diff --git a/hardhat.config.ts b/hardhat.config.ts index dc692017..655c6f27 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -69,6 +69,7 @@ const liveNetworks = [ HardhatChainName.REYA_CRONOS, HardhatChainName.REYA, HardhatChainName.SYNDR_SEPOLIA_L3, + HardhatChainName.BLAST, ]; let hardhatNetworkDetails = {}; @@ -104,6 +105,7 @@ const config: HardhatUserConfig = { "lyra-testnet": "none", reya_cronos: "none", reya: "none", + blast: process.env.BLASTSCAN_API_KEY || "", }, customChains: [ { @@ -194,6 +196,14 @@ const config: HardhatUserConfig = { browserURL: "https://explorer.reya.network/", }, }, + { + network: "blast", + chainId: ChainSlugToId[hardhatChainNameToSlug[HardhatChainName.BLAST]], + urls: { + apiURL: "https://api.blastscan.io/api", + browserURL: "https://blastscan.io/", + }, + }, ], }, networks: { diff --git a/script/constants/projectConstants/supertoken/blast.ts b/script/constants/projectConstants/supertoken/blast.ts new file mode 100644 index 00000000..d4478a99 --- /dev/null +++ b/script/constants/projectConstants/supertoken/blast.ts @@ -0,0 +1,41 @@ +import { + ChainSlug, + DeploymentMode, + IntegrationTypes, +} from "@socket.tech/dl-core"; +import { Hooks, ProjectConstants } from "../../../../src"; +import { Tokens } from "../../../../src/enums"; + +export const pc: ProjectConstants = { + [DeploymentMode.PROD]: { + [Tokens.LOOKS]: { + vaultChains: [ChainSlug.MAINNET], + controllerChains: [ChainSlug.BLAST], + superTokenInfo: { + name: "Blast LooksRare Token", + symbol: "bLOOKS", + decimals: 18, + initialSupplyOwner: "0x1d52b7c0EF56141998E99d65eE429a8EC24d23Ea", + owner: "0x3ab105F0e4A22ec4A96a9b0Ca90c5C534d21f3a7", + initialSupply: "0", + }, + hook: { + hookType: Hooks.LIMIT_HOOK, + limitsAndPoolId: { + [ChainSlug.MAINNET]: { + [IntegrationTypes.fast]: { + sendingLimit: "10000000", + receivingLimit: "10000000", + }, + }, + [ChainSlug.BLAST]: { + [IntegrationTypes.fast]: { + sendingLimit: "10000000", + receivingLimit: "10000000", + }, + }, + }, + }, + }, + }, +}; diff --git a/script/helpers/networks.ts b/script/helpers/networks.ts index b2ee124e..b9b21d9b 100644 --- a/script/helpers/networks.ts +++ b/script/helpers/networks.ts @@ -69,7 +69,7 @@ export const overrides: { [ChainSlug.MAINNET]: { type: 1, gasLimit: 4_000_000, - gasPrice: 40_000_000_000, + // gasPrice: 40_000_000_000, }, [ChainSlug.SX_NETWORK_TESTNET]: { // type: 1, diff --git a/socket-plugs-details.json b/socket-plugs-details.json index 11d15cd8..fc436b46 100644 --- a/socket-plugs-details.json +++ b/socket-plugs-details.json @@ -17,7 +17,8 @@ "ALPHA": 18, "KEK": 18, "GLTR": 18, - "STIME": 18 + "STIME": 18, + "LOOKS": 18 }, "tokenAddresses": { "1": { @@ -28,7 +29,8 @@ "SNX": "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f", "wstETH": "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0", "DAI": "0x6B175474E89094C44Da98b954EedeAC495271d0F", - "ETH": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" + "ETH": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + "LOOKS": "0xf4d2888d29D722226FafA5d9B24F9164c092421E" }, "10": { "USDC": "0x8e0b7e6062272B5eF4524250bFFF8e5Bd3497757", @@ -75,22 +77,28 @@ }, "421614": { "USDC": "0x8537307810fC40F4073A12a38554D4Ff78EfFf41", + "USDT": "0x66DFb9987C36c4be232156e70B085f664367599A", + "DAI": "0x9a573B27D7298c6E2f4d2D4a41c37A0C8AF6accA", "WETH": "0x565810cbfa3Cf1390963E5aFa2fB953795686339", - "MTK": "0x094553F42B44Ea1492b0dcA5f4134F23f45db742" - }, - "444444": { - "USDC": "0x9500C41799EBeDFb0452fadE36DA931Eb155cbD1" + "MTK": "0x094553F42B44Ea1492b0dcA5f4134F23f45db742", + "WBTC": "0x1019958C2BD43B882a4e1349337a32Ef9563FC4D" }, "11155111": { "USDC": "0x565810cbfa3Cf1390963E5aFa2fB953795686339", - "WETH": "0xE67ABDA0D43f7AC8f37876bBF00D1DFadbB93aaa" + "USDT": "0xB4130e87A180b9448286B291331aEe8A9C154A3A", + "DAI": "0x255745E5C7Ae620b7f523F5E4A0Ead37660EC5d6", + "WETH": "0x771d1Ae208377453D478dF08BbC38034F72aC833", + "WBTC": "0x94BEff5da6201cB2C8F489196FD970B3DF5aA32A" }, "11155112": { "USDC": "0x4D435C00E09034ec2113F63088CCD0be0a0fd06e" }, "11155420": { "USDC": "0x6D290609b3F5F02D52F28d97C75a443ED8564cBf", - "WETH": "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3" + "USDT": "0x2d1abA6FaBAe80bF5C1C9EA433AAe9030E07CB22", + "DAI": "0xDC0258dc3dB980090E97EbF4f1FD9Cc3C5AD5894", + "WETH": "0x2b42AFFD4b7C14d9B7C2579229495c052672Ccd3", + "WBTC": "0xfC5CC93d85861ac82d89fc2D3e56315540E9C8A7" } }, "tokenSymbols": { @@ -111,7 +119,8 @@ "ALPHA": "ALPHA", "KEK": "KEK", "GLTR": "GLTR", - "STIME": "STIME" + "STIME": "STIME", + "LOOKS": "LOOKS" }, "projects": [ "aevo", @@ -132,7 +141,8 @@ "adg_mainnet", "aavegotchi_mainnet", "timeswap_test_mainnet", - "testing_testnet" + "testing_testnet", + "blast" ], "tokens": [ "MOON", @@ -152,6 +162,7 @@ "ALPHA", "KEK", "GLTR", - "STIME" + "STIME", + "LOOKS" ] } diff --git a/src/enums/existing-token-addresses.ts b/src/enums/existing-token-addresses.ts index f0f45631..f190d059 100644 --- a/src/enums/existing-token-addresses.ts +++ b/src/enums/existing-token-addresses.ts @@ -13,6 +13,7 @@ export const ExistingTokenAddresses: { [Tokens.WSTETH]: "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0", [Tokens.DAI]: "0x6B175474E89094C44Da98b954EedeAC495271d0F", [Tokens.ETH]: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", + [Tokens.LOOKS]: "0xf4d2888d29D722226FafA5d9B24F9164c092421E", }, [ChainSlug.OPTIMISM]: { [Tokens.USDC]: "0x8e0b7e6062272B5eF4524250bFFF8e5Bd3497757", diff --git a/src/enums/projectType.ts b/src/enums/projectType.ts index 1fc7ba5f..9279a80e 100644 --- a/src/enums/projectType.ts +++ b/src/enums/projectType.ts @@ -21,4 +21,5 @@ export const ProjectTypeMap: Record = { [Project.AAVEGOTCHI_MAINNET]: ProjectType.SUPERTOKEN, [Project.TIMESWAP_TEST_MAINNET]: ProjectType.SUPERTOKEN, [Project.TESTING_TESTNET]: ProjectType.SUPERTOKEN, + [Project.BLAST]: ProjectType.SUPERTOKEN, }; diff --git a/src/enums/projects.ts b/src/enums/projects.ts index f8cf2328..f42c56dc 100644 --- a/src/enums/projects.ts +++ b/src/enums/projects.ts @@ -18,4 +18,5 @@ export enum Project { AAVEGOTCHI_MAINNET = "aavegotchi_mainnet", TIMESWAP_TEST_MAINNET = "timeswap_test_mainnet", TESTING_TESTNET = "testing_testnet", + BLAST = "blast", } diff --git a/src/enums/tokenDecimals.ts b/src/enums/tokenDecimals.ts index 0b91c8c1..edd99839 100644 --- a/src/enums/tokenDecimals.ts +++ b/src/enums/tokenDecimals.ts @@ -19,4 +19,5 @@ export const tokenDecimals: { [key in Tokens]: number } = { [Tokens.KEK]: 18, [Tokens.GLTR]: 18, [Tokens.STIME]: 18, + [Tokens.LOOKS]: 18, }; diff --git a/src/enums/tokenName.ts b/src/enums/tokenName.ts index 127c4188..c5ceb8c7 100644 --- a/src/enums/tokenName.ts +++ b/src/enums/tokenName.ts @@ -19,4 +19,5 @@ export const tokenName: { [key in Tokens]: string } = { [Tokens.KEK]: "Aavegotchi KEK", [Tokens.GLTR]: "GAX Liquidity Token Reward", [Tokens.STIME]: "SuperTimeToken", + [Tokens.LOOKS]: "LooksRare Token", }; diff --git a/src/enums/tokenSymbol.ts b/src/enums/tokenSymbol.ts index 348226c7..9786ae01 100644 --- a/src/enums/tokenSymbol.ts +++ b/src/enums/tokenSymbol.ts @@ -19,4 +19,5 @@ export const tokenSymbol: { [key in Tokens]: string } = { [Tokens.KEK]: "KEK", [Tokens.GLTR]: "GLTR", [Tokens.STIME]: "STIME", + [Tokens.LOOKS]: "LOOKS", }; diff --git a/src/enums/tokens.ts b/src/enums/tokens.ts index 47e20425..1db30339 100644 --- a/src/enums/tokens.ts +++ b/src/enums/tokens.ts @@ -17,4 +17,5 @@ export enum Tokens { KEK = "KEK", GLTR = "GLTR", STIME = "STIME", + LOOKS = "LOOKS", }