Skip to content

Instantly share code, notes, and snippets.

@anilhelvaci
anilhelvaci / README.md
Last active February 20, 2024 11:56
Mutate Exo Class Stete

Mutating Exo Class State

I'm confused about how to mutate the state of an exo class. The test above reproduces the prpblem I'm facing. The part that confuses me the most is that we're able to mutate the state object in contracts like vaultManager. The reason why I'm vaultManager confuses me is that zone API and prepareExoClassKit(what vaultManager uses) use the same code underneeth, as far as I know. Could use a clarification here.

@anilhelvaci
anilhelvaci / test_config.toml
Created November 30, 2023 15:50
Hermes Experiments
[global]
log_level = "trace"
[mode.clients]
enabled = true
refresh = true
misbehaviour = true
[mode.connections]
enabled = false
@anilhelvaci
anilhelvaci / anilAssignment4.js
Last active May 18, 2023 15:58
Chainboard x Agoric Bootcamp: Assignment 4 Contract Rewrite
import { AmountMath, AssetKind } from '@agoric/ertp';
import { E } from '@endo/eventual-send';
import { offerTo } from '@agoric/zoe/src/contractSupport/zoeHelpers.js';
import { Far } from '@endo/marshal';
// Define NFts supply
const DEFINED_NFTS = harden([
{
id: 1n,
name: 'NFT 1',
@anilhelvaci
anilhelvaci / moveFromCentralPriceUp.js
Created September 5, 2022 23:26
This code snippet shows how to push a price up in native Agoric AMM
export const moveFromCentralPriceUp = async (zoe,
ammPublicFacet,
secondaryR,
centralR,
liquidityIssuer,
upperBoundry,
swapInterval = 1n) => {
const {
swapSecondaryForCentral,
makeCentral,
cli.peer1.Org1.com:
container_name: cli.peer1.Org1.com
image: hyperledger/fabric-tools:2.3
tty: true
environment:
- CORE_PEER_LOCALMSPID=Org1
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer1.Org1.com:8054
- FABRIC_CFG_PATH=/tmp/hyperledger
peer1.Org1.com.couchdb:
container_name: peer1.Org1.com.couchdb
image: hyperledger/fabric-couchdb
environment:
- COUCHDB_USER=dbadmin
- COUCHDB_PASSWORD=dbadminpw
ports:
- 5984
networks:
echo "---------- Fetching the genesis block of testchannel and joining peer1.Org1.com ----------"
export CORE_PEER_LOCALMSPID=Org1
export CORE_PEER_ID=cli
export CORE_PEER_ADDRESS=0.0.0.0:8054
export FABRIC_CFG_PATH=$PWD
export ORDERER_TLS_CA=$PWD/orderingservice/client/tls-ca-cert.pem
export CORE_PEER_TLS_ROOTCERT_FILE=$PWD/Org1/client/tls-ca-cert.pem
export CORE_PEER_MSPCONFIGPATH=$PWD/Org1/client/org-ca/orgadmin/msp/
export CORE_PEER_TLS_ENABLED=true
echo "---------- Creating and joining orderer1 to the testchannel ----------"
export ORDERER_TLS_CA=$PWD/orderingservice/client/tls-ca-cert.pem
export ORDERER_ADMIN_CERT=$PWD/orderingservice/orderer1/adminclient/client-tls-cert.pem
export ORDERER_ADMIN_KEY=$PWD/orderingservice/orderer1/adminclient/client-tls-key.pem
export ORDERDER_ADMIN_ADDRESS=0.0.0.0:7051
osnadmin channel join --channelID testchannel --config-block testchannel.genesis_block.pb -o $ORDERDER_ADMIN_ADDRESS --ca-file $ORDERER_TLS_CA --client-cert $ORDERER_ADMIN_CERT --client-key $ORDERER_ADMIN_KEY
echo "---------- Creating testchannel genesis block ----------"
export FABRIC_CFG_PATH=$PWD/
configtxgen -profile SampleNew -outputBlock testchannel.genesis_block.pb -channelID testchannel
SampleNew:
<<: *ChannelDefaults
Orderer:
<<: *OrdererDefaults
Organizations:
- *orderingservice
Capabilities:
<<: *OrdererCapabilities
Application:
<<: *ApplicationDefaults