Skip to content

Commit

Permalink
fixed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Prabhat1308 committed Oct 2, 2023
1 parent ff696ae commit c951296
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 41 deletions.
24 changes: 12 additions & 12 deletions src/WRAPPER.huff
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#include './Complex.huff'

#define function addZ(int256 , int 256 , int256 , int256) returns (int256 ,int256)
#define function subZ(int256 , int 256 , int256 , int256) returns (int256 ,int256)
#define function mulZ(int256 , int 256 , int256 , int256) returns (int256 ,int256)
#define function divZ(int256 , int 256 , int256 , int256) returns (int256 ,int256)
#define function calcR(int256 , int 256, int256 , int256) returns (int256 ,int256)
#define function toPolar(int256 , int 256) returns (int256 ,int256)
#define function fromPolar(int256 , int 256) returns (int256 ,int256)
#define function p_atan2(int256 , int 256) returns (int256)
#define function addZ(int256 , int256 , int256 , int256) returns (int256 ,int256)
#define function subZ(int256 , int256 , int256 , int256) returns (int256 ,int256)
#define function mulZ(int256 , int256 , int256 , int256) returns (int256 ,int256)
#define function divZ(int256 , int256 , int256 , int256) returns (int256 ,int256)
#define function calcR(int256 , int256, int256 , int256) returns (int256 ,int256)
#define function toPolar(int256 , int256) returns (int256 ,int256)
#define function fromPolar(int256 , int256) returns (int256 ,int256)
#define function p_atan2(int256 , int256) returns (int256)
#define function atan1to1(int256 ) returns (int256)
#define function ln(int256 , int 256) returns (int256)
#define function sqrt(int256 , int 256) returns (int256)
#define function expZ(int256 , int 256) returns (int256 ,int256)
#define function pow(int256 , int 256 , int256) returns (int256 ,int256)
#define function ln(int256 , int256) returns (int256)
#define function sqrt(int256 , int256) returns (int256)
#define function expZ(int256 , int256) returns (int256 ,int256)
#define function pow(int256 , int256 , int256) returns (int256 ,int256)

#define macro MAIN() = takes (0) returns (0) {

Expand Down
74 changes: 74 additions & 0 deletions test/Complex.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.15;

import "foundry-huff/HuffDeployer.sol";
import "forge-std/Test.sol";
import "forge-std/console.sol";

contract ComplexTest is Test {
Complex public complex;

function setUp() public {
address com = HuffDeployer.deploy("Wrapper");
complex = Complex(com);
}

function testAddZ() public {
(int256 r, int256 i) = complex.addZ(1, 2, 3, 4);
assertEq(r, 3);
assertEq(i, 7);
}
}

interface Complex {
function addZ(
int256,
int256,
int256,
int256
) external returns (int256, int256);

function subZ(
int256,
int256,
int256,
int256
) external returns (int256, int256);

function mulZ(
int256,
int256,
int256,
int256
) external returns (int256, int256);

function divZ(
int256,
int256,
int256,
int256
) external returns (int256, int256);

function calcR(
int256,
int256,
int256,
int256
) external returns (int256, int256);

function toPolar(int256, int256) external returns (int256, int256);

function fromPolar(int256, int256) external returns (int256, int256);

function p_atan2(int256, int256) external returns (int256);

function atan1to1(int256) external returns (int256);

function ln(int256, int256) external returns (int256);

function sqrt(int256, int256) external returns (int256);

function expZ(int256, int256) external returns (int256, int256);

function pow(int256, int256, int256) external returns (int256, int256);
}
29 changes: 0 additions & 29 deletions test/SimpleStore.t.sol

This file was deleted.

0 comments on commit c951296

Please sign in to comment.