Last active
January 30, 2023 15:54
-
-
Save Neurone/d031cdc622681dcc22e9b8814ebbbade to your computer and use it in GitHub Desktop.
Load this file in the Remix-IDE using this link https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=d031cdc622681dcc22e9b8814ebbbade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract EIP_196_197 { | |
// After calling testAdd() output variable cointains these values: | |
// - output[0] == 0x030644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd3 | |
// - output[1] == 0x15ed738c0e0a7c92e7845f96b2ae9c0a68a6a449e3538fc7ff3ebf7a5a18a2c4 | |
uint256[2] public output; | |
function testAdd() public returns (bool success, uint256[2] memory _output){ | |
uint256[4] memory input; | |
input[0] = 1; | |
input[1] = 2; | |
input[2] = 1; | |
input[3] = 2; | |
assembly { | |
// Address 0x6 == ecAdd | |
success := staticcall(sub(gas(), 2000), 0x6, input, 128, _output, 64) | |
} | |
output = _output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment