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
// just | |
npm install -g @nrwl/cli@latest | |
npm install -g lerna@latest | |
// or even | |
rm -rf node_modules package-lock.json | |
npm install |
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
pragma solidity ^0.8.0; | |
contract ExampleContract { | |
struct PassKeyId { | |
uint256 pubKeyX; | |
uint256 pubKeyY; | |
string keyId; | |
} | |
// You can declare a variable of type PassKeyId |
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
/* solhint-disable */ | |
// SPDX-License-Identifier: MIT | |
// from OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol) | |
pragma solidity ^0.8.19; | |
/** | |
* @dev Provides a set of functions to operate with Base64 strings. | |
* | |
* _Available since v4.5._ |
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.8.17; | |
// | |
// Heavily inspired from | |
// https://github.com/maxrobot/elliptic-solidity/blob/master/contracts/Secp256r1.sol | |
// https://github.com/tdrerup/elliptic-curve-solidity/blob/master/contracts/curves/EllipticCurve.sol | |
// modified to use precompile 0x05 modexp | |
// and modified jacobian double | |
// optimisations to avoid to an from from affine and jacobian coordinates | |
// |
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
odules/babel-loader/lib/index.js:51:103 { | |
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], | |
library: 'digital envelope routines', | |
reason: 'unsupported', | |
code: 'ERR_OSSL_EVP_UNSUPPORTED' | |
} |
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: MIT | |
// compiler version must be greater than or equal to 0.8.24 and less than 0.9.0 | |
pragma solidity ^0.8.24; | |
contract HelloWorld { | |
string public greet = "Hello World!"; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Web Authentication Example</title> | |
</head> | |
<body> | |
<script> |
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
exports.endpoint = (req, res) => { | |
const html = ` | |
<!-- Example 1: Preact in HTML (no build tooling required!) --> | |
<!-- View Code: https://glitch.com/edit/#!/familiar-warm-monday --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
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: AGPL-3.0-only | |
pragma solidity ^0.8.7; | |
contract Timestamp { | |
uint public timestamp; | |
function saveTimestamp() public { | |
timestamp = block.timestamp; | |
} | |
} |
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
const { ethers } = require("ethers"); | |
const encoder = (types, values) => { | |
const abiCoder = ethers.utils.defaultAbiCoder; | |
const encodedParams = abiCoder.encode(types, values); | |
return encodedParams.slice(2); | |
}; | |
const create2Address = (factoryAddress, saltHex, initCode) => { | |
const create2Addr = ethers.utils.getCreate2Address(factoryAddress, saltHex, ethers.utils.keccak256(initCode)); |
NewerOlder