Skip to content

Commit

Permalink
Fixed runtime issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BlobMaster41 committed Dec 12, 2024
1 parent dfac7b3 commit 3cd1fe2
Show file tree
Hide file tree
Showing 48 changed files with 489 additions and 441 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@btc-vision/btc-runtime",
"version": "1.3.14",
"version": "1.3.15",
"description": "Bitcoin Smart Contract Runtime",
"main": "btc/index.ts",
"scripts": {
Expand Down Expand Up @@ -43,8 +43,8 @@
],
"dependencies": {
"@assemblyscript/loader": "^0.27.30",
"@btc-vision/as-bignum": "^0.0.2",
"@eslint/js": "^9.10.0",
"as-bignum": "^0.3.1",
"gulplog": "^2.2.0",
"mocha": "^10.7.3",
"ts-node": "^10.9.2",
Expand Down
2 changes: 1 addition & 1 deletion runtime/buffer/BytesReader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Address, ADDRESS_BYTE_LENGTH } from '../types/Address';
import { Selector } from '../math/abi';
import { i128, u128, u256 } from 'as-bignum/assembly';
import { i128, u128, u256 } from '@btc-vision/as-bignum/assembly';
import { Revert } from '../types/Revert';
import { TransactionInput, TransactionOutput } from '../env/classes/UTXO';
import { i256 } from '../math/i256';
Expand Down
2 changes: 1 addition & 1 deletion runtime/buffer/BytesWriter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { i128, u128, u256 } from 'as-bignum/assembly';
import { i128, u128, u256 } from '@btc-vision/as-bignum/assembly';
import { Address, ADDRESS_BYTE_LENGTH } from '../types/Address';
import { Selector } from '../math/abi';
import { BytesReader } from './BytesReader';
Expand Down
2 changes: 1 addition & 1 deletion runtime/contracts/DeployableOP_20.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { BytesWriter } from '../buffer/BytesWriter';
import { Blockchain } from '../env';
import { ApproveEvent, BurnEvent, MintEvent, TransferEvent } from '../events/predefined';
Expand Down
2 changes: 1 addition & 1 deletion runtime/contracts/OP_20.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DeployableOP_20 } from './DeployableOP_20';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { OP20InitParameters } from './interfaces/OP20InitParameters';

