This file contains hidden or 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 | |
| pragma solidity ^0.8.0; | |
| import "./proxy/Proxiable.sol"; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
| import "@openzeppelin/contracts/utils/Counters.sol"; | |
| import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
| contract SurveysV2 { |
This file contains hidden or 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
| contract BidderTwo { | |
| uint256 highestBid; | |
| address currentHighestBidder; | |
| mapping(address => uint) bidBalances; | |
| function bid() external payable { | |
| require(msg.value > highestBid, "Bid higher"); | |
| bidBalances[msg.sender] += msg.value; | |
| highestBid = msg.value; | |
| currentHighestBidder = msg.sender; | |
| } |
This file contains hidden or 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 | |
| pragma solidity ^0.8.7; | |
| contract Bidder { | |
| uint256 highestBid; | |
| address currentHighestBidder; | |
| function bid() external payable { | |
| require(msg.value > highestBid, "Bid higher"); | |
| require(payable(currentHighestBidder).transfer(highestBid)); // ensure the bid is sent back, else revert the transaction | |
| highestBid = msg.value; | |
| currentHighestBidder = msg.sender; |
This file contains hidden or 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 | |
| pragma solidity ^0.8.0; | |
| contract rejectContracts { | |
| function isContract(address account) public view returns (bool) { | |
| uint256 size; | |
| assembly { | |
| size := extcodesize(account) | |
| } | |
| return size > 0; | |
| } |
This file contains hidden or 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 | |
| pragma solidity ^0.8.0; | |
| contract rejectContracts { | |
| function isContract(address account) public view returns (bool) { | |
| uint256 size; | |
| assembly { | |
| size := extcodesize(account) | |
| } | |
| return size > 0; |
This file contains hidden or 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
| import axios from "axios"; | |
| let myContract; | |
| let init = async () => { | |
| await ethStore.setProvider("https://api.avax-test.network/ext/bc/C/rpc"); | |
| await ethStore.setBrowserProvider(); | |
| let contract = await new $web3.eth.Contract(abi, contractAddress); | |
| if ($chainId != 43113) { | |
| alert("Warning: You are not connected to Avalanche Fuji test-net!"); | |
| } |
This file contains hidden or 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
| require("@nomiclabs/hardhat-waffle"); | |
| require("@nomiclabs/hardhat-ethers"); | |
| // This is a sample Hardhat task. To learn how to create your own go to | |
| // https://hardhat.org/guides/create-task.html | |
| task("accounts", "Prints the list of accounts", async () => { | |
| const accounts = await ethers.getSigners(); | |
| for (const account of accounts) { | |
| console.log(account.address); |
This file contains hidden or 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
| let animal = { | |
| name:"cat", | |
| type:"mammal", | |
| color:"black", | |
| class:'carnivorous', | |
| gender:'female', | |
| legs:{ |
This file contains hidden or 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 | |
| pragma solidity ^0.8.0; | |
| import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
| contract Swapper{ | |
| struct Order{ | |
| address ofSwaper; |
This file contains hidden or 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: UNLICENSED | |
| pragma solidity ^0.8.0; | |
| contract MultiSig { | |
| ///A contract that allows 70% of validSigner to Approve before a withdrawal can be succesful | |
| address[] validSigner; | |
| uint256 ID = 1; | |
| uint256 public Quorum = 3; | |
| //maping of trnsaction Id to number of approval to status |