Interacting with a deployed contract on Aepp Studio

I am using AE Studio (aepps.com) but I want to pass an address of my deployed ‘Subscription’ contract to my ‘Ride’ contract like this
image
where I have passed ct_217RRtTbzmJN3EJzmLjMvh2FU5DCgK25mKdnHGx4X6sK5SsZUr
my ride contract’s init() is like:
stateful entrypoint init(_subs_contract: Subscription) = { subs_contract=_subs_contract, rides={} }
Subscription contract is like:
contract Subscription = entrypoint getTime: () => int entrypoint getCancellations: (address) => int

but everytime I try to do it gets failed with the error
Please help me resolve this on Ae-studio

**error** : { "message": "Request failed with status code 400", "name": "Error", "stack": "Error: Request failed with status code 400\n at LYNF.e.exports (http://studio.aepps.com/main-es2015.da2a72d6eade6340f1e9.js:1:898393)\n at Rn+g.e.exports (http://studio.aepps.com/main-es2015.da2a72d6eade6340f1e9.js:1:1023471)\n at XMLHttpRequest.d.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (http://studio.aepps.com/main-es2015.da2a72d6eade6340f1e9.js:1:2031117)\n at XMLHttpRequest.T (http://studio.aepps.com/polyfills-es2015.fbccaefecb91ec072fde.js:1:38894)\n at u.invokeTask (http://studio.aepps.com/polyfills-es2015.fbccaefecb91ec072fde.js:1:29446)\n at a.runTask (http://studio.aepps.com/polyfills-es2015.fbccaefecb91ec072fde.js:1:24855)\n at l.invokeTask [as invoke] (http://studio.aepps.com/polyfills-es2015.fbccaefecb91ec072fde.js:1:30496)\n at f (http://studio.aepps.com/polyfills-es2015.fbccaefecb91ec072fde.js:1:42769)\n at XMLHttpRequest.p (http://studio.aepps.com/polyfills-es2015.fbccaefecb91ec072fde.js:1:43014)", "config": { "url": "https://latest.compiler.aepps.com/encode-calldata", "method": "post", "data": "{\"source\":\"contract Subscription =\\n entrypoint getTime: () => int\\n entrypoint getCancellations: (address) => int\\n\\ncontract Ride = \\n record state = {\\n subs_contract:Subscription,\\n rides:map(int,ride)\\n }\\n record ride = {\\n counterquoters:list(address)\\n }\\n stateful entrypoint init(_subs_contract: Subscription) = {\\n subs_contract=_subs_contract,\\n rides={}\\n }\\n public entrypoint getTime() : int=\\n let time : int = state.subs_contract.getTime()\\n time\\n\\n public stateful entrypoint cancelRide() : int =\\n require(state.subs_contract.getCancellations(Call.caller)>0,\\\"Max Cancellations Done\\\")\\n 5\\n \\n public stateful entrypoint counterquote(ride_id: int, premium: int):int =\\n let counterquoters: list(address) = state.rides[ride_id].counterquoters\\n 5\",\"function\":\"init\",\"arguments\":[\"undefined\"],\"options\":{\"backend\":\"fate\",\"file_system\":{}}}", "headers": { "Accept": "application/json, text/plain, */*", "Content-Type": "application/json" }, "transformRequest": [ null ], "transformResponse": [ null ], "timeout": 0, "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN", "maxContentLength": -1, "waitMined": true, "denomination": "aettos", "clientTtl": 84600, "nameTtl": 50000, "nameFee": 0, "deposit": 0, "gasPrice": 1000000000, "amount": 0, "gas": 1579000, "options": "", "dryRunAccount": { "pub": "ak_11111111111111111111111111111111273Yts", "amount": "100000000000000000000000000000000000" }, "queryFee": 30000, "oracleTtl": { "type": "delta", "value": 500 }, "queryTtl": { "type": "delta", "value": 10 }, "responseTtl": { "type": "delta", "value": 10 }, "skipArgsConvert": false, "skipTransformDecoded": false, "callStatic": false, "top": null, "verify": false, "filesystem": {}, "interval": 500, "blocks": 3, "allowUnsynced": true } }

2 Likes

Hello @fuzious, I would have said you make use of https://contracts.aeternity.art/ for this if you are using the testnet network. The only issue at the moment is that it’s not connecting to the testnet network(on my device).

So, it can’t be done in AE-studio?

Let’s check with @nikitafuchs.chain about this.

2 Likes

hey @fuzious, let me quickly investigate your issue. Could you join AE’s discord please and contact me there (n1cK is my username), in case I need some more info from you ? https://discord.gg/zYbqj42N

Edit: Fixed, please try again now.

1 Like