Skip to content

Commit 31d341f

Browse files
committed
Update faucet
1 parent 036d74a commit 31d341f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/App.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
const networkOptionsFile = await fetch('./networks.json');
1212
const networkOptions: NetworkOption[] = await networkOptionsFile.json();
1313
networks.set(networkOptions);
14-
selectedNetwork.set(networkOptions[0]);
14+
selectedNetwork.set(networkOptions[1]);
1515
});
1616
</script>
1717

src/components/faucet/Faucet.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
evmAddress,
5353
$selectedNetwork.chainAddress,
5454
balance,
55-
BigInt(500000),
55+
BigInt(5000000),
5656
);
5757
toast.pop(toastId);
5858

src/components/faucet/send_funds_transaction.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ export class SendFundsTransaction {
5252
Converter.hexToBytes(evmAddress.toLowerCase()),
5353
); // EVM address
5454

55-
/* Write contract arguments */
56-
metadata.writeUInt32LE(2);
55+
/* Write length of contract arguments (1) */
56+
metadata.writeUInt32LE(1);
5757

5858
// Write evm address (arg1)
59-
metadata.writeUInt16LE(1);
60-
metadata.writeInt8('a'.charCodeAt(0));
61-
metadata.writeUInt32LE(evmAddressBuffer.buffer.length);
62-
metadata.writeBytes(evmAddressBuffer.buffer);
63-
59+
metadata.writeUInt16LE(1); // Length of key (len(a) == 1)
60+
metadata.writeInt8('a'.charCodeAt(0)); // Write key (a == 'agentID')
61+
metadata.writeUInt32LE(evmAddressBuffer.buffer.length); // Length of value (len(agentID) == 21 for evm address)
62+
metadata.writeBytes(evmAddressBuffer.buffer); // Write value (bytes(agentID))
63+
console.log(evmAddressBuffer.buffer.length)
6464
/* Write allowance */
6565
metadata.writeUInt8(0); // Has allowance (255 if no allowance is set)
6666
metadata.writeUInt64LE(amount - gas); // IOTA amount to send

0 commit comments

Comments
 (0)