@btc-vision/btc-runtime 1.9.6 → 1.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -24,7 +24,13 @@ import { IOP721 } from './interfaces/IOP721';
|
|
|
24
24
|
import { OP721InitParameters } from './interfaces/OP721InitParameters';
|
|
25
25
|
import { ReentrancyGuard } from './ReentrancyGuard';
|
|
26
26
|
import { StoredMapU256 } from '../storage/maps/StoredMapU256';
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
ApprovedEvent,
|
|
29
|
+
ApprovedForAllEvent,
|
|
30
|
+
MAX_URI_LENGTH,
|
|
31
|
+
TransferredEvent,
|
|
32
|
+
URIEvent,
|
|
33
|
+
} from '../events/predefined';
|
|
28
34
|
import {
|
|
29
35
|
ON_OP721_RECEIVED_SELECTOR,
|
|
30
36
|
OP712_DOMAIN_TYPE_HASH,
|
|
@@ -613,7 +619,7 @@ export abstract class OP721 extends ReentrancyGuard implements IOP721 {
|
|
|
613
619
|
protected _setTokenURI(tokenId: u256, uri: string): void {
|
|
614
620
|
if (!this._exists(tokenId)) throw new Revert('Token does not exist');
|
|
615
621
|
|
|
616
|
-
if (uri.length > MAX_URI_LENGTH) {
|
|
622
|
+
if (<u32>uri.length > MAX_URI_LENGTH) {
|
|
617
623
|
throw new Revert('URI exceeds maximum length');
|
|
618
624
|
}
|
|
619
625
|
|
|
@@ -9,7 +9,7 @@ export const MAX_URI_LENGTH: u32 = 200;
|
|
|
9
9
|
@final
|
|
10
10
|
export class URIEvent extends NetEvent {
|
|
11
11
|
constructor(value: string, id: u256) {
|
|
12
|
-
const valueBytes:
|
|
12
|
+
const valueBytes: u32 = u32(String.UTF8.byteLength(value));
|
|
13
13
|
|
|
14
14
|
if (valueBytes > MAX_URI_LENGTH) {
|
|
15
15
|
throw new Revert('URI event exceeds max data size');
|