NiAlexSan
NiAlexSan
FFlow
Created by NiAlexSan on 8/23/2024 in #🛠│developer-questions
Alex Ni | Flow 4D (2024-08-23)
for the future reference, this code works:
sdktemplates "github.com/onflow/flow-go-sdk/templates"
...
pAdminKey, err := sdktemplates.AccountKeyToCadenceCryptoKey(a.partialAdminAccountKey)
if err != nil {
panic("could not convert partialAdminAccountKey")
}
...

AddRawArgument(jsoncdc.MustEncode(pAdminKey)).
sdktemplates "github.com/onflow/flow-go-sdk/templates"
...
pAdminKey, err := sdktemplates.AccountKeyToCadenceCryptoKey(a.partialAdminAccountKey)
if err != nil {
panic("could not convert partialAdminAccountKey")
}
...

AddRawArgument(jsoncdc.MustEncode(pAdminKey)).
4 replies
FFlow
Created by NiAlexSan on 8/15/2024 in #🛠│developer-questions
Alex Ni | Flow 4D (2024-08-15)
sorry, I mean wrapped fiat token
6 replies
FFlow
Created by NiAlexSan on 8/15/2024 in #🛠│developer-questions
Alex Ni | Flow 4D (2024-08-15)
the user is 0xbec12e53f2772fbc and path is usdcFlowVault probably it's related to the new fiat token vault
6 replies
FFlow
Created by NiAlexSan on 5/17/2024 in #🛠│developer-questions
Alex Ni | Flow 4D (2024-05-17)
I think I'm using a wrong address after the contract deployment
10 replies
FFlow
Created by NiAlexSan on 5/17/2024 in #🛠│developer-questions
Alex Ni | Flow 4D (2024-05-17)
I used this command to deploy the contract:
forge create --rpc-url https://previewnet.evm.nodes.onflow.org \
--private-key <private key> \
--constructor-args 0xa7aF43d9AB4dcbEcf1326BF3a4E4c206d2034041 \
--legacy \
src/FlowNFT.sol:FlowNFT
forge create --rpc-url https://previewnet.evm.nodes.onflow.org \
--private-key <private key> \
--constructor-args 0xa7aF43d9AB4dcbEcf1326BF3a4E4c206d2034041 \
--legacy \
src/FlowNFT.sol:FlowNFT
10 replies
FFlow
Created by NiAlexSan on 5/17/2024 in #🛠│developer-questions
Alex Ni | Flow 4D (2024-05-17)
contract code:
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract FlowNFT is ERC721URIStorage, Ownable {
constructor(address initialOwner) ERC721("Flow Ducks", "FDX") Ownable(initialOwner) {}

function mint(
address _to,
uint256 _tokenId,
string calldata _uri
) external onlyOwner {
_mint(_to, _tokenId);
_setTokenURI(_tokenId, _uri);
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract FlowNFT is ERC721URIStorage, Ownable {
constructor(address initialOwner) ERC721("Flow Ducks", "FDX") Ownable(initialOwner) {}

function mint(
address _to,
uint256 _tokenId,
string calldata _uri
) external onlyOwner {
_mint(_to, _tokenId);
_setTokenURI(_tokenId, _uri);
}
}
10 replies
FFlow
Created by NiAlexSan on 5/17/2024 in #🛠│developer-questions
Alex Ni | Flow 4D (2024-05-17)
10 replies
FFlow
Created by NiAlexSan on 5/17/2024 in #🛠│developer-questions
Alex Ni | Flow 4D (2024-05-17)
how do you usually run scripts with foundry? am I missing anything?
10 replies
FFlow
Created by NiAlexSan on 4/25/2024 in #🛠│developer-questions
Alex Ni | Flow 4D (2024-04-25)
ah, good catch @Peter | Flow apparently we're using SHA2_256 for mainnet and SHA3_256 for testnet I'm not sure why though
5 replies