mirror of
https://github.com/fluencelabs/lazy-snark
synced 2025-06-12 22:41:26 +00:00
test solidity-zokratos integration
This commit is contained in:
23
truffle/contracts/VerifierProxy.sol
Normal file
23
truffle/contracts/VerifierProxy.sol
Normal file
@ -0,0 +1,23 @@
|
||||
pragma solidity ^0.5.4;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import "./Structs.sol";
|
||||
import "./verifier.sol";
|
||||
|
||||
|
||||
contract VerifierProxy is Structs {
|
||||
Verifier internal verifier;
|
||||
|
||||
constructor(Verifier ver) public {
|
||||
verifier = ver;
|
||||
}
|
||||
|
||||
// Truffle gives `UnimplementedFeatureError: Encoding struct from calldata is not yet supported.`
|
||||
// that's why function is public and uses memory location modifier
|
||||
function isValid(Data memory data, Proof memory proof) public returns (bool) {
|
||||
bytes memory payload = abi.encodeWithSelector(verifier.verifyTx.selector, proof, data);
|
||||
(bool success, bytes memory r) = address(verifier).call(payload);
|
||||
require(success);
|
||||
return abi.decode(r, (bool));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user