Skip to content

Instantly share code, notes, and snippets.

@mingderwang
Created April 8, 2024 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingderwang/d5591572b0a470bf71ff6869ad72bfc8 to your computer and use it in GitHub Desktop.
Save mingderwang/d5591572b0a470bf71ff6869ad72bfc8 to your computer and use it in GitHub Desktop.
from chatGPT
pragma solidity ^0.8.0;
contract ExampleContract {
struct PassKeyId {
uint256 pubKeyX;
uint256 pubKeyY;
string keyId;
}
// You can declare a variable of type PassKeyId
PassKeyId public passKey;
// Example function to set passKey values
function setPassKey(uint256 _pubKeyX, uint256 _pubKeyY, string memory _keyId) public {
passKey = PassKeyId(_pubKeyX, _pubKeyY, _keyId);
}
// Example function to get passKey values
function getPassKey() public view returns (uint256, uint256, string memory) {
return (passKey.pubKeyX, passKey.pubKeyY, passKey.keyId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment