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

Add partner plugin #5158

Merged
merged 7 commits into from
Sep 16, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ export class TemplatesSelectionPlugin extends ViewPlugin {
id={item.name}
searchKeywords={[item.displayName, item.description, template.name]}
tagList={item.tagList}
classList='TSCellStyle'
classList={'TSCellStyle'}
>
<div className='d-flex justify-content-between h-100 flex-column'>
<div className='d-flex flex-column'>
<div>
{item.description && <span className='text-dark'>{item.description}</span>}
</div>
<div className='d-flex flex-wrap'>
<div className='d-flex flex-wrap mb-2'>
{(item.opts && item.opts.upgradeable && item.opts.upgradeable === 'uupds') && <span className='badgeForCell badge text-secondary'>Upgradeable-UUPS</span>}
{(item.opts && item.opts.mintable) && <span className='badgeForCell text-secondary'>mintable</span>}
{(item.opts && item.opts.burnable) && <span className='badgeForCell text-secondary'>burnable</span>}
Expand Down
59 changes: 47 additions & 12 deletions apps/remix-ide/src/app/plugins/templates-selection/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,53 @@ export const templates = (intl, plugin) => {
onClickLabel: 'Open Cookbook Plugin',
description: 'Discover more templates!',
items: [
{ value: "token-sale", displayName: 'Token Sale' },
{ value: "simple-nft-sale", displayName: 'Simple Nft Sale' },
{ value: "Azuki-ERC721A-NFT-Sale-basic", displayName: 'Azuki ERC721A NFT Sale basic' },
{ value: "Azuki-ERC721A-ERC721A", displayName: 'Azuki ERC721A' },
{ value: "token-staking-with-infinite-rewards", displayName: 'Token Staking with infinite rewards' },
{ value: "nft-staking-with-infinite-rewards", displayName: 'Nft Staking with infinite rewards' },
{ value: "basic-dao", displayName: 'Basic DAO' },
{ value: "soulbound-nft", displayName: 'Soulbound Nft' },
{ value: "multi-collection-nft-with-burnable-nfts-and-pausable-transfers", displayName: 'Multi collection NFT', description: "Multi collection NFT with:", opts: {
burnable: true,
pausable: true
}, },
{
value: "token-sale",
displayName: 'Token Sale',
description: "ERC20 token sale contact. Sell tokens for ETH"
},
{
value: "simple-nft-sale",
displayName: 'Simple Nft Sale',
description: "ERC721 NFT with an adjustable price & to mint free NFTs"
},
{
value: "Azuki-ERC721A-NFT-Sale-basic",
displayName: 'Azuki ERC721A NFT Sale basic',
description: "An implementation of the ERC721A standard"
},
{
value: "Azuki-ERC721A-NFT-Sale",
displayName: 'Azuki ERC721A NFT Sale',
description: "An extension of the ERC721A standard with wallet limit"
},
{
value: "token-staking-with-infinite-rewards",
displayName: 'Token Staking with infinite rewards',
description: "Token staking contract to reward ERC20 tokens for every token staked"
},
{
value: "nft-staking-with-infinite-rewards",
displayName: 'NFT Staking with infinite rewards',
description: "NFT staking contract to reward exact number of ERC20 tokens per day"
},
{
value: "basic-dao",
displayName: 'Basic DAO',
description: "A very simple implementation of a DAO"
},
{
value: "soulbound-nft",
displayName: 'Soulbound NFT',
description: "ERC721 Soulbound NFT with no transfer capability"
},
{ value: "multi-collection-nft-with-burnable-nfts-and-pausable-transfers",
displayName: 'Multi collection NFT',
description: "Multi collection NFT with:",
opts: {
burnable: true,
pausable: true
}, },
]
},
{
Expand Down
7 changes: 7 additions & 0 deletions apps/remix-ide/src/remixAppManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const dependentModules = ['foundry', 'hardhat', 'truffle', 'slither']

const loadLocalPlugins = ['doc-gen', 'doc-viewer', 'etherscan', 'vyper', 'solhint', 'walletconnect', 'circuit-compiler', 'learneth', 'quick-dapp']

const partnerPlugins = ['cookbookdev']

const sensitiveCalls = {
fileManager: ['writeFile', 'copyFile', 'rename', 'copyDir'],
contentImport: ['resolveAndSave'],
Expand Down Expand Up @@ -206,6 +208,11 @@ export class RemixAppManager extends PluginManager {
return true
}

// skipping partner plugins' requests
if (partnerPlugins[from]) {
return true
}

// ask the user for permission
return await this.call('permissionhandler', 'askPermission', this.profiles[from], this.profiles[to], method, message, isSensitiveCall)
}
Expand Down
30 changes: 30 additions & 0 deletions libs/remix-ui/workspace/src/lib/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,36 @@ export const TEMPLATE_METADATA: Record<string, TemplateType> = {
name: 'cookbookdev',
endpoint: 'openContract',
params: ['multi-collection-nft-with-burnable-nfts-and-pausable-transfers']
},
'OpenSea-Seaport': {
type: 'plugin',
name: 'cookbookdev',
endpoint: 'openProtocol',
params: ['OpenSea-Seaport']
},
'Ethereum-Name-Service': {
type: 'plugin',
name: 'cookbookdev',
endpoint: 'openProtocol',
params: ['Ethereum-Name-Service']
},
'Umbra-Cash': {
type: 'plugin',
name: 'cookbookdev',
endpoint: 'openProtocol',
params: ['Umbra-Cash']
},
'Aave-V3': {
type: 'plugin',
name: 'cookbookdev',
endpoint: 'openProtocol',
params: ['Aave-V3']
},
'ChainLink': {
type: 'plugin',
name: 'cookbookdev',
endpoint: 'openProtocol',
params: ['ChainLink']
}
}

Expand Down
Loading