Can a smart contract on NEAR control a contract on Aurora? - aurora-evm

Can a smart contract on NEAR control a contract on Aurora? If this happens, how does the user pay ETH gas fees when executing the transaction from the NEAR network?

Yes. The Aurora smart contract has two important functions:
"submit" (link) and
"call" (link).
Submit allows you to send a regular Ethereum transaction, signed by private key, and pay in ETH for the relayer (the actual NEAR account in use for calling submit).
Call receives the contract to be executed + the input to run on this contract (it already has the selector for the method and the payload). From another NEAR account call can be used, and there is no need to pay ETH at all (only NEAR). The msg.sender inside solidity that will be used in this case will be the derived address for the NEAR account making the call: hash("awesome.NEAR")
There is no need to attach ETH to call to pay for gas (you're running on NEAR directly so you'll pay for gas with NEAR), but you may need to attach ETH because of the functionality of the contract you want to interact with.

Related

Is there a way to trigger an event inside a contract when ERC20 tokens are sent to that contract?

I have a smart contract, which has an address when deployed.
I want users to send ERC20 tokens to the smart contract address without using specific functions of the contract (USDC for instance) and I want to be able to trigger functions when this happens. Fundamentally, I want to keep track of the number of ERC20 tokens that each address has sent to the contract address.
I am looking for a similar solution to the receive() function, which would work if what I receive in the smart contracts is ETH, and I can just use msg.value. However, with ERC20 the receive function is not triggered.
Any ideas?
Thanks in advance
I want users to send ERC20 tokens to the smart contract address without using specific functions of the contract (USDC for instance) and I want to be able to trigger functions when this happens.
ERC-20 does not support this. Newer token standards, like ERC-777, support this use case. With some luck, some tokens implement transferAndCall() or similar function, but it is not part of ERC-20 standard.
For ERC-20 you need to approve() and transferFrom() dance - which is not ideal.
After some research, I think it is not possible to trigger an event from the smart contract when the tokens arrive, because, in the process of sending the ERC20 tokens, the interaction happens with ERC20 token contract, not with the smart contract where the tokens will arrive.
This is because the only place where the ERC20 balances are altered is in the ERC20 token contract itself, not in your smart contract.
Therefore, there is no way to trigger any event when the erc20 tokens arrive at the smart contract. That I know of.

How to create a custom webhook URL per address via API

