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
require(saleActive, "TalentCommunitySale: Sale is not active"); | |
require( | |
paymentToken.allowance(msg.sender, address(this)) >= 100 * 10**tokenDecimals, | |
"TalentCommunitySale: Insufficient allowance" | |
); | |
require(tier1Bought < TIER1_MAX_BUYS, "TalentCommunitySale: Tier 1 sold out"); | |
require(!listOfBuyers[msg.sender], "TalentCommunitySale: Address already bought"); | |
require(paymentToken.transferFrom(msg.sender, receivingWallet, 100 * 10**tokenDecimals), "Transfer failed"); |
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
/* | |
This script lists the Farcaster client apps that a Farcaster account has | |
registered as client apps. Farcaster apps are _account keys_ registered | |
on-chain, in Optimism. We are using KeyRegistry contract to read the | |
number and keys of an FID. | |
*/ | |
import { ethers } from "hardhat"; | |
import loadContractAbi from "./loadContractAbi"; | |
const KEY_REGISTRY_CONTRACT_ADDRESS = |
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
[ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "_idRegistry", | |
"type": "address" | |
}, | |
{ | |
"internalType": "address", |
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
import { HardhatUserConfig, vars } from "hardhat/config"; | |
import "@nomicfoundation/hardhat-toolbox"; | |
const ALCHEMY_API_KEY = vars.get("ALCHEMY_API_KEY"); | |
const ACCOUNT_PRIVATE_KEY = vars.get("ACCOUNT_PRIVATE_KEY") | |
const config: HardhatUserConfig = { | |
solidity: "0.8.24", | |
networks: { | |
optimism: { |
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
// Load dependencies | |
const { expect } = require("chai"); | |
require("@nomiclabs/hardhat-ethers"); | |
require("@nomicfoundation/hardhat-chai-matchers"); | |
// Start test block | |
describe("Box", function () { | |
const value = 42n; |
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 | |
pragma solidity 0.8.22; | |
// Requirements: | |
// | |
// - We want only the creator to create coins. | |
// - Anyone can send coins to each other without a need for registering with a username and password. | |
// All we need is an Ethereum keypair. | |
// | |
contract Coin { |
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
content_path = Rails.root.join('secret_content_file.txt.enc') | |
encrypted_file = ActiveSupport::EncryptedFile.new( | |
content_path: content_path, | |
key_path: Rails.application.config.credentials.key_path, | |
env_key: "RAILS_MASTER_KEY", | |
raise_if_missing_key: true | |
) | |
contents = encrypted_file.read |
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
content_path = Rails.root.join('secret_content_file.txt') | |
encrypted_file = ActiveSupport::EncryptedFile.new( | |
content_path: "#{content_path}.enc", | |
key_path: Rails.application.config.credentials.key_path, | |
env_key: "RAILS_MASTER_KEY", | |
raise_if_missing_key: true | |
) | |
contents = File.read(content_path) |
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
resource "aws_route_table" "to_nat_gateway" { | |
vpc_id = aws_vpc.private_and_public_subnets.id | |
tags = { | |
"Name" = "access-to-nat-gateway" | |
} | |
} | |
resource "aws_route" "to_nat_gateway" { | |
route_table_id = aws_route_table.to_nat_gateway.id |
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
resource "aws_eip" "nat_gateway" { | |
depends_on = [aws_internet_gateway.private_and_public_subnets] | |
} | |
resource "aws_nat_gateway" "private_and_public_subnets" { | |
connectivity_type = "public" | |
allocation_id = aws_eip.nat_gateway.id | |
subnet_id = aws_subnet.subnet_2.id # public subnet | |
tags = { |
NewerOlder