export abstract class OP_20 extends DeployableOP_20 {
Expand Down
2 changes: 1 addition & 1 deletion runtime/contracts/interfaces/OP20InitParameters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';

export class OP20InitParameters {
readonly maxSupply: u256;
Expand Down
2 changes: 1 addition & 1 deletion runtime/env/BlockchainEnvironment.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Address, ADDRESS_BYTE_LENGTH } from '../types/Address';
import { MemorySlotPointer } from '../memory/MemorySlotPointer';
import { MemorySlotData } from '../memory/MemorySlot';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { BytesReader } from '../buffer/BytesReader';
import { BytesWriter } from '../buffer/BytesWriter';
import { NetEvent } from '../events/NetEvent';
Expand Down
2 changes: 1 addition & 1 deletion runtime/env/classes/Block.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';

@final
export class Block {
Expand Down
2 changes: 1 addition & 1 deletion runtime/events/predefined/ApproveEvent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { Address, ADDRESS_BYTE_LENGTH } from '../../types/Address';
import { NetEvent } from '../NetEvent';
import { BytesWriter } from '../../buffer/BytesWriter';
Expand Down
2 changes: 1 addition & 1 deletion runtime/events/predefined/BurnEvent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { NetEvent } from '../NetEvent';
import { BytesWriter } from '../../buffer/BytesWriter';

Expand Down
2 changes: 1 addition & 1 deletion runtime/events/predefined/ClaimEvent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { NetEvent } from '../NetEvent';
import { BytesWriter } from '../../buffer/BytesWriter';

Expand Down
2 changes: 1 addition & 1 deletion runtime/events/predefined/MintEvent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { NetEvent } from '../NetEvent';
import { BytesWriter } from '../../buffer/BytesWriter';
import { Address, ADDRESS_BYTE_LENGTH } from '../../types/Address';
Expand Down
2 changes: 1 addition & 1 deletion runtime/events/predefined/StakeEvent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { NetEvent } from '../NetEvent';
import { BytesWriter } from '../../buffer/BytesWriter';

Expand Down
2 changes: 1 addition & 1 deletion runtime/events/predefined/TransferEvent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { NetEvent } from '../NetEvent';
import { Address, ADDRESS_BYTE_LENGTH } from '../../types/Address';
import { BytesWriter } from '../../buffer/BytesWriter';
Expand Down
2 changes: 1 addition & 1 deletion runtime/events/predefined/UnstakeEvent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { NetEvent } from '../NetEvent';
import { BytesWriter } from '../../buffer/BytesWriter';

Expand Down
2 changes: 1 addition & 1 deletion runtime/generic/MapU256.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Revert } from '../types/Revert';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { Map } from './Map';

export class MapU256 extends Map<u256, u256> {
Expand Down
2 changes: 1 addition & 1 deletion runtime/interfaces/DeployContractResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { Address } from '../types/Address';

export class DeployContractResponse {
Expand Down
2 changes: 1 addition & 1 deletion runtime/math/bytes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u128, u256 } from 'as-bignum/assembly';
import { u128, u256 } from '@btc-vision/as-bignum/assembly';

export function bytes(number: u256[]): Uint8Array {
const result = new Uint8Array(32 * number.length);
Expand Down
2 changes: 1 addition & 1 deletion runtime/math/i256.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { i128, u128, u256 } from 'as-bignum/assembly';
import { i128, u128, u256 } from '@btc-vision/as-bignum/assembly';

export class i256 {

Expand Down
2 changes: 1 addition & 1 deletion runtime/math/u160.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { i128, u128 } from 'as-bignum/assembly';
import { i128, u128 } from '@btc-vision/as-bignum/assembly';
import { __carry, __uadd64, __umulh64 } from 'as-bignum/assembly/globals';

@lazy const HEX_CHARS = '0123456789abcdef';
Expand Down
2 changes: 1 addition & 1 deletion runtime/memory/AddressMemoryMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { MemorySlotPointer } from './MemorySlotPointer';
import { Blockchain } from '../env';
import { encodePointer } from '../math/abi';
import { MemorySlotData } from './MemorySlot';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { BytesWriter } from '../buffer/BytesWriter';
import { Address } from '../types/Address';

Expand Down
2 changes: 1 addition & 1 deletion runtime/memory/KeyMerger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MemorySlotData } from './MemorySlot';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { Blockchain } from '../env';
import { MemorySlotPointer } from './MemorySlotPointer';
import { encodePointer } from '../math/abi';
Expand Down
2 changes: 1 addition & 1 deletion runtime/memory/MemorySlotPointer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';

export type MemorySlotPointer = u256;
2 changes: 1 addition & 1 deletion runtime/memory/MultiAddressMemoryMap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MemorySlotData } from './MemorySlot';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { Uint8ArrayMerger } from './Uint8ArrayMerger';
import { Address } from '../types/Address';

Expand Down
2 changes: 1 addition & 1 deletion runtime/memory/MultiStringMemoryMap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MemorySlotData } from './MemorySlot';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { KeyMerger } from './KeyMerger';

@final
Expand Down
2 changes: 1 addition & 1 deletion runtime/memory/StringMemoryMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { MemorySlotPointer } from './MemorySlotPointer';
import { Blockchain } from '../env';
import { encodePointer } from '../math/abi';
import { MemorySlotData } from './MemorySlot';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { BytesWriter } from '../buffer/BytesWriter';

@final
Expand Down
2 changes: 1 addition & 1 deletion runtime/memory/Uint8ArrayMerger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MemorySlotData } from './MemorySlot';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { Blockchain } from '../env';
import { MemorySlotPointer } from './MemorySlotPointer';
import { encodePointer } from '../math/abi';
Expand Down
2 changes: 1 addition & 1 deletion runtime/secp256k1/ECPoint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { SafeMath } from '../types/SafeMath';

// secp256k1 curve parameters (using little-endian byte arrays)
Expand Down
2 changes: 1 addition & 1 deletion runtime/shared-libraries/OP20Utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Address, ADDRESS_BYTE_LENGTH } from '../types/Address';
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { BytesWriter } from '../buffer/BytesWriter';
import { Blockchain } from '../env';
import { encodeSelector, Selector } from '../math/abi';
Expand Down
2 changes: 1 addition & 1 deletion runtime/shared-libraries/TransferHelper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { encodeSelector, Selector } from '../math/abi';
import { Address, ADDRESS_BYTE_LENGTH } from '../types/Address';
import { BytesWriter } from '../buffer/BytesWriter';
Expand Down
2 changes: 1 addition & 1 deletion runtime/storage/Serializable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { Blockchain } from '../env';
import { MemorySlotPointer } from '../memory/MemorySlotPointer';
import { BytesWriter } from '../buffer/BytesWriter';
Expand Down
2 changes: 1 addition & 1 deletion runtime/storage/StorageBacked.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';

export interface StorageBacked {
serialize(): Array<u256>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/storage/StorageSlot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { BlockchainEnvironment } from '../env/BlockchainEnvironment';
import { Sha256 } from '../math/sha256';
import { MemorySlotPointer } from '../memory/MemorySlotPointer';
Expand Down
2 changes: 1 addition & 1 deletion runtime/storage/StorageValue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { StorageSlot } from './StorageSlot';

export class StorageValue<T> {
Expand Down
2 changes: 1 addition & 1 deletion runtime/storage/StoredAddress.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { u256 } from 'as-bignum/assembly';
import { u256 } from '@btc-vision/as-bignum/assembly';
import { Blockchain } from '../env';
import { encodePointer } from '../math/abi';
import { BytesWriter } from '../buffer/BytesWriter';
Expand Down
Loading

0 comments on commit 3cd1fe2

Please sign in to comment.