We are creating a custom payment service that uses Coinbase as a Bitcoin backbone. I managed to set up Bitcoin address creation (wallets) and the checkout process is actually finished (Bitcoin address is being created).
However, I did not find a way to attach a custom callback URL to an address I've created. The address should "listen" to incoming transactions and trigger the webhook URL.
We cannot use any of the predigested merchant solutions from Coinbase (button / page / iframe) because the payment flow should be deeply integrated into our existing processes, look and feel. Instead the system is just creating a new Bitcoin address and should be notified on incoming transaction events, but without using a merchant solution.
When creating an address using the Coinbase API v2, you get an object that includes the callback_url property. However, it is empty and in the documentation there is no hint on how to specify that.
I thought about polling the addresses, but that could easily exceed the 10,000 requests per hour rate limit. Any clues how to specify the callback_url on address creation (https://api.coinbase.com/v2/accounts/:account_id/addresses)?
I’d recommend a third-party for this - I’ve personally used https://blockchainwebhooks.com and https://www.blockcypher.com - both have been reliable and offer free plans. Blockchain WebHooks is significantly more affordable, that’s what we still used today.

Has anyone had success using PayPal SoftDescriptors?

Paypal provides access to a parameter called "SoftDescriptor" in a number of their payment request API calls, in the classic API (either NVP or SOAP). In theory, this parameter lets you send transaction-specific data along with your request, which will be passed along to the buyer's credit card statement.
This parameter is available on at least:
DoCapture
DoReferenceTransaction
DoExpressCheckoutPayment
I cannot, for the life of me, get this to work. None of these calls seem to set the softdescriptor for the initial descriptor (Which shows up in the bank statement while the charge is pending, before the payment posts). I've been waiting a few days for the payments to post to see if it will change at that point, but I'm skeptical.
Has anyone successfully used the SoftDescriptor? Did it require extra account setup?
This might be very late.
Soft Descriptors is supported only for US,UK and CA merchants.
Your account needs to be enabled for Soft Descriptor.You can contact Businesss/Customer Support to get this enabled.
https://developer.paypal.com/docs/classic/release-notes/merchant/PayPal_Merchant_API_Release_Notes_115/#softdescriptorforpro
Sorry, I know this is an old post, but I was looking for the same answer to the same question and I thought I would share what I found.
You should be able to use the following link to move past this error. In my case, I had a comma after the wrong right curly brace. Just copy and paste the example, in the aforementioned link, and change the values to meet your needs.
And I am about to post my own question about why the transaction amount is considered invalid

Dwolla reflector off-site test account and Payment Activity

Using the off-site test account (Dwolla Reflector), I am able to get a successful transaction indicated by status=Completed. I also get all of the expected results including an empty transactionid, valid signature, checkout id etc.. when in test mode. However, no payment activity in my account at all.
The documentation for the reflector doesn't specify usage of test-mode or not. My assumption was a test account would be in test-mode but one could also assume based on the documentation that test-mode should not be used.
Can anyone clarify the conditions to properly use the Dwolla reflector to actually see payment activity? I'm looking for all of the required conditions if possible including, for example, if a valid funding source must be setup and verified to use the reflector and see payment activity in the Dwolla dashboard. (or perhaps point me to documentation that addresses this?)
I just recently coded against the Dwolla API and against the reflector service. Assuming you have your own personal dwolla account, you can generate a token to represent you here. Since I'm not sure what language you're using, I'll assume php. It is likely you now have a code snippet like this:
$Dwolla = new DwollaRestClient();
$Dwolla->setToken("<your personal generated token from above link>");
$trans_id = $Dwolla->send("<Your Personal 4 digit pin>", "812-713-9234", 0.01, "Dwolla", "My sample transaction detail notes");
if(!$trans_id) {
echo "Error: {$Dwolla->getError()} \n";
} else {
echo "Sent transaction ID: {$trans_id} \n";
}
Please note to use this code sample you need to replace the 2 values surrounded in chevrons with the appropriate described values. Note: The account you are sending to denoted by "812-713-9234" is dwolla's reflector service.
With this code sample, you will send a penny from your own account to the reflector service. After roughly 10 minutes the penny gets returned to your account. You will get a transaction ID each time it is successful. If it is not successful you will get an error code.
If it helps, I got an error code the first time around with something about a non-valid SSN. It turns out I hadn't logged into my account for a while and I needed to confirm my SSN at dwolla.com, however initially I thought this was some error because the reflector service wasn't setup appropriately (since it's a fake service it wouldn't have a valid SSN associated with it).
My understanding is the reflector service is for purely testing your end of things - not to verify what things look like inside the reflector account as far as transaction line item detail from the payee's perspective. If you look at the send() function in the dwolla API it does specify what all the variables you can pass are (this would tell you the level of data and details the transaction will store).
As for specific error codes you can expect, they are documented with meanings here under the error codes section (expand if necessary): https://developers.dwolla.com/dev/docs/transactions/send
After working with other payment networks it is hard not to make assumptions about Dwolla.
The TestMode=LIVE or TestMode=TEST. One assumption being that a test account would allow you to
complete the entire test cycle. However this is not the case with Dwolla. Here is what I found
that addresses the exact requirements to use the Dwalla reflector account.
1. Developer Account Setup
2. Account must be 100% active and have valid funds
3. TestMode=LIVE
4. Amounts less than 10.00 (if you want to avoid fees)
The Dwolla reflector account has nothing to do with TestMode and trying to set TestMode=TEST output unexpected
results. (compared to other payment networks i've worked with).
The cause, in my case was the funds had not yet cleared (account not 100%) and I thought the reflector account was a test account
because the Dwolla documentation at https://developers.dwolla.com/dev/pages/testing says it is a test account
but makes no mention of the configuration setting of TestMode=Live. A test account you would think would require
test mode / environment.

Dialogic - how do I set my BTN (billing telephone number) for outgoing calls

I have an application that uses Dialogic voice boards with PRI phone lines. We make phone calls on behalf of schools and spoof the caller ID to get the school's telephone number to display. When making outbound calls, we set the school's phone number in gc_makecallblk.isdn.origination_phone_number. That works great.
The problem is that our phone vendor is using the caller ID number when determining billing rates, and so most of our calls are getting billed as in-state calls, which are more expensive. I've been told by the vendor that I need to set the BTN (billing telephone number, he also called it ANI, but I think that is a more generic term) to get the correct, out-of-state, billing rates.
I have searched Dialogic's API documentation and I have not been able to find any information about setting the BTN. Are there any Dialogic/Telephony experts out there who know how to set it?
What protocol are you talking about and is this on TDM or VoIP? I am an Aculab expert and we have similar products to Dialogic so perhaps I could help.
It could be that you simply need to set the "National/International" call parameter or edit the ANI (also known as CLI). The more information you can share, the better.
ChrisL#Aculab