简体   繁体   English

从我的智能合约中调用已部署的智能合约的功能

[英]Call function of a already deployed smart contract from within my smart contract

i want to call the openTrade() function of this smart contract https://polygonscan.com/address/0xd8D177EFc926A18EE455da6F5f6A6CfCeE5F8f58#code (starts at line 371) from within my smart contract.我想从我的智能合约中调用此智能合约的 openTrade() 函数https://polygonscan.com/address/0xd8D177EFc926A18EE455da6F5f6A6CfCeE5F8f58#code (从第 371 行开始)。

I have read about the ABI but this does not seem to work.我已阅读有关 ABI 的信息,但这似乎不起作用。 What steps do i need to take ?我需要采取哪些步骤? Copy paste the whole smart contract into my visual studio code and import it into my contract?将整个智能合约复制粘贴到我的 Visual Studio 代码中并将其导入我的合约中?

How can i just call this specific function ?我怎样才能调用这个特定的函数?

Thank you so much guys !十分感谢大家 !

This is the decription of the function you want to call:这是您要调用的函数的说明:

  function openTrade(...) external notContract notDone { ... }

As you can see there is notContract modifier applied to this function.如您所见,此函数应用了notContract修饰符。 An this is implementation of the modifier:这是修饰符的实现:

modifier notContract(){ require(tx.origin == msg.sender); _; }

It means that openTrade function can not be called from the other contracts.这意味着不能从其他合约调用openTrade函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过javascript(web3.js)从部署的智能合约中调用特定的solidity函数 - Call specific solidity function from deployed smart contract within react through javascript (web3.js) 执行智能合约功能 - execute a smart contract function 如何在使用 infura 部署在 ropsten 测试网上的智能合约中调用 setter 函数 - How to call a setter function in a smart contract which is deployed on ropsten testnet using infura web3.js调用智能合约函数无响应 - Call smart contract function by web3.js without response 通过 web3.js 调用和访问智能合约功能? - Call and access smart contract function through web3.js? 如何从 Web 应用程序签署和调用锚 (solana) 智能合约 - How to Sign and call anchor (solana) smart contract from web app 是否可以从特定帐户在我的前端运行我的 Solidity 智能合约 function - Is it possible to run my Solidity Smart Contract function on my frontend from a specific account Solidity:从我的智能合约中显示价值以做出反应的问题 - Solidity : Problem to display value from my smart contract to react 如何从 Javascript 向 Solidity 智能合约 function 输入数据? - How to input data to a solidity smart contract function from Javascript? 如何使用 wagmi 智能合约中的重载 function? - How to use overloaded function from smart contract with wagmi?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM