defining default values in makeTransaction function signature

This commit is contained in:
RcleydsonR
2022-11-22 08:35:24 -03:00
parent 15e5fed07b
commit 7256d59b49
2 changed files with 9 additions and 7 deletions

View File

@@ -42,7 +42,10 @@ const connectProvider = async () => {
});
};
const makeTransaction = async () => {
const makeTransaction = async (
receiverAccountAddress = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
ammount = "100.0"
) => {
const etherStore = useEtherStore();
const provider = getProvider();
if (!provider) return;
@@ -50,10 +53,9 @@ const makeTransaction = async () => {
const signer = provider.getSigner();
const contract = new ethers.Contract(addresses.token, mockToken.abi, signer);
const fixedAccount1Address = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8";
const tx = await contract.transfer(
fixedAccount1Address,
ethers.utils.parseEther("100.0")
receiverAccountAddress,
ethers.utils.parseEther(ammount)
);
await tx.wait();