Merge branch 'master' of https://github.com/ethereum/remix-project into desktope2e

pull/4837/head
filip mertens 8 months ago
commit 45edc00d0f
  1. 2
      apps/remix-ide-e2e/src/tests/etherscan_api.test.ts
  2. 2
      apps/vyper/src/app/app.tsx
  3. 12
      apps/vyper/src/app/components/VyperResult.tsx
  4. 20
      apps/vyper/src/app/utils/compiler.tsx
  5. 2
      apps/vyper/src/profile.json

@ -33,7 +33,7 @@ module.exports = {
.execute(() => {
(document.querySelector('*[data-id="basic-http-providerModalDialogContainer-react"] input[data-id="modalDialogCustomPromp"]') as any).focus()
}, [], () => {})
.setValue('[data-id="modalDialogCustomPromp"]', 'https://remix-goerli.ethdevops.io')
.setValue('[data-id="modalDialogCustomPromp"]', 'https://rpc.ankr.com/eth_goerli')
.modalFooterOKClick('basic-http-provider')
.clickLaunchIcon('solidity') // compile
.testContracts('Owner_1.sol', { content: verifiedContract }, ['Owner'])

@ -164,7 +164,7 @@ const App = () => {
<CompilerButton compilerUrl={compilerUrl()} contract={contract} setOutput={(name, update) => setOutput({...output, [name]: update})} resetCompilerState={resetCompilerResultState} />
</div>
<article id="result" className="p-4 mx-3 border-top mt-2">
<article id="result" className="p-2 mx-3 border-top mt-2">
{output && Object.keys(output).length > 0 && output.status !== 'failed' ? (
<>
<VyperResult output={output} plugin={remixClient} />

@ -67,17 +67,17 @@ function VyperResult({ output, plugin }: VyperResultProps) {
<div className="mt-1">
<div className="input-group input-group mt-3 d-flex flex-row-reverse">
<div className="btn-group align-self-start" role="group" aria-label="Copy to Clipboard">
<CopyToClipboard tip={'Copy ABI to clipboard'} getContent={() => (Object.values(output)[0] as OutputType).abi} direction="bottom" icon="far fa-copy">
<button className="btn remixui_copyButton">
<CopyToClipboard tip={'Copy ABI to clipboard'} getContent={() => (Object.values(output)[1] as OutputType)?.abi} direction="bottom" icon="far fa-copy">
<span className="btn remixui_copyButton">
<i className="remixui_copyIcon far fa-copy" aria-hidden="true"></i>
<span>ABI</span>
</button>
</span>
</CopyToClipboard>
<CopyToClipboard tip={'Copy Bytecode to clipboard'} getContent={() => (Object.values(output)[0] as OutputType).bytecode.object} direction="bottom" icon="far fa-copy">
<button className="btn remixui_copyButton">
<CopyToClipboard tip={'Copy Bytecode to clipboard'} getContent={() => (Object.values(output)[1] as OutputType)?.bytecode.object} direction="bottom" icon="far fa-copy">
<span className="btn remixui_copyButton">
<i className="remixui_copyIcon far fa-copy" aria-hidden="true"></i>
<span>Bytecode</span>
</button>
</span>
</CopyToClipboard>
</div>
</div>

@ -141,6 +141,22 @@ const compileReturnType = (output, contract) => {
return result
}
const fixContractContent = (content: string) => {
if (content.length === 0) return
const pragmaFound = content.includes('#pragma version ^0.3.10')
const evmVerFound = content.includes('#pragma evm-version shanghai')
const pragma = '#pragma version ^0.3.10'
const evmVer = '#pragma evm-version shanghai'
if (!evmVerFound) {
content = `${evmVer}\n${content}`
}
if (!pragmaFound) {
content = `${pragma}\n${content}`
}
return content
}
/**
* Compile the a contract
* @param url The url of the compiler
@ -155,11 +171,13 @@ export async function compile(url: string, contract: Contract): Promise<any> {
throw new Error('Use extension .vy for Vyper.')
}
let contractName = contract['name']
const compilePackage = {
manifest: 'ethpm/3',
sources: {
[contractName] : {content : contract.content}
[contractName] : {content : fixContractContent(contract.content)}
}
}
let response = await axios.post(`${url}compile`, compilePackage )

@ -3,7 +3,7 @@
"displayName": "Vyper Compiler",
"methods": ["getCompilationResult", "compile", "vyperCompileCustomAction"],
"url": "https://ipfs-cluster.ethdevops.io/ipfs/QmbmPzUg7ghTKcF2eo64zm1k1LKdibYfqYmiqXkHKXks8r",
"documentation": "https://remix-ide.readthedocs.io/en/latest/plugin_list.html",
"documentation": "https://remix-ide.readthedocs.io/en/latest/vyper.html",
"description": "Compile vyper contracts",
"kind": "compiler",
"icon": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzM4IiBoZWlnaHQ9IjM3NiIgdmlld0JveD0iMCAwIDMzOCAzNzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8v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