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 version >0.3.10 | |
# Blind Auction. Adapted to Vyper from [Solidity by Example](https://github.com/ethereum/solidity/blob/develop/docs/solidity-by-example.rst#blind-auction-1) | |
struct Bid: | |
blindedBid: bytes32 | |
deposit: uint256 | |
gg | |
# Note: because Vyper does not allow for dynamic arrays, we have limited the | |
# number of bids that can be placed by one address to 128 in this example |
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
{ | |
"manifest": "ethpm/3", | |
"name": null, | |
"version": null, | |
"meta": null, | |
"sources": { | |
"examples/factory/Exchange.vy": { | |
"urls": [], | |
"checksum": null, | |
"content": "#pragma version >0.3.10\n\nfrom ethereum.ercs import IERC20\n\n\ninterface Factory:\n def register(): nonpayable\n\n\ntoken: public(IERC20)\nfactory: Factory\n\n\n@deploy\ndef __init__(_token: IERC20, _factory: Factory):\n self.token = _token\n self.factory = _factory\n\n\n@external\ndef initialize():\n # Anyone can safely call this function because of EXTCODEHASH\n extcall self.factory.register()\n\n\n# NOTE: This contract restricts trading to only be done by the factory.\n# A practical implementation would probably want counter-pairs\n# and liquidity management features for each exchange pool.\n\n\n@external\ndef receive(_from: address, _amt: uint256):\n assert msg.sender == self.factory.address\n success: bool = extcall self.token.transferFrom(_from, self |
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.2 <0.9.0; | |
/** | |
* @title Storage | |
* @dev Store & retrieve value in a variable | |
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts | |
*/ | |
contract Storage { |
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.2 <0.9.0; | |
/** | |
* @title Storage | |
* @dev Store & retrieve value in a variable | |
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts | |
*/ | |
contract Storage { |
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
// eslint-disable-next-line @typescript-eslint/no-var-requires | |
const snarkjs = require('snarkjs'); | |
const logger = { | |
info: (...args) => console.log(...args), | |
debug: (...args) => console.log(...args) | |
}; | |
(async () => { | |
try { |
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
// eslint-disable-next-line @typescript-eslint/no-var-requires | |
const snarkjs = require('snarkjs'); | |
const logger = { | |
info: (...args) => console.log(...args), | |
debug: (...args) => console.log(...args) | |
}; | |
(async () => { | |
try { |
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 circom 2.0.0; | |
include "./poseidon_constants.circom"; | |
template Sigma() { | |
signal input in; | |
signal output out; | |
signal in2; | |
signal in4; |
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 circom 2.0.0; | |
include "./poseidon_constants.circom"; | |
template Sigma() { | |
signal input in; | |
signal output out; | |
signal in2; | |
signal in4; |
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 circom 2.0.0; | |
include "./poseidon_constants.circom"; | |
template Sigma() { | |
signal input in; | |
signal output out; | |
signal in2; | |
signal in4; |
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 circom 2.0.0; | |
include "./poseidon_constants.circom"; | |
template Sigma() { | |
signal input in; | |
signal output out; | |
signal in2; | |
signal in4; |
NewerOlder