diff --git a/fc-community-extension/public/logos/eth.png b/fc-community-extension/public/logos/eth.png index 36e02aa1..58d17749 100644 Binary files a/fc-community-extension/public/logos/eth.png and b/fc-community-extension/public/logos/eth.png differ diff --git a/fc-community-extension/src/pages/popup.js b/fc-community-extension/src/pages/popup.js index 200b5cbf..477a426c 100644 --- a/fc-community-extension/src/pages/popup.js +++ b/fc-community-extension/src/pages/popup.js @@ -59,10 +59,7 @@ function FCProfile(props) {
- +
{props.loggedIn && } @@ -186,14 +183,14 @@ function FCPopup({ provider }) { return { notes: `${stats[0]}`, ratings: `${stats[1]}`, - earnings: `${ethers.formatEther(earnings)} ETH`, + earnings: `${ethers.formatEther(earnings)} ⧫`, }; } else { console.log(`Default data for user stats`); return { notes: '?', ratings: '?', - earnings: '? ETH', + earnings: '? ⧫', }; } }; @@ -203,7 +200,7 @@ function FCPopup({ provider }) { const numberRatings = () => userStats.loading || !userStats() ? '?' : userStats().ratings; const earnings = () => - userStats.loading || !userStats() ? '? ETH' : userStats().earnings; + userStats.loading || !userStats() ? '?' : userStats().earnings; provider.getAddress().then(setAddress); return ( diff --git a/fc-community-extension/src/utils/constants.js b/fc-community-extension/src/utils/constants.js index d9b06c3d..69772d10 100644 --- a/fc-community-extension/src/utils/constants.js +++ b/fc-community-extension/src/utils/constants.js @@ -29,19 +29,26 @@ export const makeOpenseaUrl = (contractAddress, tokenId) => export const FC_MAIN_CONTRACT_ABI = [ { type: 'constructor', - inputs: [ - { - name: '_owner', - type: 'address', - internalType: 'address', - }, - ], + inputs: [], stateMutability: 'nonpayable', }, { type: 'receive', stateMutability: 'payable', }, + { + type: 'function', + name: 'UPGRADE_INTERFACE_VERSION', + inputs: [], + outputs: [ + { + name: '', + type: 'string', + internalType: 'string', + }, + ], + stateMutability: 'view', + }, { type: 'function', name: 'communityNotes', @@ -175,6 +182,19 @@ export const FC_MAIN_CONTRACT_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'initialize', + inputs: [ + { + name: 'initialOwner', + type: 'address', + internalType: 'address', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', name: 'minimumStakePerNote', @@ -243,6 +263,19 @@ export const FC_MAIN_CONTRACT_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'proxiableUUID', + inputs: [], + outputs: [ + { + name: '', + type: 'bytes32', + internalType: 'bytes32', + }, + ], + stateMutability: 'view', + }, { type: 'function', name: 'rateNote', @@ -266,6 +299,13 @@ export const FC_MAIN_CONTRACT_ABI = [ outputs: [], stateMutability: 'payable', }, + { + type: 'function', + name: 'renounceOwnership', + inputs: [], + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', name: 'setMinimumStakePerNote', @@ -294,35 +334,34 @@ export const FC_MAIN_CONTRACT_ABI = [ }, { type: 'function', - name: 'supportsInterface', + name: 'transferOwnership', inputs: [ { - name: 'interfaceId', - type: 'bytes4', - internalType: 'bytes4', - }, - ], - outputs: [ - { - name: '', - type: 'bool', - internalType: 'bool', + name: 'newOwner', + type: 'address', + internalType: 'address', }, ], - stateMutability: 'view', + outputs: [], + stateMutability: 'nonpayable', }, { type: 'function', - name: 'transferOwnership', + name: 'upgradeToAndCall', inputs: [ { - name: '_newOwner', + name: 'newImplementation', type: 'address', internalType: 'address', }, + { + name: 'data', + type: 'bytes', + internalType: 'bytes', + }, ], outputs: [], - stateMutability: 'nonpayable', + stateMutability: 'payable', }, { type: 'function', @@ -420,6 +459,45 @@ export const FC_MAIN_CONTRACT_ABI = [ ], anonymous: false, }, + { + type: 'event', + name: 'Initialized', + inputs: [ + { + name: 'version', + type: 'uint64', + indexed: false, + internalType: 'uint64', + }, + ], + anonymous: false, + }, + { + type: 'event', + name: 'MinimumStakePerNoteUpdated', + inputs: [ + { + name: 'newMinimumStake', + type: 'uint64', + indexed: false, + internalType: 'uint64', + }, + ], + anonymous: false, + }, + { + type: 'event', + name: 'MinimumStakePerRatingUpdated', + inputs: [ + { + name: 'newMinimumStake', + type: 'uint64', + indexed: false, + internalType: 'uint64', + }, + ], + anonymous: false, + }, { type: 'event', name: 'NoteCreated', @@ -613,6 +691,30 @@ export const FC_MAIN_CONTRACT_ABI = [ ], anonymous: false, }, + { + type: 'event', + name: 'Upgraded', + inputs: [ + { + name: 'implementation', + type: 'address', + indexed: true, + internalType: 'address', + }, + ], + anonymous: false, + }, + { + type: 'error', + name: 'AddressEmptyCode', + inputs: [ + { + name: 'target', + type: 'address', + internalType: 'address', + }, + ], + }, { type: 'error', name: 'CantRateOwnNote', @@ -623,6 +725,27 @@ export const FC_MAIN_CONTRACT_ABI = [ name: 'ContentInvalid', inputs: [], }, + { + type: 'error', + name: 'ERC1967InvalidImplementation', + inputs: [ + { + name: 'implementation', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'ERC1967NonPayable', + inputs: [], + }, + { + type: 'error', + name: 'FailedInnerCall', + inputs: [], + }, { type: 'error', name: 'FailedToReward', @@ -640,7 +763,12 @@ export const FC_MAIN_CONTRACT_ABI = [ }, { type: 'error', - name: 'NotOwner', + name: 'InvalidInitialization', + inputs: [], + }, + { + type: 'error', + name: 'NotInitializing', inputs: [], }, { @@ -658,6 +786,28 @@ export const FC_MAIN_CONTRACT_ABI = [ name: 'NoteDoesNotExist', inputs: [], }, + { + type: 'error', + name: 'OwnableInvalidOwner', + inputs: [ + { + name: 'owner', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'OwnableUnauthorizedAccount', + inputs: [ + { + name: 'account', + type: 'address', + internalType: 'address', + }, + ], + }, { type: 'error', name: 'PostUrlInvalid', @@ -673,23 +823,28 @@ export const FC_MAIN_CONTRACT_ABI = [ name: 'RatingInvalid', inputs: [], }, -]; - -export const FC_X_CONTRACT_ABI = [ { - type: 'constructor', + type: 'error', + name: 'UUPSUnauthorizedCallContext', + inputs: [], + }, + { + type: 'error', + name: 'UUPSUnsupportedProxiableUUID', inputs: [ { - name: '_owner', - type: 'address', - internalType: 'address', - }, - { - name: '_backend', - type: 'address', - internalType: 'address', + name: 'slot', + type: 'bytes32', + internalType: 'bytes32', }, ], + }, +]; + +export const FC_X_CONTRACT_ABI = [ + { + type: 'constructor', + inputs: [], stateMutability: 'nonpayable', }, { @@ -718,6 +873,19 @@ export const FC_X_CONTRACT_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'UPGRADE_INTERFACE_VERSION', + inputs: [], + outputs: [ + { + name: '', + type: 'string', + internalType: 'string', + }, + ], + stateMutability: 'view', + }, { type: 'function', name: 'backend', @@ -798,6 +966,24 @@ export const FC_X_CONTRACT_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'initialize', + inputs: [ + { + name: '_owner', + type: 'address', + internalType: 'address', + }, + { + name: '_backend', + type: 'address', + internalType: 'address', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', name: 'isApprovedForAll', @@ -894,6 +1080,26 @@ export const FC_X_CONTRACT_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'proxiableUUID', + inputs: [], + outputs: [ + { + name: '', + type: 'bytes32', + internalType: 'bytes32', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'renounceOwnership', + inputs: [], + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', name: 'safeBatchTransferFrom', @@ -1060,7 +1266,7 @@ export const FC_X_CONTRACT_ABI = [ name: 'transferOwnership', inputs: [ { - name: '_newOwner', + name: 'newOwner', type: 'address', internalType: 'address', }, @@ -1070,21 +1276,39 @@ export const FC_X_CONTRACT_ABI = [ }, { type: 'function', - name: 'uri', + name: 'upgradeToAndCall', inputs: [ { - name: '', - type: 'uint256', - internalType: 'uint256', + name: 'newImplementation', + type: 'address', + internalType: 'address', }, - ], - outputs: [ { - name: '', - type: 'string', - internalType: 'string', - }, - ], + name: 'data', + type: 'bytes', + internalType: 'bytes', + }, + ], + outputs: [], + stateMutability: 'payable', + }, + { + type: 'function', + name: 'uri', + inputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + outputs: [ + { + name: '', + type: 'string', + internalType: 'string', + }, + ], stateMutability: 'view', }, { @@ -1148,6 +1372,19 @@ export const FC_X_CONTRACT_ABI = [ ], anonymous: false, }, + { + type: 'event', + name: 'Initialized', + inputs: [ + { + name: 'version', + type: 'uint64', + indexed: false, + internalType: 'uint64', + }, + ], + anonymous: false, + }, { type: 'event', name: 'MintWithAdjustedValue', @@ -1349,6 +1586,30 @@ export const FC_X_CONTRACT_ABI = [ ], anonymous: false, }, + { + type: 'event', + name: 'Upgraded', + inputs: [ + { + name: 'implementation', + type: 'address', + indexed: true, + internalType: 'address', + }, + ], + anonymous: false, + }, + { + type: 'error', + name: 'AddressEmptyCode', + inputs: [ + { + name: 'target', + type: 'address', + internalType: 'address', + }, + ], + }, { type: 'error', name: 'BadMintPrice', @@ -1456,11 +1717,37 @@ export const FC_X_CONTRACT_ABI = [ }, ], }, + { + type: 'error', + name: 'ERC1967InvalidImplementation', + inputs: [ + { + name: 'implementation', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'ERC1967NonPayable', + inputs: [], + }, + { + type: 'error', + name: 'FailedInnerCall', + inputs: [], + }, { type: 'error', name: 'FailedToRefund', inputs: [], }, + { + type: 'error', + name: 'InvalidInitialization', + inputs: [], + }, { type: 'error', name: 'NoTokenAssociated', @@ -1473,14 +1760,52 @@ export const FC_X_CONTRACT_ABI = [ }, { type: 'error', - name: 'NotOwner', + name: 'NotInitializing', inputs: [], }, + { + type: 'error', + name: 'OwnableInvalidOwner', + inputs: [ + { + name: 'owner', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'OwnableUnauthorizedAccount', + inputs: [ + { + name: 'account', + type: 'address', + internalType: 'address', + }, + ], + }, { type: 'error', name: 'SupplyExhausted', inputs: [], }, + { + type: 'error', + name: 'UUPSUnauthorizedCallContext', + inputs: [], + }, + { + type: 'error', + name: 'UUPSUnsupportedProxiableUUID', + inputs: [ + { + name: 'slot', + type: 'bytes32', + internalType: 'bytes32', + }, + ], + }, { type: 'error', name: 'UnknownToken', @@ -1496,24 +1821,21 @@ export const FC_X_CONTRACT_ABI = [ export const FC_NFT_CONTRACT_ABI = [ { type: 'constructor', - inputs: [ - { - name: '_owner', - type: 'address', - internalType: 'address', - }, - { - name: '_factsLitography', - type: 'address', - internalType: 'address', - }, + inputs: [], + stateMutability: 'nonpayable', + }, + { + type: 'function', + name: 'UPGRADE_INTERFACE_VERSION', + inputs: [], + outputs: [ { - name: '_baseTokenURI', + name: '', type: 'string', internalType: 'string', }, ], - stateMutability: 'nonpayable', + stateMutability: 'view', }, { type: 'function', @@ -1571,6 +1893,29 @@ export const FC_NFT_CONTRACT_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'initialize', + inputs: [ + { + name: '_owner', + type: 'address', + internalType: 'address', + }, + { + name: '_factsLitography', + type: 'address', + internalType: 'address', + }, + { + name: '_baseTokenURI', + type: 'string', + internalType: 'string', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', name: 'isApprovedForAll', @@ -1698,6 +2043,26 @@ export const FC_NFT_CONTRACT_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'proxiableUUID', + inputs: [], + outputs: [ + { + name: '', + type: 'bytes32', + internalType: 'bytes32', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'renounceOwnership', + inputs: [], + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', name: 'safeTransferFrom', @@ -1885,7 +2250,7 @@ export const FC_NFT_CONTRACT_ABI = [ name: 'transferOwnership', inputs: [ { - name: '_newOwner', + name: 'newOwner', type: 'address', internalType: 'address', }, @@ -1893,6 +2258,24 @@ export const FC_NFT_CONTRACT_ABI = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + name: 'upgradeToAndCall', + inputs: [ + { + name: 'newImplementation', + type: 'address', + internalType: 'address', + }, + { + name: 'data', + type: 'bytes', + internalType: 'bytes', + }, + ], + outputs: [], + stateMutability: 'payable', + }, { type: 'event', name: 'Approval', @@ -1975,6 +2358,19 @@ export const FC_NFT_CONTRACT_ABI = [ ], anonymous: false, }, + { + type: 'event', + name: 'Initialized', + inputs: [ + { + name: 'version', + type: 'uint64', + indexed: false, + internalType: 'uint64', + }, + ], + anonymous: false, + }, { type: 'event', name: 'MetadataUpdate', @@ -2032,6 +2428,46 @@ export const FC_NFT_CONTRACT_ABI = [ ], anonymous: false, }, + { + type: 'event', + name: 'Upgraded', + inputs: [ + { + name: 'implementation', + type: 'address', + indexed: true, + internalType: 'address', + }, + ], + anonymous: false, + }, + { + type: 'error', + name: 'AddressEmptyCode', + inputs: [ + { + name: 'target', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'ERC1967InvalidImplementation', + inputs: [ + { + name: 'implementation', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'ERC1967NonPayable', + inputs: [], + }, { type: 'error', name: 'ERC721IncorrectOwner', @@ -2137,21 +2573,63 @@ export const FC_NFT_CONTRACT_ABI = [ }, { type: 'error', - name: 'NotOwner', + name: 'FailedInnerCall', inputs: [], }, -]; - -export const FC_SFT_CONTRACT_ABI = [ { - type: 'constructor', + type: 'error', + name: 'InvalidInitialization', + inputs: [], + }, + { + type: 'error', + name: 'NotInitializing', + inputs: [], + }, + { + type: 'error', + name: 'OwnableInvalidOwner', inputs: [ { - name: '_owner', + name: 'owner', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'OwnableUnauthorizedAccount', + inputs: [ + { + name: 'account', type: 'address', internalType: 'address', }, ], + }, + { + type: 'error', + name: 'UUPSUnauthorizedCallContext', + inputs: [], + }, + { + type: 'error', + name: 'UUPSUnsupportedProxiableUUID', + inputs: [ + { + name: 'slot', + type: 'bytes32', + internalType: 'bytes32', + }, + ], + }, +]; + +export const FC_SFT_CONTRACT_ABI = [ + { + type: 'constructor', + inputs: [], stateMutability: 'nonpayable', }, { @@ -2180,6 +2658,19 @@ export const FC_SFT_CONTRACT_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'UPGRADE_INTERFACE_VERSION', + inputs: [], + outputs: [ + { + name: '', + type: 'string', + internalType: 'string', + }, + ], + stateMutability: 'view', + }, { type: 'function', name: 'balanceOf', @@ -2262,6 +2753,19 @@ export const FC_SFT_CONTRACT_ABI = [ ], stateMutability: 'nonpayable', }, + { + type: 'function', + name: 'initialize', + inputs: [ + { + name: '_owner', + type: 'address', + internalType: 'address', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', name: 'isApprovedForAll', @@ -2296,7 +2800,7 @@ export const FC_SFT_CONTRACT_ABI = [ internalType: 'uint256', }, { - name: 'value', + name: 'quantity', type: 'uint256', internalType: 'uint256', }, @@ -2330,6 +2834,39 @@ export const FC_SFT_CONTRACT_ABI = [ ], stateMutability: 'view', }, + { + type: 'function', + name: 'protocolReward', + inputs: [], + outputs: [ + { + name: '', + type: 'uint256', + internalType: 'uint256', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'proxiableUUID', + inputs: [], + outputs: [ + { + name: '', + type: 'bytes32', + internalType: 'bytes32', + }, + ], + stateMutability: 'view', + }, + { + type: 'function', + name: 'renounceOwnership', + inputs: [], + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', name: 'safeBatchTransferFrom', @@ -2440,6 +2977,19 @@ export const FC_SFT_CONTRACT_ABI = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + name: 'setProtocolReward', + inputs: [ + { + name: '_protocolReward', + type: 'uint256', + internalType: 'uint256', + }, + ], + outputs: [], + stateMutability: 'nonpayable', + }, { type: 'function', name: 'supply', @@ -2483,7 +3033,7 @@ export const FC_SFT_CONTRACT_ABI = [ name: 'transferOwnership', inputs: [ { - name: '_newOwner', + name: 'newOwner', type: 'address', internalType: 'address', }, @@ -2491,6 +3041,24 @@ export const FC_SFT_CONTRACT_ABI = [ outputs: [], stateMutability: 'nonpayable', }, + { + type: 'function', + name: 'upgradeToAndCall', + inputs: [ + { + name: 'newImplementation', + type: 'address', + internalType: 'address', + }, + { + name: 'data', + type: 'bytes', + internalType: 'bytes', + }, + ], + outputs: [], + stateMutability: 'payable', + }, { type: 'function', name: 'uri', @@ -2580,6 +3148,32 @@ export const FC_SFT_CONTRACT_ABI = [ ], anonymous: false, }, + { + type: 'event', + name: 'Initialized', + inputs: [ + { + name: 'version', + type: 'uint64', + indexed: false, + internalType: 'uint64', + }, + ], + anonymous: false, + }, + { + type: 'event', + name: 'MintPriceUpdated', + inputs: [ + { + name: 'newMintPrice', + type: 'uint256', + indexed: false, + internalType: 'uint256', + }, + ], + anonymous: false, + }, { type: 'event', name: 'OwnershipTransferred', @@ -2599,6 +3193,19 @@ export const FC_SFT_CONTRACT_ABI = [ ], anonymous: false, }, + { + type: 'event', + name: 'ProtocolRewardUpdated', + inputs: [ + { + name: 'newProtocolReward', + type: 'uint256', + indexed: false, + internalType: 'uint256', + }, + ], + anonymous: false, + }, { type: 'event', name: 'TransferBatch', @@ -2692,6 +3299,30 @@ export const FC_SFT_CONTRACT_ABI = [ ], anonymous: false, }, + { + type: 'event', + name: 'Upgraded', + inputs: [ + { + name: 'implementation', + type: 'address', + indexed: true, + internalType: 'address', + }, + ], + anonymous: false, + }, + { + type: 'error', + name: 'AddressEmptyCode', + inputs: [ + { + name: 'target', + type: 'address', + internalType: 'address', + }, + ], + }, { type: 'error', name: 'BadMintPrice', @@ -2799,11 +3430,37 @@ export const FC_SFT_CONTRACT_ABI = [ }, ], }, + { + type: 'error', + name: 'ERC1967InvalidImplementation', + inputs: [ + { + name: 'implementation', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'ERC1967NonPayable', + inputs: [], + }, + { + type: 'error', + name: 'FailedInnerCall', + inputs: [], + }, { type: 'error', name: 'FailedToReward', inputs: [], }, + { + type: 'error', + name: 'InvalidInitialization', + inputs: [], + }, { type: 'error', name: 'NegativeBalance', @@ -2811,7 +3468,34 @@ export const FC_SFT_CONTRACT_ABI = [ }, { type: 'error', - name: 'NotOwner', + name: 'NotInitializing', + inputs: [], + }, + { + type: 'error', + name: 'OwnableInvalidOwner', + inputs: [ + { + name: 'owner', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'OwnableUnauthorizedAccount', + inputs: [ + { + name: 'account', + type: 'address', + internalType: 'address', + }, + ], + }, + { + type: 'error', + name: 'ProtocolRewardTooHigh', inputs: [], }, { @@ -2824,6 +3508,22 @@ export const FC_SFT_CONTRACT_ABI = [ name: 'SupplyExhausted', inputs: [], }, + { + type: 'error', + name: 'UUPSUnauthorizedCallContext', + inputs: [], + }, + { + type: 'error', + name: 'UUPSUnsupportedProxiableUUID', + inputs: [ + { + name: 'slot', + type: 'bytes32', + internalType: 'bytes32', + }, + ], + }, { type: 'error', name: 'ValueError',