Closed andresaiello closed 5 months ago
Would we be able to use the consumer on ZetaChain the same way as on Ethereum, for example?
Would this work on ZetaChain?
import "@zetachain/protocol-contracts/contracts/evm/interfaces/ZetaInterfaces.sol";
contract CrossChainMessage is ZetaInteractor, ZetaReceiver {
ZetaTokenConsumer private immutable _zetaConsumer;
constructor(address connectorAddress, address zetaTokenAddress, address zetaConsumerAddress) ZetaInteractor(connectorAddress) {
_zetaToken = IERC20(zetaTokenAddress);
_zetaConsumer = ZetaTokenConsumer(zetaConsumerAddress);
}
function sendMessage(uint256 destinationChainId, string memory message) external payable {
uint256 crossChainGas = 2 * (10 ** 18);
uint256 zetaValueAndGas = _zetaConsumer.getZetaFromEth{
value: msg.value
}(address(this), crossChainGas);
_zetaToken.approve(address(connector), zetaValueAndGas);
connector.send(...)
}
//...
}
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
Package | New capabilities | Transitives | Size | Publisher |
---|---|---|---|---|
npm/buffer-from@1.1.2 | None | 0 |
5.05 kB | linusu |
npm/deep-is@0.1.4 | None | 0 |
8.11 kB | thlorenz |
npm/fast-levenshtein@2.0.6 | None | 0 |
9.44 kB | hiddentao |
npm/get-caller-file@2.0.5 | None | 0 |
4.72 kB | stefanpenner |
npm/has-bigints@1.0.2 | None | 0 |
12.8 kB | ljharb |
npm/util-deprecate@1.0.2 | None | 0 |
5.48 kB | tootallnate |
🚮 Removed packages: npm/abstract-leveldown@6.3.0, npm/diff@3.5.0, npm/level-concat-iterator@2.0.1, npm/level-errors@2.0.1, npm/string-width@2.1.1, npm/yargs@13.3.2
Would we be able to use the consumer on ZetaChain the same way as on Ethereum, for example?
Would this work on ZetaChain?
import "@zetachain/protocol-contracts/contracts/evm/interfaces/ZetaInterfaces.sol"; contract CrossChainMessage is ZetaInteractor, ZetaReceiver { ZetaTokenConsumer private immutable _zetaConsumer; constructor(address connectorAddress, address zetaTokenAddress, address zetaConsumerAddress) ZetaInteractor(connectorAddress) { _zetaToken = IERC20(zetaTokenAddress); _zetaConsumer = ZetaTokenConsumer(zetaConsumerAddress); } function sendMessage(uint256 destinationChainId, string memory message) external payable { uint256 crossChainGas = 2 * (10 ** 18); uint256 zetaValueAndGas = _zetaConsumer.getZetaFromEth{ value: msg.value }(address(this), crossChainGas); _zetaToken.approve(address(connector), zetaValueAndGas); connector.send(...) } //... }
it should
Summary