// SPDX-License-Identifier: AGPL-3.0-or-later | |
// The ABI encoder is necessary, but older Solidity versions should work | |
pragma solidity ^0.7.0; | |
pragma experimental ABIEncoderV2; | |
// These definitions are taken from across multiple dydx contracts, and are | |
// limited to just the bare minimum necessary to make flash loans work. | |
library Types { | |
enum AssetDenomination { Wei, Par } |
const { expect } = require("chai"); | |
describe("NFTOptions", function () { | |
const penguAddr = "0xBd3531dA5CF5857e7CfAA92426877b022e612cf8"; | |
const penguOwner = "0x2c2c2F6DBe08942280d4F7626b6BAd5C11D20215"; | |
const ids = ["2036", "4205"]; | |
const buyer = "0xe5ee2B9d5320f2D1492e16567F36b578372B3d9F"; | |
const erc721Abi = [ | |
"function approve(address to, uint256 tokenId)" |
I'm a Rust newbie, and one of the things that I've found frustrating is that the default docker build
experience is extremely slow. As it downloads crates, then dependencies, then finally my app - I often get distracted, start doing something else, then come back several minutes later and forget what I was doing
Recently, I had the idea to make it a little better by combining multistage builds with some of the amazing features from BuildKit. Specifically, cache mounts, which let a build container cache directories for compilers & package managers. Here's a quick annotated before & after from a real app I encountered.
This is a standard enough multistage Dockerfile. Nothing seemingly terrible or great here - just a normal build stage, and a smaller runtime stage.
use anchor_lang::prelude::*; | |
declare_id!("8yBiqm4eZjDQACD5JnZrvoKB6nyE9xDh3yvMiPnWtTpL"); | |
#[program] | |
pub mod multi_state_account_example { | |
use super::*; | |
pub fn create_many_faced_account_first_state(ctx: Context<CreateManyFacedAccount>, _account_bump:u8, first_hi1_to_add:u64, first_hi2_to_add:u32) -> ProgramResult { | |
let new_state = State::FirstState { |